Finding vulnerable code clones from known vulnerability cases: Seed construction, detector comparison, and manual assessment
2026 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesis
Abstract [en]
Code cloning can cause security issues when vulnerable code is copied, modified or left unpatched in other parts of a software system. This thesis investigates how known vulnerability cases can be used to search for potential vulnerable code clones in open-source codebases. First, it examines how to delimit the vulnerability-bearing code, then how to transform that code into detector-specificinput, and finally how to assess whether retrieved candidates still retain the vulnerable logic.
The thesis defines a seed-based workflow based on public Common Vulnerabilities and Exposures (CVE) cases. For each case, a seed code region is selected manually from the vulnerable pre-patch code with the aid of the patch. Detector-specific seeds are then derived from this common region and used with two clone detection approaches, where the first is NiCad, which is a configurable near-miss clone detector, and the second is VUDDY, which is a function-level vulnerability clone detector. Retrieved candidates are collected and evaluated manually using a framework that separates code similarity from vulnerability preservation.
The main detector runs produced 15 raw reports, which were reduced to five unique candidate groups following pooling. All five groups were evaluated manually. None of the assessed candidates retained the vulnerable logic. Four candidates were syntactically related to the seed code region but represented patched variants, while one candidate was not meaningfully related.
The results show that detector output should be treated as candidate retrieval rather than confirmation of vulnerable code clones. They also show that seed construction, detector granularity, configuration choices, candidate pooling and manual vulnerability assessment are all important when using clone detection approaches for the analysis of vulnerable code clones.
Place, publisher, year, edition, pages
2026. , p. 80
Keywords [en]
Vulnerable code clone detection, Recurring vulnerability detection, Code clone detection, Software security, Security patch analysis, CVE-based vulnerability analysis, Clone-based vulnerability detection, Vulnerability-preserving similarity, Near-miss code clones, Manual vulnerability assessment
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:liu:diva-225998ISRN: LIU-IDA/LITH-EX-A--26/065--SEOAI: oai:DiVA.org:liu-225998DiVA, id: diva2:2084577
External cooperation
-
Presentation
(English)
Supervisors
Examiners
2026-07-062026-07-062026-07-06Bibliographically approved