
当您通过我们网站上的链接购买时,我们可能会获得联盟佣金。具体运作方式如下。
AI 生成代码的安全性在一年来首次提升,漏洞率从 44% 降至 38%
顶级模型在预防 XSS 等常见缺陷方面表现更好,但在复杂安全推理上仍表现挣扎
研究人员强调,AI 生成代码在部署前仍需要独立的安全测试与验证
由前沿 AI 模型生成的计算机代码变得更安全了,因此——包含的漏洞也更少。
这是 Veracode 最新报告的结论。报告称,这是一年来首次出现显著改善。
2025 年 7 月,Veracode 开始发布其《GenAI Code Security Report》,该报告分析了由 LLM 生成的代码中的漏洞与安全风险。此后,该公司研究人员注意到一个趋势——这些代码的功能几乎完美,但在安全层面却远不能令人满意。
XSS 缺陷值得花这么大功夫吗?
“我们已经对多个 LLM 生成的代码进行了超过一年的分析。直到现在,尽管功能始终接近完美,我们也没有看到 AI 代码安全性的明显改善,”Veracode 联合创始人兼首席安全布道官 Chris Wysopal 表示。
“自我们开展研究以来,这是我们第一次能够报告安全指标上出现了有意义的变化。”
为什么 AI 编程正在扩大软件安全差距
意料之外——AI 生成的安全补丁并不足以真正解决它们本应修复的全部问题
AI 正在改变安全测试,但并非所有漏洞都同等重要
这一有意义的变化,是总体 AI 生成代码安全性从 56% 提升到 62%。与此同时,漏洞率从 44% 降至 38%。Veracode 补充称,这是自报告发布以来最显著的改善。Anthropic 的 Claude Opus 5.5 与 OpenAI 的 GPT-6-Sol 以 73% 并列榜首,超过此前由 GPT-5.5 在 2026 年 7 月创下的 68%。
“现在有十个模型突破 60%,高于上一份报告中的四个;总体平均值也上升了六个百分点,”Wysopal 说。“如今约一半代码由 AI 生成,今天的结果确实令人鼓舞。”
为撰写该报告,Veracode 测试了 18 个模型,覆盖四种语言(Python、C#、JavaScript 和 Java)以及四个常见弱点枚举(CWE)类别(CWE-89、CWE-327、CWE-80、CWE-117)。Claude Opus 5.5 与 GPT-6-Sol 以 73% 位居第一,其次是 68% 的 GPT-5.5。7 月时,11 个模型中有 6 个得分在 50 到 53 之间;如今只剩 2 个在该区间,同时有 10 个模型得分至少达到 60%。最低分仍在 44%—50%。
尽管结果当然值得称赞,但也有一个注意事项。显然,整体提升的主要驱动力来自跨站脚本(XSS),而 XSS 可以说属于最弱的类别之一。XSS 提升到 18%,这也是数据集中单一最大变化。Veracode 指出,XSS 是“通过模式识别最容易修复的漏洞”,而这正是 LLM 提升的方式。但在需要跨多个函数进行数据流推理的场景中(例如日志注入),LLM 仍然卡住。
换句话说,AI 只是摘了低垂的果子,然后就收工了。我们不确定是否该对此感到失望,因为 XSS 攻击很常见,而且这种漏洞仍然存在于整个网络中。
Claude 标记了近 500 个令人担忧的开源安全问题——C、Java 和 Python 代码都面临风险,其中一个缺陷竟然 21 年都没被发现
机器中的幽灵:AI 恶意软件表明,是时候将零信任扩展到代码层面了
AI 编程正让软件风险“加速升级”
报告还写了像“水是湿的、天基本是蓝的”这类显而易见的结论:表现最好的模型成本更高。
不过,他们也表示,砸钱并不一定是最佳解法:“能生成最安全代码的模型,在规模化运行时成本最高,但它们在超过四分之一的安全任务上仍然会失败,”Wysopal 说。“答案绝不该是‘用最贵的模型,然后祈祷好运’。一个通过率为 60% 的中端模型,加上 Veracode 扫描,会比一个 73% 但没有验证的前沿模型更准确、更具成本效益、也更可扩展。”
总之,改善确实存在,但“只是修补了更大伤口的一部分”,Veracode 说。组织应确保将 AI 代码与持续且独立的安全验证结合使用,以捕捉模型遗漏的问题。
➡️ 阅读我们的完整指南:最佳杀软推荐
1. 综合最佳:Bitdefender Total Security
2. 最适合家庭:Norton 360 with LifeLock
3. 最适合移动端:McAfee Mobile Security
在 Google News 上关注 TechRadar,并将我们添加为优先来源,以便在你的信息流中获取我们的专业新闻、评测与观点。
Sead 是一名常驻波斯尼亚和黑塞哥维那萨拉热窝的资深自由撰稿记者。他撰写 IT(云、IoT、5G、VPN)与网络安全(勒索软件、数据泄露、法律法规)相关内容。在其超过十年的职业生涯中,他曾为多家媒体供稿,包括 Al Jazeera Balkans。他还曾在 Represent Communications 讲授过若干内容写作课程。
你必须在评论前确认你的公开显示名称
请先退出登录,然后重新登录;届时你将被提示输入显示名称。
1 如何观看曼城 vs 布莱顿:2026/27 赛季英超联赛直播与电视频道
2 Sam Altman 表示你在 PC 里使用 RAM 这件事“相当糟糕”
3 本月顶级科技产品:我们测试过的 2026 年 11 月最佳新设备
4 AirPods 5(无线充电版)评测:ANC 都这么强了,为什么还要多花钱买 AirPods Pro 3?
5 “意图压缩悖论”:LLM 开发者如何解决语义侵蚀以保持人类意图
本文来源:https://www.techradar.com/pro/security/ai-generated-code-is-still-frequently-failing-security-checks-with-claude-and-gpt-6-topping-the-leader-board
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。
When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works .
AI-generated code security improved for the first time in a year, with vulnerability rates dropping from 44% to 38%
Top models performed better at preventing common flaws like XSS, but still struggled with complex security reasoning
Researchers stress AI-generated code still requires independent security testing and verification before deployment
Computer code generated by frontier AI models has gotten more secure and consequently - contains fewer vulnerabilities.
This is according to a new report by Veracode, which claims this is the first significant improvement in a year.
In July 2025, Veracode started releasing its GenAI Code Security Report, which analyzed code generated by LLMs for vulnerabilities and security risks. Since then, the company’s researchers noticed a trend - the code was functioning almost perfect, but on the security side it left much to be desired.
“We’ve been analyzing code generated by multiple LLMs for more than a year. Until now, we have not seen a marked improvement in AI code security, despite consistently near-perfect functionality,” said Chris Wysopal, Co-founder & Chief Security Evangelist at Veracode.
“This is the first time since running our study that we’ve been able to report a meaningful move on the security dial.”
Why AI coding is widening the software security gap
Shock horror — AI-generated security patches fall short of actually solving all the problems they were meant to fix
AI is changing security testing, but not all vulnerabilities are created equal
That meaningful move is a jump from 56% to 62% in overall AI-generated code security. At the same time, there’s been a drop in vulnerabilities from 44% to 38%, Veracode added, saying this was the most significant improvement since the reports started coming out. Anthropic's Claude Opus 5.5 and OpenAI's GPT-6-Sol co-lead the rankings at 73%, surpassing the previous high of 68% set by GPT-5.5 in July 2026.
“Ten models now clear 60%, up from four in the last report, and the overall average has jumped six percentage points,” Wysopal said. “With around half of code now generated by AI, today’s results are truly encouraging.”
To draft the report, Veracode tested 18 models across four languages (Python, C#, JavaScript, and Java), and four Common Weakness Enumeration (CWE) categories (CWE-89, CWE-327, CWE-80, CWE-117). Claude Opus 5.5 and GPT-6-Sol claimed the top spot with 73% followed by GPT-5.5 which holds 68%. In July, six of 11 models scored between 50 and 53, while today only two remain in that band, while 10 scored at least 60%. The bottom is still at 44% - 50% percent.
While the results are definitely commendable, there is a caveat. Apparently, the main driver of the overall gain was on cross-site scripting (XSS), which is arguably one of the weakest categories. XSS rose to 18% which is also the single biggest change in the dataset. According to Veracode, XSS is the “easiest vulnerability to fix through pattern recognition”, which is exactly how LLMs improve. In cases where data-flow reasoning across multiple functions is required (such as, in log injection cases, for example), LLMs continue to stall.
In other words, AI has just picked low-hanging fruit and called it a day. We’re not sure if we should be disappointed with this, since XSS attacks are common and the vulnerability is still present across the web.

Claude flags nearly 500 worrying open source security issues — C, Java, and Python code all at risk as one flaw wasn't spotted for 21 years
Ghosts in the machine: AI malware shows why it is time to extend Zero Trust to code
AI coding is putting software risk on steroids
In the report, Veracode also said that water was wet and the sky is mostly blue: it found that top-performing models cost more.
However, they said throwing money at the problem most likely isn’t the best solution: “The models that produce the most secure code are the ones that cost the most to run at scale, yet they still fail on more than one in four security tasks,” Wysopal said. “The answer should never be to use the most expensive model and hope for the best. A mid-tier model at a 60% pass rate plus Veracode scanning is more accurate, more cost-effective, and more scalable than a frontier model at 73% with no verification.”
In conclusion, the improvement is there, but “mends a small part of a larger wound”, Veracode said. Organizations should make sure they combine AI code with continuous and independent security verification that can catch what the models miss.
➡️ Read our full guide to the best antivirus 1. Best overall: Bitdefender Total Security 2. Best for families: Norton 360 with LifeLock 3. Best for mobile: McAfee Mobile Security
Follow TechRadar on Google News and add us as a preferred source to get our expert news, reviews, and opinion in your feeds.
Sead is a seasoned freelance journalist based in Sarajevo, Bosnia and Herzegovina. He writes about IT (cloud, IoT, 5G, VPN) and cybersecurity (ransomware, data breaches, laws and regulations). In his career, spanning more than a decade, he’s written for numerous media outlets, including Al Jazeera Balkans. He’s also held several modules on content writing for Represent Communications.
You must confirm your public display name before commenting
Please logout and then login again, you will then be prompted to enter your display name.
1 How to watch Man City vs Brighton: Live streams & TV channels for Premier League 2026/27
2 Sam Altman says it's 'quite terrible' that you're using RAM in your PC
3 Top tech of the month: the best new gadgets we've tested for November 2026
4 AirPods 5 with Wireless Charging review: with ANC this good, why pay more for AirPods Pro 3?
5 The intent compression paradox: How LLM developers are solving semantic erosion to keep human intent alive