Security code reviews increasingly rely on systems integrating Large Language Models (LLMs), ranging from interactive assistants to autonomous agents in CI/CD pipelines. We study whether confirmation bias (i.e., the tendency to favor interpretations that align with prior expectations) affects LLM-based vulnerability detection, and whether this failure mode can be exploited in software supply-chain attacks. We conduct two complementary studies. Study 1 quantifies confirmation bias through controlled experiments on 250 CVE vulnerability/patch pairs evaluated across four state-of-the-art models under five framing conditions for the review prompt. Framing a change as bug-free reduces vulnerability detection rates by 16-93%, with strongly asymmetric effects: false negatives increase sharply while false positive rates change little. Bias effects vary by vulnerability type, with injection flaws being more susceptible to them than memory corruption bugs. Study 2 evaluates exploitability in practice mimicking adversarial pull requests that reintroduce known vulnerabilities while framed as security improvements or urgent functionality fixes via their pull request metadata. Adversarial framing succeeds in 35% of cases against GitHub Copilot (interactive assistant) under one-shot attacks and in 88% of cases against Claude Code (autonomous agent) in real project configurations where adversaries can iteratively refine their framing to increase attack success. Debiasing via metadata redaction and explicit instructions restores detection in all interactive cases and 94% of autonomous cases. Our results show that confirmation bias poses a weakness in LLM-based code review, with implications on how AI-assisted development tools are deployed.


翻译:安全代码审查日益依赖集成大语言模型的系统,范围涵盖从交互式助手到CI/CD流水线中的自主代理。我们研究确认偏误(即倾向于偏爱符合先前预期的解释)是否影响基于大语言模型的漏洞检测,以及这种失效模式能否被软件供应链攻击所利用。我们开展了两项互补性研究。研究1通过控制实验量化确认偏误:在四种最新模型下,对250组CVE漏洞/补丁对,设置五种审查提示框架条件进行评测。将变更描述为无缺陷时,漏洞检测率降低16-93%,且呈现强不对称效应:假阴性率急剧上升,而假阳性率变化甚微。偏误效应因漏洞类型而异,注入类漏洞比内存破坏漏洞更易受影响。研究2评估实际场景中的可利用性,模拟恶意拉取请求通过元数据将已知漏洞重新引入,同时将其包装为安全改进或紧急功能修复。单次攻击下,对抗性框架在针对GitHub Copilot(交互式助手)的成功率达35%;而在攻击者可迭代优化框架以提高攻击成功率的实际项目配置中,针对Claude Code(自主代理)的成功率达88%。通过元数据删减和显式指令进行去偏,可恢复所有交互式案例及94%自主案例的检测能力。研究结果表明,确认偏误构成了基于大语言模型代码审查的薄弱环节,对AI辅助开发工具的部署方式具有重要启示。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
大型语言模型中隐性与显性偏见的综合研究
专知会员服务
17+阅读 · 2025年11月25日
大型语言模型系统中提示缺陷的分类学
专知会员服务
8+阅读 · 2025年9月19日
158页!天大等最新《大型语言模型安全:全面综述》
专知会员服务
50+阅读 · 2024年12月24日
大语言模型评估技术研究进展
专知会员服务
49+阅读 · 2024年7月9日
大型语言模型在预测和异常检测中的应用综述
专知会员服务
70+阅读 · 2024年2月19日
【ICLR2024】能检测到LLM产生的错误信息吗?
专知会员服务
25+阅读 · 2024年1月23日
大语言模型安全现状与挑战
专知会员服务
88+阅读 · 2024年1月14日
CVPR 2019:精确目标检测的不确定边界框回归
AI科技评论
13+阅读 · 2019年9月16日
异常检测论文大列表:方法、应用、综述
专知
126+阅读 · 2019年7月15日
你的算法可靠吗? 神经网络不确定性度量
专知
40+阅读 · 2019年4月27日
用模型不确定性理解模型
论智
11+阅读 · 2018年9月5日
【机器视觉】表面缺陷检测:机器视觉检测技术
产业智能官
25+阅读 · 2018年5月30日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
综述 | 3D场景图:开放挑战与未来方向
专知会员服务
1+阅读 · 今天15:00
21世纪的无人机战争
专知会员服务
2+阅读 · 今天14:05
《量子技术的军事任务技术适配与利用》
专知会员服务
2+阅读 · 今天13:51
美国从乌克兰无人机战争中学习经验
专知会员服务
7+阅读 · 6月21日
ICML 2026 | 面向视觉语言模型的语义鲁棒性认证
专知会员服务
5+阅读 · 6月21日
相关VIP内容
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员