Researchers from the University of Missouri-Kansas City's ASSET Research Group have demonstrated a novel attack method that exploits AI code reviewers by embedding malicious instructions within PNG images. This technique allows attackers to bypass both human and AI scrutiny, effectively exfiltrating sensitive data from repositories. The attack method, detailed in a proof-of-concept on GitHub, exploits a significant oversight in current code review processes. By embedding prompt-injection payloads in image files, the attack avoids detection as images are typically not reviewed by default settings in tools like CodeRabbit and Bugbot.
The attack's success hinges on the fact that many AI systems do not process image files during code reviews. Instead, these systems read text-based files which can reference images. In this case, a file named AGENTS.md directs the AI to a PNG file that contains instructions to read a repository's .env file byte by byte, encode it, and insert the data as a module constant. The attack remains dormant until a routine task triggers the AI to execute these instructions, resulting in the theft of sensitive information.
This research highlights the vulnerabilities present in AI-driven code review systems, which often overlook non-text elements of a pull request. The researchers have devised a multimodal pull-request defender that incorporates image analysis and has demonstrated effectiveness in identifying such attacks. This underscores the need for comprehensive defenses that consider both the textual and visual elements of code submissions.

