New Attack Framework Defeats LLM-Based Vulnerability Detectors With Adversarial Code Comments
Key Takeaways
- ▸Attack success rates exceed 90% on LLM-based vulnerability detectors, with some systems reaching 100% susceptibility
- ▸Adversarial code comments can manipulate LLM reasoning without changing actual program behavior, exposing a novel attack surface
- ▸Prompt-level defenses are ineffective; architectural isolation and comment sanitization are needed for meaningful robustness
Summary
Researchers have unveiled ALIBI, an automated black-box attack framework that can reliably fool LLM-based vulnerability detectors by injecting strategically crafted adversarial comments into source code. The attack exploits a previously underexplored vulnerability in how large language models rely on natural-language context embedded in code, allowing attackers to introduce vulnerabilities that go undetected despite the LLMs' advanced reasoning capabilities.
The research evaluated four representative LLM-based vulnerability detectors, ranging from specialized open-weight reasoning models to frontier multi-agent systems. Results were striking: attack success rates exceeded 90% across 125 real-world null-pointer dereference vulnerabilities, with one system achieving 100% vulnerability. The framework employed an adaptive approach, using detector reasoning and feedback to iteratively refine adversarial comments. Notably, comments that steer detector reasoning or fabricate external tool results proved most effective at evading detection.
The study also examined potential defenses, finding that prompt-level mitigations provided limited robustness against adaptive attacks. However, architectural isolation of detectors and pre-detection comment sanitization substantially improved resilience. The research exposes a fundamental gap in current LLM-based code security tools and underscores the need for more thoughtful system design that doesn't blindly trust natural-language context when analyzing program behavior.
- The ALIBI framework generalizes beyond null-pointer dereference vulnerabilities, suggesting widespread applicability to other vulnerability classes
Editorial Opinion
This research reveals a sobering reality for organizations deploying LLMs for code security: current systems can be systematically fooled by adversarially crafted comments, undermining their core purpose. The high attack success rates suggest that using LLMs as primary or sole vulnerability detectors may create a false sense of security. While the study identifies promising defenses like comment sanitization, it also highlights how difficult it is to make LLMs resistant to adaptive attacks. The security community should treat LLM-based code reviewers as confidence enhancers rather than authoritative detectors.


