Automated code review misses many security risks in pull requests

VeilPRBench: Can Code Review Agents Catch Vulnerabilities in Pull Requests That Resolve Real Issues?

Software EngineeringArtificial Intelligence

Summary

Code review helps keep software safe by checking new changes for errors. The authors found that current automated tools often miss dangerous mistakes in changes that are supposed to fix problems. They created a new test called VeilPRBench with real examples of fixes that hide vulnerabilities. When they tested 16 popular review tools, most only caught about a quarter of risky changes. This shows there's much room to improve tools that automatically check code for security.

What this means in practice

  • For software development teams: Evaluate and improve the security accuracy of automated code review tools using a real-world benchmark of pull requests with hidden vulnerabilities.
  • For devops security engineers: Assess current CI/CD code review workflows to identify gaps in blocking malicious or faulty code that falsely appears as a fix.
  • For software testing tool vendors: Enhance automated review solutions by incorporating benchmark data that measures detection of subtle security issues in pull requests.$Commercial implications: Enables development of more effective automated security review products for software companies concerned with safe code integration.

Authors

Xinhao Song, Xiaofei Yin, Yuxuan Xiao, Ji He, Lijun Li, Yan Teng, Gongshen Liu, Huijia Zhu, Jie Li

Abstract

Code review is a critical line of defense for software security. As the volume of pull requests (PRs) grows, automated review agents increasingly support review and merge decisions. However, a PR can genuinely resolve its reported issue while introducing logic vulnerabilities. To quantify this risk in automated code review, we introduce VeilPRBench, a benchmark for evaluating whether code review agents block such PRs while accepting benign repairs. The benchmark contains 192 manually constructed attack PRs across 14 open-source projects and 29 historical issue families, together with 135 benign repairs covering 13 projects and 27 families, across Python, C, and JavaScript. Independent functional tests verify the intended repairs, and executable security checks establish the target consequences of the attacks against applicable reference states. Benign repairs pass the prescribed functional and security checks within their validation scope. Our evaluation of 16 deployed review workflows reveals a substantial security gap, attack blocking averages only 25.0%, and the highest blocking rate is 55.2%. VeilPRBench provides an executable testbed for evaluating and improving the security of automated code review.