arXiv:2410.11096cs.CRcs.AI2024-10中稿 · NeurIPS

构建首个覆盖44类漏洞的代码生成安全评测平台

SeCodePLT: A Unified Platform for Evaluating the Security of Code GenAI

  • 用人工验证种子+定向变异扩展数据,兼顾质量与规模
  • 涵盖5.9k样本,覆盖44种漏洞类型和3项安全能力
  • 适合研究代码大模型安全性的研究人员使用

现有代码生成大模型的安全性评估基准存在三大局限:风险与能力覆盖不足、依赖静态指标缺乏动态分析精度、数据质量与规模难以兼顾。为此,我们提出一种通用可扩展的基准构建框架,从人工验证的高质量种子样本出发,通过针对性变异扩展数据。该方法生成全面的评估资源,支持基于动态指标的完整风险评估与安全能力测试。结合专家知识与自动化生成,平衡了人工成本、数据质量与规模。应用于Python、C/C++和Java,构建了包含超过5.9k样本、覆盖44个CWE类别和3项安全能力的SeCodePLT数据集。相比现有最优基准,其覆盖更广、数据保真度更高、规模更大。利用SeCodePLT评估主流代码生成大模型与智能体,揭示其在生成安全代码及发现/修复漏洞方面的优劣。

原文摘要 · Abstract (English)

Existing benchmarks for evaluating the security risks and capabilities (e.g., vulnerability detection) of code-generating large language models (LLMs) face several key limitations: (1) limited coverage of risk and capabilities; (2) reliance on static evaluation metrics such as LLM judgments or rule-based detection, which lack the precision of dynamic analysis; and (3) a trade-off between data quality and benchmark scale. To address these challenges, we introduce a general and scalable benchmark construction framework that begins with manually validated, high-quality seed examples and expands them via targeted mutations. Our approach provides a comprehensive suite of artifacts so the benchmark can support comprehensive risk assessment and security capability evaluation using dynamic metrics. By combining expert insights with automated generation, we strike a balance between manual effort, data quality, and benchmark scale. Applying this framework to Python, C/C++, and Java, we build SeCodePLT, a dataset of more than 5.9k samples spanning 44 CWE-based risk categories and three security capabilities. Compared with state-of-the-art benchmarks, SeCodePLT offers broader coverage, higher data fidelity, and substantially greater scale. We use SeCodePLT to evaluate leading code LLMs and agents, revealing their strengths and weaknesses in both generating secure code and identifying or fixing vulnerabilities.

代码安全大模型评测漏洞检测动态分析

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。