Now You See It, Now You Don't: Manipulating Perception and Attention in Code Vulnerability Detection LLM Agents
Shanquan Yang, Boyu Kuang, Chunyi Zhou, Yifeng Zheng, Yansong Gao, Anmin Fu
Abstract
Emerging code vulnerability detection agents (VDAs) enhance conventional LLM-based vulnerability detectors (LLM-VDs) by using tools to acquire program structure, non-local context, or vulnerability knowledge, enabling reasoning beyond initial prompts. However, whether this perception augmentation provides adversarial robustness remains unknown. Our pilot evaluation reveals that tool augmentation reduces the average evasion rate of existing attacks from 61.19% against LLM-VDs to 25.43% against LLM-VDAs. This poses a new challenge: effective attacks must manipulate both the underlying LLM and the agent's code-dependent acquisition and integration of supplementary information. We uncover a coupled attack surface spanning VDA perception and LLM attention. Attacker-controlled semantic anchors influence what supplementary information a VDA acquires and associates with vulnerable code, while dispersed vulnerability cues and plausible safety semantics redirect the LLM toward an incorrect hypothesis. Based on this insight, we present PAMA (Perception and Attention Manipulation Attack), a black-box attack framework that jointly targets both layers. PAMA composes four strategies that manipulate lexical anchors, vulnerability-related logic, non-executable context, and defensive semantics. It systematically explores their combinations, infers the victim's perception mode, and selects a mode-matched combination while validating syntax, perturbation magnitude, and vulnerability preservation. PAMA achieves a 60.98% average evasion rate across diverse LLM-VDAs, outperforming the strongest baseline by 25.23%. It generalizes across four underlying LLMs and generates adversarial samples that are hardest for human evaluators to detect. Furthermore, PAMA is highly cost-efficient, requiring only 17,706.36 tokens per attack (2.7 to 5.8 less than baselines).
Create a lesson
Metadata
- Comments
- Our artifact is available at https://github.com/dierye/PAMA_public.git
Related papers
A Closer Look at the Quality of NPM Dataset for Malicious Code Detection
Shared title terminologycs.CRXuetao Li, Yuxia Zhang, Bohan Wang et al.
Aligning Tool Descriptions and Implementations to Detect Prompt Injections in LLM Agents
Shared title terminologycs.CRJohnny Song, Shih-Chieh Dai, Guanhong Tao
Measuring the Belief-Claim Gap: Disentangling Autonomous-Agent Beliefs from Security Certification
Shared title terminologycs.CRYoussef Hamdi Zafan Ibrahim, Mohammed Khalaf Salama
The Refusal Loop: When Enforcement Undermines Authorization in LLM Agent
Shared title terminologycs.CRDuo Zhou
Refusal Steering Creates Capable and Dangerous Agents
Shared title terminologycs.CRVincent Siu, Vlad Pavlovich, Glenn Grant-Richards et al.
A Persuaded Agent Cannot Persuade the Checker: Verified Differential Privacy Configuration by LLM Agents under Malicious Requesters
Shared title terminologycs.CRWenjun Yang, Eyhab Al-Masri, Tianhao Wang