arXiv:2512.18456cs.CRcs.AI2025-12被引 1

剖析AI编程工具的三大安全短板,提出从生成到检测的全链路防护路径。

SoK: Understanding (New) Security Issues Across AI4Code Use Cases

  • 分析代码生成、漏洞检测与翻译三类场景的安全缺陷。
  • 发现模型对语义不变攻击仍脆弱,微调常偏离安全目标。
  • 适合关注AI安全的开发者与研究者,推动安全优先的AI4Code设计。

AI for Code(AI4Code)系统正重塑软件工程,如GitHub Copilot加速代码生成、转换与漏洞检测。然而,不安全输出、基准偏倚及对抗性操纵风险持续存在,削弱其可靠性。本文系统综述了三类核心应用场景中的安全问题,揭示共性缺口:基准过度依赖Python和简化任务,缺乏标准化安全数据集,评估中存在数据泄露,且模型对抗鲁棒性薄弱。对六种前沿模型的对比研究表明:代码生成中不安全模式持续存在,漏洞检测易受语义保持攻击影响,微调常导致安全目标错位,代码转换带来的安全收益不均。基于此,提出三条发展路径:在代码生成中嵌入默认安全机制,构建更鲁棒全面的检测基准,利用代码转换推动安全增强型语言演进。呼吁转向以安全为先的AI4Code范式,将漏洞缓解与鲁棒性贯穿开发全流程。

原文摘要 · Abstract (English)

AI-for-Code (AI4Code) systems are reshaping software engineering, with tools like GitHub Copilot accelerating code generation, translation, and vulnerability detection. Alongside these advances, however, security risks remain pervasive: insecure outputs, biased benchmarks, and susceptibility to adversarial manipulation undermine their reliability. This SoK surveys the landscape of AI4Code security across three core applications, identifying recurring gaps: benchmark dominance by Python and toy problems, lack of standardized security datasets, data leakage in evaluation, and fragile adversarial robustness. A comparative study of six state-of-the-art models illustrates these challenges: insecure patterns persist in code generation, vulnerability detection is brittle to semantic-preserving attacks, fine-tuning often misaligns security objectives, and code translation yields uneven security benefits. From this analysis, we distill three forward paths: embedding secure-by-default practices in code generation, building robust and comprehensive detection benchmarks, and leveraging translation as a route to security-enhanced languages. We call for a shift toward security-first AI4Code, where vulnerability mitigation and robustness are embedded throughout the development life cycle.

AI4Code安全评测代码生成对抗攻击

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