TL;DR
VERCATION is a novel framework that precisely identifies which versions of open-source software (OSS) are affected by a specific vulnerability. By combining the structural precision of program slicing with the semantic reasoning of Large Language Models (LLMs), it achieves a 93.1% F1 score and has already identified over 200 errors in the National Vulnerability Database (NVD).
What Problem Does This Paper Address?
When a security vulnerability is discovered in an open-source project, developers need to know exactly which released versions are "poisoned." Unfortunately, the industry standard—the National Vulnerability Database (NVD)—is often inaccurate, frequently listing too many versions (over-inclusion) or missing affected ones entirely.
Existing automated tools struggle because they rely on rigid, human-defined rules or simple "code clone" detection. These methods often fail for two reasons:
- Noise: They can't distinguish between code that is actually part of the vulnerability logic and irrelevant surrounding code.
- Refactoring: Developers often reorganize code (e.g., moving a logic block into a new helper function). Standard tools see this as a "change" and lose the trail, incorrectly assuming the vulnerability was introduced or fixed at that point.
Methods
VERCATION uses a three-phase approach to bridge the gap between raw code changes and semantic vulnerability understanding.
Phase 1: Vulnerable Code Extraction The process starts with a vulnerability-fixing commit (vfc). VERCATION uses program slicing to identify "dangerous flows"—statements that directly or indirectly affect the variables involved in the patch. To filter out the noise, it feeds these flows into an LLM (specifically DeepSeek-V3, GPT-4, or CodeLlama) using Few-shot and Chain-of-Thought (CoT) prompting. The LLM acts as a "security researcher," reasoning about the vulnerability logic to pinpoint the exact statements that constitute the flaw.
Phase 2: Code Clone Detection Once the vulnerable statements are identified, VERCATION backtracks through the project's Git history to find the vulnerability-introducing commit (vic). To handle refactoring, it uses a sophisticated clone detection method:
- Method Expansion: It inlines function calls during analysis to reconstruct the original logic even if it was moved to a different function.
- AST Normalization: It converts code into Abstract Syntax Trees (ASTs) and standardizes them (e.g., turning
forloops intowhileloops) to ignore stylistic differences. - Statement Weighting: It assigns higher importance to statements involving "sensitive functions" (like
memcpyormalloc) that are common triggers for exploits.
Phase 3: Version Range Determination
Finally, it uses commit reachability to map the timeline between the vic and the vfc to specific software version tags.
Datasets
The authors curated a new ground-truth dataset to evaluate VERCATION:
- 122 CVEs across 12 popular OSS projects (including FFmpeg, Binutils, and Libxml2).
- 1,211 software versions in total.
- Manual Verification: Every version was meticulously labeled using public Proof-of-Concept (PoC) exploits and manual code audits to ensure the ground truth was actually correct.
Key Insights and Ideas
- The "Symbiotic" Approach: Static analysis is great at finding where data flows, but bad at understanding why it matters. LLMs are the opposite. By using static analysis to "crop" the code into relevant slices before giving it to the LLM, VERCATION avoids the "lost in the middle" problem where LLMs struggle with very long contexts.
- Refactoring is the Enemy of Backtracking: A significant finding was that 32.2% of commits encountered during backtracking were refactoring commits. Without VERCATION's AST-based inlining and normalization, these would have been false positives.
- LLMs are Generalists, Not Databases: The authors proved that the LLM's effectiveness comes from its ability to reason about code structure, not from "remembering" specific CVEs from its training data. The models performed consistently well even on vulnerabilities published after their training cutoff dates.
Key Results
- State-of-the-Art Performance: VERCATION achieved an F1 score of 93.1%, significantly outperforming existing tools like V-SZZ (80.1%) and V0Finder (78.5%).
- Correcting the Record: The tool identified 202 incorrect version reports in the NVD. For example, in some cases, the NVD listed only one version as vulnerable when, in reality, a dozen were affected.
- Efficiency: It analyzes a vulnerability in an average of 28.6 seconds, making it fast enough for real-world deployment.
- Cost-Effective: Using the DeepSeek-V3 API, the average cost per vulnerability analysis was a mere $0.0034.
Limitations and Future Work
While powerful, VERCATION has some hurdles to clear:
- Language Support: The current prototype is optimized for C/C++. While the methodology is language-agnostic, the underlying static analysis tools and "sensitive function" tables need to be updated for languages like Java or Python.
- Static Analysis Gaps: The tool relies on Joern for slicing, which can struggle with complex pointer arithmetic or indirect function calls (like callbacks).
- Inter-procedural Logic: Currently, VERCATION analyzes functions independently. If a vulnerability depends on a complex interaction across many different files, the tool might miss the full picture. The authors plan to integrate more advanced inter-procedural analysis in future versions.
Summary updated