arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.18740cs.SEcs.AIcs.CR
收藏

衡量和利用LLM辅助安全代码审查中的确认偏见

When AI Agrees Too Much: Manipulating Automated Code Review via Bias Injection

University of Athens(雅典大学);National Infrastructures for Research(研究与技术国家基础设施);Athens University of Economics and Business(雅典经济与商业大学)

Georgios Alexopoulos, Nikolaos Alexopoulos, Diomidis Spinellis, Dimitris Mitropoulos

AI总结:

研究LLM在安全代码审查中是否存在确认偏见及其对漏洞检测的影响,并通过实验验证偏见在软件供应链攻击中的可利用性。

摘要:

安全代码审查日益依赖集成大型语言模型(LLM)的系统,从交互式助手到CI/CD流水线中的自主代理。我们研究确认偏见(即倾向于支持先前预期的解释倾向)是否影响LLM基于漏洞检测,并探讨这种失败模式在软件供应链攻击中的可利用性。我们进行了两项互补研究。研究1通过受控实验量化确认偏见,对250个CVE漏洞/补丁对在四个最先进的模型下五个审查提示框架条件下进行评估。将变更框架为无bug会降低漏洞检测率16-93%,具有强烈不对称效应:假阴性增加显著而假阳性率变化不大。偏见效应因漏洞类型而异,注入漏洞比内存破坏漏洞更容易受到其影响。研究2评估在实践中可利用性,模拟对抗性拉取请求,通过其拉取请求元数据将已知漏洞重新引入,同时框架为安全改进或紧急功能修复。对抗性框架在GitHub Copilot(交互式助手)单次攻击下成功35%,在Claude Code(自主代理)真实项目配置中成功88%,当对手可以迭代优化框架以提高攻击成功率时。通过元数据擦除和明确指令去偏见恢复了所有交互式案例和94%的自主案例。我们的结果表明,确认偏见是LLM辅助代码审查中的弱点,对AI辅助开发工具的部署有影响。

英文摘要:

Automated Code Review (ACR) systems integrating Large Language Models (LLMs) are increasingly adopted in software development workflows, ranging from interactive assistants to autonomous agents in CI/CD pipelines. In this paper, we study how LLM-based vulnerability detection in ACR is affected by the framing effect: the tendency to let the presentation of information override its semantic content in forming judgments. We examine whether adversaries can exploit this through contextual-bias injection (crafting PR metadata to bias ACR security judgments) as a supply-chain attack vector against real-world ACR pipelines. To this end, we first conduct a large-scale exploratory study across 6 LLMs under five framing conditions, establishing the framing effect as a systematic and widespread phenomenon in LLM-based vulnerability detection. We then design a realistic and controlled experimental environment, evaluating 33 CVEs across 20 real-world projects and two popular ACR pipelines (Claude Code and CodeRabbit), to assess the susceptibility of real-world ACR pipelines to vulnerability re-introduction attacks. We employ two attack strategies: a template-based attack inspired by prior related work, and a novel LLM-assisted refinement attack. We find that template-based attacks are ineffective and may even backfire, as direct biasing attempts raise suspicions. Our refinement attack, on the other hand, is successful in 32/33 (97%) cases, exploiting a fundamental asymmetry: attackers can iteratively refine attacks against a local clone of the review pipeline, while defenders have only one chance to detect them. Overall, our findings highlight the dangers of over-relying on ACR and stress the importance of human oversight and contributor trust in the development process.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑