AgenticRepair:面向智能体漏洞修复的多方面程序上下文工程 AgenticRepair: Multi-Faceted Program Context Engineering for Agentic Vulnerability Repair 预印本
原文摘要
查看英文原文摘要
Automated vulnerability repair aims to reduce the time and effort required to patch security flaws from a vulnerability triage report. Recent agentic AI approaches have shown promising results in automated program repair. However, vulnerability repair demands richer program context than general bug repair - context that security engineers routinely assemble in practice but that existing agentic approaches do not engineer. We identify three critical gaps: code-structure context capturing cross-file data flows and memory operation patterns, runtime-execution context revealing crash semantics and memory origins, and commit-history context recovering how fragile code patterns were introduced. We present AgenticRepair, an agentic vulnerability repair framework that addresses the gaps through multi-faceted program context engineering. AgenticRepair orchestrates three specialized LLM subagents to engineer the contexts, which are then embedded into the memory of a dedicated repair subagent for context-conditioned patch synthesis. Evaluated on SEC-Bench comprising 300 real-world instances with sanitizer-based patch verification, AgenticRepair achieves a 73% success rate, substantially outperforming the strongest baseline by 29%. Our ablation study confirms that the three context facets are mutually complementary, and that multi-agent scaffolding and base-model capacity each play an essential role. Collectively, these findings establish multi-faceted program context engineering as a promising design direction for agentic vulnerability repair.
📚 参考文献 (36 条)
查看全部 36 条
- [1] Aider, “Aider,” 2026, accessed: 2026-02-26.
- [Online]. Available: https://aider.chat/
- [2] G. Bhandari, N. Gavric, and A. Shalaginov, “Generating vulnerability security fixes with code language models,” Information and Software Technology, vol. 185, p. 107786, 2025.
- [3] G. Bhandari, A. Naseer, and L. Moonen, “Cvefixes: automated collec- tion of vulnerabilities and their fixes from open-source software,” in Proceedings of the 17th International Conference on Predictive Models and Data Analytics in Software Engineering, 2021, pp. 30–39.
- [4] A. Bosu, J. C. Carver, M. Hafiz, P. Hilley, and D. Janni, “Identifying the characteristics of vulnerable code changes: An empirical study,” in Proceedings of the 22nd ACM SIGSOFT international symposium on foundations of software engineering, 2014, pp. 257–268.
- [5] I. Bouzenia, P. Devanbu, and M. Pradel, “Repairagent: An autonomous, llm-based agent for program repair,” in 2025 IEEE/ACM 47th Interna- tional Conference on Software Engineering (ICSE). IEEE, 2025, pp. 2188–2200.
- [6] Y. Chen, Z. Ding, L. Alowain, X. Chen, and D. Wagner, “Diversevul: A new vulnerable source code dataset for deep learning based vulnerability detection,” in Proceedings of the 26th international symposium on research in attacks, intrusions and defenses, 2023, pp. 654–668.
- [7] Z. Chen, S. Kommrusch, and M. Monperrus, “Neural transfer learning for repairing security vulnerabilities in c code,” IEEE Transactions on Software Engineering, vol. 49, no. 1, pp. 147–165, 2022.
- [8] J. Fan, Y. Li, S. Wang, and T. N. Nguyen, “Ac/c++ code vulnerability dataset with code changes and cve summaries,” in Proceedings of the 17th international conference on mining software repositories, 2020, pp. 508–512.
- [9] M. Fu, V. Nguyen, C. Tantithamthavorn, D. Phung, and T. Le, “Vision transformer inspired automated vulnerability repair,” ACM Transactions on Software Engineering and Methodology, vol. 33, no. 3, pp. 1–29, 2024.
- [10] M. Fu, C. Tantithamthavorn, T. Le, Y. Kume, V. Nguyen, D. Phung, and J. Grundy, “Aibughunter: A practical tool for predicting, classifying and repairing software vulnerabilities,” Empirical Software Engineering, vol. 29, no. 1, p. 4, 2024.
- [11] M. Fu, C. Tantithamthavorn, T. Le, V. Nguyen, and D. Phung, “Vulre- pair: a t5-based automated software vulnerability repair,” in Proceedings of the 30th ACM joint european software engineering conference and symposium on the foundations of software engineering, 2022, pp. 935– 947.
- [12] M. Fu, C. K. Tantithamthavorn, V. Nguyen, and T. Le, “Chatgpt for vulnerability detection, classification, and repair: How far are we?” in 2023 30th Asia-Pacific Software Engineering Conference (APSEC). IEEE, 2023, pp. 632–636.
- [13] X. Gao, B. Wang, G. J. Duck, R. Ji, Y. Xiong, and A. Roychoudhury, “Beyond tests: Program vulnerability repair via crash constraint extrac- tion,” ACM Transactions on Software Engineering and Methodology (TOSEM), vol. 30, no. 2, pp. 1–27, 2021.
- [14] K. Huang, J. Zhang, X. Bao, X. Wang, and Y. Liu, “Comprehensive fine- tuning large language models of code for automated program repair,” IEEE Transactions on Software Engineering, vol. 51, no. 4, pp. 904–928, 2025.
- [15] M. Jiang, J. Jiang, T. Wu, Z. Ma, X. Luo, and Y. Zhou, “Understanding vulnerability inducing commits of the linux kernel,” ACM Transactions on Software Engineering and Methodology, vol. 33, no. 7, pp. 1–28, 2024.
- [16] H. Lee, “Sec-bench: Can llm agents solve critical security challenges?” https://sec-bench.github.io/, 2025.
- [17] H. Lee, Z. Zhang, H. Lu, and L. Zhang, “Sec-bench: Automated benchmarking of llm agents on real-world software security tasks,” arXiv preprint arXiv:2506.11791, 2025, to appear in NeurIPS 2025.
- [18] M. Ma, J. Zhang, F. Yang, Y. Kang, Q. Lin, S. Rajmohan, and
- 12 D. Zhang, “Dover: Intervention-driven auto debugging for llm multi- agent systems,” arXiv preprint arXiv:2512.06749, 2025.
- [19] X. Mei, P. S. Singaria, J. Del Castillo, H. Xi, T. Bao, R. Wang, Y. Shoshitaishvili, A. Doup´e, H. Pearce, B. Dolan-Gavitt et al., “Arvo: Atlas of reproducible vulnerabilities for open source software,” arXiv preprint arXiv:2408.02153, 2024.
- [20] mity, “Use of uninitialized value in the md analyze line() function,” GitHub issue #155 in mity/md4c, 2021, cVE-2021-30027. [Online]. Available: https://github.com/mity/md4c/issues/155
- [21] P. Rondon, R. Wei, J. Cambronero, J. Cito, A. Sun, S. Sanyam, M. Tufano, and S. Chandra, “Evaluating agent-based program repair at google,” in 2025 IEEE/ACM 47th International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP). IEEE, 2025, pp. 365–376.
- [22] A. Roucher, A. V. del Moral, T. Wolf, L. von Werra, and E. Kaunism¨aki, “‘smolagents‘: a smol library to build great agentic systems.” https:// github.com/huggingface/smolagents, 2025.
- [23] Y. Roumani, “Patching zero-day vulnerabilities: an empirical analysis,” Journal of Cybersecurity, vol. 7, no. 1, p. tyab023, 2021.
- [24] X. Wang, B. Li, Y. Song, F. F. Xu, X. Tang, M. Zhuge, J. Pan, Y. Song, B. Li, J. Singh et al., “Openhands: An open platform for ai software developers as generalist agents,” arXiv preprint arXiv:2407.16741, 2024.
- [25] Z. Wang, T. Shi, J. He, M. Cai, J. Zhang, and D. Song, “Cybergym: Evaluating ai agents’ cybersecurity capabilities with real-world vulner- abilities at scale,” arXiv e-prints, pp. arXiv–2506, 2025.
- [26] X.-C. Wen, Z. Lin, Y. Yang, C. Gao, and D. Ye, “Vul-r2: A reasoning llm for automated vulnerability repair,” in 2025 40th IEEE/ACM Inter- national Conference on Automated Software Engineering (ASE). IEEE, 2025, pp. 26–38.
- [27] C. S. Xia, Y. Deng, S. Dunn, and L. Zhang, “Agentless: De- mystifying llm-based software engineering agents,” arXiv preprint arXiv:2407.01489, 2024.
- [28] C. S. Xia and L. Zhang, “Automated program repair via conversation: Fixing 162 out of 337 bugs for $0.42 each using chatgpt,” in Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis, 2024, pp. 819–831.
- [29] F. Yamaguchi, N. Golde, D. Arp, and K. Rieck, “Modeling and discover- ing vulnerabilities with code property graphs,” in 2014 IEEE symposium on security and privacy. IEEE, 2014, pp. 590–604.
- [30] J. Yang, C. E. Jimenez, A. Wettig, K. Lieret, S. Yao, K. Narasimhan, and O. Press, “Swe-agent: Agent-computer interfaces enable automated soft- ware engineering,” Advances in Neural Information Processing Systems, vol. 37, pp. 50 528–50 652, 2024.
- [31] S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. R. Narasimhan, and Y. Cao, “React: Synergizing reasoning and acting in language models,” in The eleventh international conference on learning representations, 2022.
- [32] S. Zhang, M. Yin, J. Zhang, J. Liu, Z. Han, J. Zhang, B. Li, C. Wang, H. Wang, Y. Chen et al., “Which agent causes task failures and when? on automated failure attribution of llm multi-agent systems,” arXiv preprint arXiv:2505.00212, 2025.
- [33] Y. Zhang, H. Ruan, Z. Fan, and A. Roychoudhury, “Autocoderover: Autonomous program improvement,” in Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis, 2024, pp. 1592–1604.
- [34] X. Zhou, K. Kim, B. Xu, D. Han, and D. Lo, “Out of sight, out of mind: Better automatic vulnerability repair by broadening input ranges and sources,” in Proceedings of the IEEE/ACM 46th international conference on software engineering, 2024, pp. 1–13.