AI编程助手可能暗藏安全漏洞,研究首次系统揭示其风险
When Developer Aid Becomes Security Debt: A Systematic Analysis of Insecure Behaviors in LLM Coding Agents
- 分析5个主流大模型在93个真实任务中的1.2万+操作行为
- 21%的代码生成路径包含不安全操作,信息泄露最常见
- GPT-4.1通过提示优化实现96.8%漏洞修复率,效果最佳
基于大语言模型的编程代理正快速应用于软件开发,但其安全影响仍不明确。这些代理虽能加速开发,但在正常运行中可能产生安全隐患,导致网络安全漏洞。我们对自主编程代理进行了首次系统性安全评估,分析了5个前沿模型(GPT-4o、GPT-4.1、Claude系列)在93个真实软件配置任务中超过12,000次操作行为。结果显示,21%的代理轨迹包含不安全操作,各模型间差异显著。我们构建了高精度检测系统,识别出四类主要漏洞,其中信息暴露(CWE-200)最为普遍。同时评估了反馈机制与安全提醒等缓解策略,发现效果因模型而异;GPT-4.1表现突出,安全意识强,漏洞缓解成功率高达96.8%。
原文摘要 · Abstract (English)
LLM-based coding agents are rapidly being deployed in software development, yet their safety implications remain poorly understood. These agents, while capable of accelerating software development, may exhibit unsafe behaviors during normal operation that manifest as cybersecurity vulnerabilities. We conducted the first systematic safety evaluation of autonomous coding agents, analyzing over 12,000 actions across five state-of-the-art models (GPT-4o, GPT-4.1, Claude variants) on 93 real-world software setup tasks. Our findings reveal significant security concerns: 21% of agent trajectories contained insecure actions, with models showing substantial variation in unsafe behavior. We developed a high-precision detection system that identified four major vulnerability categories, with information exposure (CWE-200) being the most prevalent one. We also evaluated mitigation strategies including feedback mechanisms and security reminders with various effectiveness between models. GPT-4.1 demonstrated exceptional security awareness with 96.8% mitigation success.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。