CoSA:基于大语言模型上下文分析的上下文感知严重性评估 CoSA: Context-Aware Severity Assessment via Context Analysis with Large Language Models 预印本
原文摘要
查看英文原文摘要
Accurate vulnerability severity assessment is essential for prioritizing remediation, yet manually assessing Common Vulnerability Scoring System (CVSS) base metrics remains labor-intensive. Existing automated approaches often fail to capture the repository-level evidence required for assessing many CVSS base metrics. Such repository-aware assessment is challenging because relevant evidence is scattered across the entire repository under heavy noise. To address these challenges, we present CoSA, a Context-aware vulnerability Severity Assessment approach that infers CVSS base metrics from repository artifacts. CoSA constructs a code property graph (CPG) and applies a two-stage repository-pruning strategy: lightweight static pruning to preserve structurally proximal context, followed by an agentic large language model (LLM)-guided pruning step to retain CVSS-relevant context while collecting supporting evidence. The LLM then consolidates the retrieved repository context into compact, CVSS metric-wise textual summaries, which are fed into a lightweight transformer predictor. We also construct a higher-quality repository-level dataset comprising 6,816 CVSS labeled instances spanning 90 Common Weakness Enumeration (CWE) types. Experiments on real-world vulnerabilities show that CoSA consistently outperforms function-level and pure-LLM baselines. It improves prediction accuracy by 14.4% and Macro-F1 by 15.3% over the best-performing baseline, suggesting that explicit, metric-oriented repository context retrieval is crucial for practical and reliable automated severity assessment.
📚 参考文献 (56 条)
查看全部 56 条
- [1] Guru Bhandari, Amara Naseer, and Leon Moonen. 2021. CVEfixes: Automated Collection 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 (PROMISE ’21). ACM. https://doi.org/10.1145/3475960.3475985
- [2] Dan Busbridge, Dane Sherburn, Pietro Cavallo, and Nils Y Hammerla. 2019. Relational graph attention networks. arXiv preprint arXiv:1904.05811 (2019).
- [3] Cybersecurity and Infrastructure Security Agency (CISA). [n. d.]. Stakeholder-Specific Vulnerability Categorization (SSVC). https://www.cisa.gov/ stakeholder-specific-vulnerability-categorization-ssvc. Web page.
- [4] Yangruibo Ding, Yanjun Fu, Omniyyah Ibrahim, Chawin Sitawarin, Xinyun Chen, Basel Alomair, David Wagner, Baishakhi Ray, and Yizheng Chen. 2024. Vulnerability detection with code language models: How far are we? arXiv preprint arXiv:2403.18624 (2024).
- [5] Yukun Dong, Yeer Tang, Xiaotong Cheng, and Yufei Yang. 2023. DeKeDVer: A deep learning-based multi-type software vulnerability classification framework using vulnerability description and source code. Inf. Softw. Technol. 163, C (Nov. 2023), 14 pages. https://doi.org/10.1016/j.infsof.2023. 107290
- [6] Xiaozhi Du, Shiming Zhang, Yanrong Zhou, and Hongyuan Du. 2024. A Vulnerability Severity Prediction Method Based on Bimodal Data and Multi-task Learning. Journal of Systems and Software 213 (2024), 112039. https://doi.org/10.1016/j.jss.2024.112039
- [7] Clément Elbaz, Louis Rilling, and Christine Morin. 2020. Fighting N-day Vulnerabilities with Automated CVSS Vector Prediction at Disclosure. In Proceedings of the 15th International Conference on Availability, Reliability and Security (ARES). ACM. https://doi.org/10.1145/3407023.3407038
- [8] Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, and Ming Zhou. 2020. CodeBERT: A Pre-Trained Model for Programming and Natural Languages. In Findings of the Association for Computational Linguistics: EMNLP 2020, Trevor Cohn, Yulan He, and Yang Liu (Eds.). Association for Computational Linguistics, Online, 1536–1547. https://doi.org/10.18653/v1/2020.findings- emnlp.139
- [9] FIRST.Org, Inc. 2007. A Complete Guide to the Common Vulnerability Scoring System Version 2.0. https://www.first.org/cvss/v2/cvss-v2-guide.pdf.
- [10] FIRST.Org, Inc. 2015. CVSS V3.0 Specification. https://www.first.org/cvss/v3-0/cvss-v30-specification_v1.9.pdf.
- [11] FIRST.Org, Inc. 2019. Common Vulnerability Scoring System Version 3.1: Specification Document (Revision 1). https://www.first.org/cvss/v3-1/cvss- v31-specification_r1.pdf.
- [12] FIRST.Org, Inc. 2024. CVSS v4.0 Specification - 2024-06-18. https://www.first.org/cvss/v4-0/cvss-v40-specification.pdf.
- [13] Jerry Gamblin. 2026. 2025 CVE Data Review. Blog post. https://jerrygamblin.com/2026/01/01/2025-cve-data-review/ Reports 48,185 published CVEs in 2025 and 39,962 in 2024; statistics exclude rejected CVEs..
- [14] Chaoyang Gao, Xiang Chen, and Guangbei Zhang. [n. d.]. SVA-ICL: Improving LLM-based Software Vulnerability Assessment via In-Context Learning and Information Fusion. https://doi.org/10.48550/arXiv.2505.10008 arXiv:2505.10008 [cs]
- [15] Daya Guo, Shuai Lu, Nan Duan, Yanlin Wang, Ming Zhou, and Jian Yin. 2022. UniXcoder: Unified Cross-Modal Pre-training for Code Representation. (March 2022). https://doi.org/10.48550/arXiv.2203.03850 arXiv:2203.03850 [cs.CL] Published in ACL 2022 (per arXiv record).
- [16] Daya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng, Duyu Tang, Shujie Liu, Long Zhou, Nan Duan, Alexey Svyatkovskiy, Shengyu Fu, et al. 2020. Graphcodebert: Pre-training code representations with data flow. arXiv preprint arXiv:2009.08366 (2020).
- [17] Zhuobing Han, Xiaohong Li, Zhenchang Xing, Hongtao Liu, and Zhiyong Feng. 2017. Learning to Predict Severity of Software Vulnerability Using Only Vulnerability Description . In 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE Computer Society, Los Alamitos, CA, USA, 125–136. https://doi.org/10.1109/ICSME.2017.52
- [18] Jiangnan Huang and Bin Lin. 2025. Revisiting Security Practices for Github Actions Workflows . In 2025 IEEE/ACM 33rd International Conference on Program Comprehension (ICPC). IEEE Computer Society, Los Alamitos, CA, USA, 73–77. https://doi.org/10.1109/ICPC66645.2025.00016
- [19] Jay Jacobs, Sasha Romanosky, Benjamin Edwards, Michael Roytman, and Idris Adjerid. 2019. Exploit Prediction Scoring System (EPSS). arXiv preprint arXiv:1908.04856 (2019). https://arxiv.org/abs/1908.04856
- [20] Atefeh Khazaei, Mohammad Ghasemzadeh, and Vali Derhami. 2016. An Automatic Method for CVSS Score Prediction Using Vulnerabilities Description. Journal of Intelligent & Fuzzy Systems 30, 1 (2016), 89–96. https://doi.org/10.3233/IFS-151733
- [21] Patrick Kwaku Kudjo, Jinfu Chen, Minmin Zhou, Solomon Mensah, and Rubing Huang. 2019. Improving the Accuracy of Vulnerability Report Classification Using Term Frequency-Inverse Gravity Moment. In 2019 IEEE 19th International Conference on Software Quality, Reliability and Security (QRS). 248–259. https://doi.org/10.1109/QRS.2019.00041
- [22] Philipp Kühn, David N. Relke, and Christian Reuter. 2023. Common Vulnerability Scoring System Prediction Based on Open Source Intelligence Information Sources. Computers & Security 131 (2023), 103402. https://doi.org/10.1016/j.cose.2023.103402
- [23] Siwei Lai, Liheng Xu, Kang Liu, and Jun Zhao. 2015. Recurrent convolutional neural networks for text classification. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence (Austin, Texas) (AAAI’15). AAAI Press, 2267–2273.
- [24] Triet Huynh Minh Le and M. Ali Babar. 2022. On the use of fine-grained vulnerable code statements for software vulnerability assessment models. In Proceedings of the 19th International Conference on Mining Software Repositories (Pittsburgh, Pennsylvania) (MSR ’22). Association for Computing Machinery, New York, NY, USA, 621–633. https://doi.org/10.1145/3524842.3528433
- [25] Triet Huynh Minh Le, David Hin, Roland Croft, and M. Ali Babar. 2022. DeepCVA: automated commit-level vulnerability assessment with deep multi-task learning. , 13 pages. https://doi.org/10.1109/ASE51524.2021.9678622 Manuscript submitted to ACM
- [26] Yikun Li, Ngoc Tan Bui, Ting Zhang, Martin Weyssow, Chengran Yang, Xin Zhou, Jinfeng Jiang, Junkai Chen, Huihui Huang, Huu Hung Nguyen, et al. 2025. Out of Distribution, Out of Luck: How Well Can LLMs Trained on Vulnerability Datasets Detect Top 25 CWE Weaknesses? arXiv preprint arXiv:2507.21817 (2025).
- [27] Yi Li, Aashish Yadavally, Jiaxing Zhang, Shaohua Wang, and Tien N. Nguyen. 2023. Commit-Level, Neural Vulnerability Detection and Assessment. In Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (San Francisco, CA, USA) (ESEC/FSE 2023). Association for Computing Machinery, New York, NY, USA, 1024–1036. https://doi.org/10.1145/3611643.3616346
- [28] Yikun Li, Ting Zhang, Jiakun Liu, Jinfeng Jiang, Yuheng Yieh, Yixin Yang, Wen Bin Leow, Yide Yin, Yintong Huo, Eng Lieh Ouh, et al. 2026. Graph Is the Verifier: Agentic Reinforcement Learning for Interprocedural Vulnerability Detection. arXiv preprint arXiv:2607.26656 (2026).
- [29] Yikun Li, Ting Zhang, Jieke Shi, Chengran Yang, Junda He, Xin Zhou, Jinfeng Jiang, Huihui Huang, Wen Bin Leow, Yide Yin, et al. 2026. Beyond Function-Level Analysis: Context-Aware Reasoning for Inter-Procedural Vulnerability Detection. arXiv preprint arXiv:2602.06751 (2026).
- [30] Yikun Li, Ting Zhang, Ratnadira Widyasari, Yan Naing Tun, Huu Hung Nguyen, Tan Bui, Ivana Clairine Irsan, Yiran Cheng, Xiang Lan, Han Wei Ang, et al. 2024. Cleanvul: Automatic function-level vulnerability detection in code commits using llm heuristics. arXiv preprint arXiv:2411.17274 (2024).
- [31] Chengwei Liu, Sen Chen, Lingling Fan, Bihuan Chen, Yang Liu, and Xin Peng. 2022. Demystifying the Vulnerability Propagation and Its Evolution via Dependency Trees in the NPM Ecosystem. In Proceedings of the 44th International Conference on Software Engineering (ICSE). https://doi.org/10. 1145/3510003.3510142
- [32] Ilya Loshchilov and Frank Hutter. 2019. Decoupled Weight Decay Regularization. In International Conference on Learning Representations (ICLR). https://openreview.net/forum?id=Bkg6RiCqY7
- [33] A. Manjunatha, R. Nithin, S. Kuruva, and A. Prabhu. 2024. CVE Severity Prediction From Vulnerability Description. Procedia Computer Science 232 (2024), 1606–1613. https://doi.org/10.1016/j.procs.2024.04.294
- [34] Francesco Marchiori, Denis Donadel, and Mauro Conti. [n. d.]. Can LLMs Classify CVEs? Investigating LLMs Capabilities in Computing CVSS Vectors. https://doi.org/10.48550/arXiv.2504.10713 arXiv:2504.10713 [cs]
- [35] Peter Mell, Karen Scarfone, and Sasha Romanosky. 2006. Common Vulnerability Scoring System. IEEE Security and Privacy 4, 6 (Nov. 2006), 85–89. https://doi.org/10.1109/MSP.2006.145
- [36] MITRE Corporation. [n. d.]. Common Weakness Scoring System (CWSS). https://cwe.mitre.org/cwss/. Web page.
- [37] Shunta Nakagawa, Tatsuya Nagai, Hideaki Kanehara, Keisuke Furumoto, Makoto Takita, Yoshiaki Shiraishi, Takeshi Takahashi, Masami Mohri, Yasuhiro Takano, and Masakatu Morii. 2019. Character-Level Convolutional Neural Network for Predicting Severity of Software Vulnerability from Vulnerability Description. IEICE Transactions on Information and Systems E102.D, 9 (2019), 1679–1682. https://www.jstage.jst.go.jp/article/transinf/ E102.D/9/E102.D_2018OFL0006/_article
- [38] National Institute of Standards and Technology (NIST). 2025. National Vulnerability Database (NVD) – March 19, 2025: NVD General Update. https://www.nist.gov/itl/nvd States CVE submissions increased 32% in 2024; backlog still growing; exploring machine learning to automate processing tasks..
- [39] National Institute of Standards and Technology (NIST). 2026. NVD - Vulnerability Metrics (CVSS). https://nvd.nist.gov/vuln-metrics/cvss. Accessed: 2026-01-09.
- [40] National Vulnerability Database (NVD). 2022. Retirement of CVSS v2. https://nvd.nist.gov/General/News/retire-cvss-v2 Accessed: 2026-01-22.
- [41] Anh The Nguyen, Triet Huynh Minh Le, and M. Ali Babar. 2024. Automated Code-centric Software Vulnerability Assessment: How Far Are We? An Empirical Study in C/C++. In Proceedings of the 18th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (Barcelona, Spain) (ESEM ’24). Association for Computing Machinery, New York, NY, USA, 72–83. https://doi.org/10.1145/3674805.3686670
- [42] Maciej Nowak, Michał Walkowski, and Sławomir Sujecki. [n. d.]. Machine Learning Algorithms for Conversion of CVSS Base Score from 2.0 to 3.x. In Computational Science – ICCS 2021, Maciej Paszynski, Dieter Kranzlmüller, Valeria V. Krzhizhanovskaya, Jack J. Dongarra, and Peter M.A. Sloot (Eds.). Vol. 12744. Springer International Publishing, 255–269. https://doi.org/10.1007/978-3-030-77967-2_21 Series Title: Lecture Notes in Computer Science.
- [43] Ahmet Okutan and Mehdi Mirakhorli. 2022. Predicting the Severity and Exploitability of Vulnerability Reports Using Convolutional Neural Nets. In Proceedings of the IEEE/ACM 3rd International Workshop on Engineering and Cybersecurity of Critical Systems (EnCyCriS) at ICSE 2022. ACM. https://doi.org/10.1145/3524489.3527298
- [44] OpenSSF. 2026. Open Source Vulnerability (OSV) Schema. https://ossf.github.io/osv-schema/. Accessed: 2026-01-09.
- [45] OWASP Foundation. [n. d.]. OWASP Risk Rating Methodology. https://owasp.org/www-community/OWASP_Risk_Rating_Methodology. Web page.
- [46] Shengyi Pan, Lingfeng Bao, Jiayuan Zhou, Xing Hu, Xin Xia, and Shanping Li. [n. d.]. Towards More Practical Automation of Vulnerability Assessment. In Proceedings of the IEEE/ACM 46th International Conference on Software Engineering (Lisbon Portugal, 2024-04-12). ACM, 1–13. https://doi.org/10.1145/3597503.3639110
- [47] Sefa Eren Sahin and Ayse Tosun. 2019. A conceptual replication on predicting the severity of software vulnerabilities. In Proceedings of the 23rd International Conference on Evaluation and Assessment in Software Engineering. 244–250.
- [48] Mustafizur R. Shahid and Hervé Debar. 2021. CVSS-BERT: Explainable Natural Language Processing to Determine the Severity of a Computer Security Vulnerability from its Description. In 2021 20th IEEE International Conference on Machine Learning and Applications (ICMLA). 1600–1607. https://doi.org/10.1109/ICMLA52953.2021.00256 Manuscript submitted to ACM
- CoSA : Context-Aware Severity Assessment via Context Analysis with Large Language Models 23
- [49] Hao Shen, Ming Hu, Xiaofei Xie, Jiaye Li, and Mingsong Chen. 2025. VulStamp: Vulnerability Assessment using Large Language Model. arXiv preprint arXiv:2506.11484 (2025).
- [50] Yijun Shen, Xiang Gao, Hailong Sun, and Yu Guo. 2025. Understanding vulnerabilities in software supply chains. Empirical Software Engineering 30, 20 (2025). https://doi.org/10.1007/s10664-024-10581-2
- [51] Fan Shi, Shaofeng Kai, Jinghua Zheng, and Yao Zhong. 2022. XLNet-Based Prediction Model for CVSS Metric Values. Applied Sciences 12, 18 (2022). https://doi.org/10.3390/app12188983
- [52] Xiaobing Sun, Zhenlei Ye, Lili Bo, Xiaoxue Wu, Ying Wei, Tao Zhang, and Bin Li. [n. d.]. Automatic software vulnerability assessment by extracting vulnerability elements. 204 ([n. d.]), 111790. https://doi.org/10.1016/j.jss.2023.111790
- [53] Xin-Cheng Wen, Jiaxin Ye, Cuiyun Gao, Lianwei Wu, and Qing Liao. [n. d.]. EvalSVA: Multi-Agent Evaluators for Next-Gen Software Vulnerability Assessment. https://doi.org/10.48550/arXiv.2501.14737 arXiv:2501.14737 [cs]
- [54] Jiacheng Xue, Xiang Chen, Jiyu Wang, and Zhanqi Cui. [n. d.]. Towards prompt tuning-based software vulnerability assessment with continual learning. 150 ([n. d.]), 104184. https://doi.org/10.1016/j.cose.2024.104184
- [55] Zhenlei Ye, Xiaobing Sun, Lili Bo, Sicong Cao, Xiaoxue Ren, Lianyong Qi, and Jiale Zhang. 2025. KG4VA: Constructing Vulnerability Knowledge Graph for Software Vulnerability Assessment . IEEE Transactions on Services Computing 18, 06 (Nov. 2025), 3932–3945. https://doi.org/10.1109/TSC. 2025.3607682 Manuscript submitted to ACM