TRACE: Patch-Aware Retrieval-Augmented Reasoning for High-Recall Vulnerability Triage
Abstract Security patches often preserve dangerous operations while changing the conditions under which they execute. LLM-based vulnerability detectors must therefore distinguish the presence of such operations from the persistence of their vulnerability causes. We present TRACE, a patch-aware retrieval-augmented framework for high-recall, function-level vulnerability triage. TRACE links structural evidence from historical vulnerable/fixed code pairs with explicit repair principles, retrieves relevant contrasts through dependency-aware re-ranking, and guides an LLM to check dangerous-path alignment, vulnerability-cause matching, and equivalent safeguards in the target function. Inference requires no target-side repair patch. On 586 PairVul repair pairs, TRACE achieves 93.52\% recall and 75.48\% F1, compared with 95.05\% and 73.58\% for VulInstruct. It correctly classifies both revisions in 40.27\% of pairs, versus 34.98\%, and produces 53 fewer false positives on repaired functions. On a fixed 301-function SecVulEval subset, TRACE achieves 92.50\% recall and 70.48\% F1, compared with 78.33\% and 62.88\% for VulInstruct. The F1 differences on both datasets and the PairVul pair-accuracy difference do not reach significance under Holm adjustment. Ablations show lower F1 without repair principles or fixed-side evidence, while error analysis identifies safeguard-equivalence failures as a recurring source of false positives in audited cases. These findings suggest that linked repair contrasts can support high-recall vulnerability triage, although reliably recognizing equivalent safeguards remains a limitation.
Authors
- Lina Gong (ORCID: https://orcid.org/0000-0002-5272-6706)
- Xiaolin Ju (ORCID: https://orcid.org/0000-0003-2579-5359)
- D. Zhang (ORCID: https://orcid.org/0000-0001-7709-2896)
- Zhan Gao
- Xiang Chen
Institutions
- Nantong University (CN)
- Nanjing University of Aeronautics and Astronautics (CN)
Publication Details
- Journal
- Research Square
- Published
- 2026-11-13
- DOI
- https://doi.org/10.21203/rs.3.rs-11482209/v1
- Primary Topic
- Software Engineering Research
- Type
- preprint