CodePoisonRAG: Knowledge Poisoning Attacks on Retrieval-Augmented Code Generation
[Kryptografia i bezpieczeństwo] Autorzy: Varun Gadey, Ziad Marey, Alexandra Dmitrienko
Retrieval-Augmented Code Generation (RACG) improves LLM-based software development by retrieving external code artifacts, documentation, and patches, and incorporating them into the generation context. This reliance on external knowledge introduces a critical trust boundary: poisoned artifacts can influence generated code without modifying the underlying LLM. Prior work shows that selecting existing vulnerable examples can increase the general vulnerability rate of RACG outputs, but leaves open whether a black-box attacker can construct a single task-matched artifact that propagates an attacker-selected weakness. We introduce CodePoisonRAG, a targeted upstream knowledge-poisoning framework that transforms benign fixed-code entries into poisoned artifacts. Its attack chain combines CWE-specific Vulnerability Injection, which embeds a selected source-to-sink flow while retaining task alig…
- Kategoria arxiv
- cs.CR
- Kategoria
- Kryptografia i bezpieczeństwo