基于上下文学习预测漏洞严重性:一项工业级案例研究
文章背景与核心概要
现代软件开发亟需具备可扩展性且更早介入的漏洞严重性评估方法,以降低高影响力安全风险。传统上,安全分析师主要通过人工方式分配通用漏洞评分系统(CVSS)分数,但这种做法难以跟上已披露漏洞呈指数级增长的步伐。此外,依赖基于云的大语言模型(LLM)服务会引发显著的数据机密性隐患。
本文介绍了一项工业级案例研究,评估了直接从易受攻击的 C/C++ 代码片段中预测 CVSS v3.1 分数的方法。通过结合上下文学习与可本地部署的开源大语言模型,研究表明,中等规模的代码模型(特别是 CodeLlama2-7B)在配合轻量级、限制输出的提示词时,能够达到接近云端大规模模型的性能。这为企业提供了一种实用且具备隐私保护能力的自动化严重性分类解决方案。
文档元数据 (Document Metadata)
- arXiv ID:
arXiv:2608.22089[cs.CR] - 学科领域: 密码学与安全 (
cs.CR)、人工智能 (cs.AI) - 发布日期: 2026年8月22日提交
- 期刊参考: Software: Evolution and Process (2026年6月2日)
- DOI: 10.48550/arXiv.2608.22089 | 相关 DOI
- 许可协议: 知识共享署名-相同方式共享 4.0 国际版 (CC BY-SA 4.0)

Document Metadata
- arXiv ID:
arXiv:2608.22089[cs.CR]- Subject Areas: Cryptography and Security (
cs.CR), Artificial Intelligence (cs.AI)- Publication Date: Submitted on August 22, 2026
- Journal Reference: Software: Evolution and Process (June 2, 2026)
- DOI: 10.48550/arXiv.2608.22089 | Related DOI
- License: Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
作者 (Authors)
- Daniel Rodriguez-Cardenas
- David Nader Palacio
- Anna Schmedding
- Yiyang Lu
- Aadil Mallick
- Bill Hudson
- Chris Gourley
- Michael Roytman
- Chris Shenefiel
- Evgenia Smirni
- Denys Poshyvanyk
Authors
- Daniel Rodriguez-Cardenas
- David Nader Palacio
- Anna Schmedding
- Yiyang Lu
- Aadil Mallick
- Bill Hudson
- Chris Gourley
- Michael Roytman
- Chris Shenefiel
- Evgenia Smirni
- Denys Poshyvanyk
摘要 (Abstract)
现代软件系统需要更早、更具可扩展性的漏洞严重性评估,以减少对高影响力安全漏洞的暴露。安全分析师通常会分配 CVSS 分数,但这种手动分类无法随着已披露漏洞的增长而扩展,并且往往依赖于引发机密性担忧的云端 LLM 服务。
本文介绍了一项工业级案例研究,内容关于使用带有可本地部署的开源 LLM 的上下文学习,直接从易受攻击的 C/C++ 片段中预测 CVSS v3.1 分数。我们将专有数据与 Big-Vul 数据集进行比较,显示出足够吻合的 CVSS 分布,从而证明在构建基于提示词的测试平台时,Big-Vul 可以作为工业数据的代理。然后,我们调整上下文配置和模型参数,使用均方误差(MSE)和可行性指标评估了 CodeLlama2-7B、CodeLlama2-13B、Mistral-7B、gpt-oss 和 GPT-4o-mini。
我们的结果表明,中等规模的开源代码模型(尤其是 CodeLlama2-7B)在轻量级、输出约束提示词的指导下,可以接近 CVSS 回归的最佳云端性能,为工业环境中的严重性分类提供了一个实用且保护隐私的构建模块。
Abstract
Modern software systems require earlier and more scalable vulnerability severity assessment to reduce exposure to high-impact security flaws. Security analysts typically assign CVSS scores, but this manual triage does not scale with the growth of disclosed vulnerabilities and often depends on cloud LLM services that raise confidentiality concerns.
This paper presents an industrial case study on predicting CVSS v3.1 scores directly from vulnerable C/C++ snippets using in-context learning with locally deployable, open-source LLMs. We compare proprietary data with the Big-Vul dataset, showing sufficiently aligned CVSS distributions to justify Big-Vul as a proxy for industrial data when constructing prompt-based testbeds. We then vary in-context configurations and model parameters, evaluating CodeLlama2-7B, CodeLlama2-13B, Mistral-7B, gpt-oss, and GPT-4o-mini using mean squared error (MSE) and feasibility metrics.
Our results show that medium-sized open-source code models, particularly CodeLlama2-7B, can approximate the best cloud performance for CVSS regression when guided by lightweight, output-constraining prompts, offering a practical, privacy-preserving building block for severity triage in industrial settings.
核心发现与方法论 (Key Findings & Methodology)
- 数据集对齐 (Dataset Alignment): 专有工业数据与公共 Big-Vul 数据集之间的对比表明,两者的 CVSS 分布高度一致,从而验证了 Big-Vul 在基于提示词的测试平台构建中作为工业数据可靠代理的有效性。
- 模型评估 (Model Evaluation): 本研究对不同参数规模和架构的多个模型进行了基准测试:
- 开源模型:
CodeLlama2-7B、CodeLlama2-13B、Mistral-7B以及gpt-oss - 专有/云端模型:
GPT-4o-mini - 性能指标 (Performance Metrics): 采用均方误差(MSE)和输出可行性指标进行评估。
- 本地可行性 (Local Feasibility): 中等规模的开源模型(特别是 CodeLlama2-7B)与轻量级、限制输出的提示词相结合,在保持完全数据隐私的同时,实现了可媲美资源密集型云端模型的准确性。
Key Findings & Methodology
- Dataset Alignment: A comparison between proprietary industrial data and the public Big-Vul dataset revealed sufficiently aligned CVSS distributions, validating Big-Vul as a robust proxy for industrial data in prompt-based testbed construction.
- Model Evaluation: The study benchmarked multiple models across varying parameter sizes and architectures:
- Open-source models:
CodeLlama2-7B,CodeLlama2-13B,Mistral-7B, andgpt-oss- Proprietary/Cloud models:
GPT-4o-mini- Performance Metrics: Evaluated using Mean Squared Error (MSE) and output feasibility metrics.
- Local Feasibility: Medium-sized open-source models (notably CodeLlama2-7B) paired with lightweight, output-constraining prompts achieved accuracy comparable to resource-heavy cloud models while maintaining total data privacy.
全文与资源 (Full-Text & Resources)
外部参考与学术工具
Full-Text & Resources
External References & Academic Tools