paper-with-me

Papers

ImportSnare: Directed "Code Manual" Hijacking in Retrieval-Augmented Code Generation

2025-09-09 · Kai Ye, Liangcai Su, Chenxiong Qian arxiv

Code generation has emerged as a pivotal capability of Large Language Models(LLMs), revolutionizing development efficiency for programmers of all skill levels. However, the complexity of data structures and algorithmic logic often results in functional deficiencies and security vulnerabilities in generated code, reducing it to a prototype requiring extensive manual debugging. While Retrieval-Augmented Generation (RAG) can enhance correctness and security by leveraging external code manuals, it simultaneously introduces new attack surfaces. In this paper, we pioneer the exploration of attack surfaces in Retrieval-Augmented Code Generation (RACG), focusing on malicious dependency hijacking. We demonstrate how poisoned documentation containing hidden malicious dependencies (e.g., matplotlib_safe) can subvert RACG, exploiting dual trust chains: LLM reliance on RAG and developers' blind trust in LLM suggestions. To construct poisoned documents, we propose ImportSnare, a novel attack framework employing two synergistic strategies: 1)Position-aware beam search optimizes hidden ranking sequences to elevate poisoned documents in retrieval results, and 2)Multilingual inductive suggestions generate jailbreaking sequences to manipulate LLMs into recommending malicious dependencies. Through extensive experiments across Python, Rust, and JavaScript, ImportSnare achieves significant attack success rates (over 50% for popular libraries such as matplotlib and seaborn) in general, and is also able to succeed even when the poisoning ratio is as low as 0.01%, targeting both custom and real-world malicious packages. Our findings reveal critical supply chain risks in LLM-powered development, highlighting inadequate security alignment for code generation tasks. To support future research, we will release the multilingual benchmark suite and datasets. The project homepage is https://importsnare.github.io.

📄 PDF Abstract BibTeX arXiv:2509.07941

Code (0)

등록된 구현이 없습니다.

Tasks

Code Generation

Similar Papers 제목 키워드 기반

From Clouds to Hallucinations: Atmospheric Retrieval Hijacking in Remote Sensing Vision-Language RAG

2026-05-08 · Jiaju Han, Chao Li, Chengyin Hu, Qike Zhang 외 arxiv

Multimodal RAG systems increasingly rely on vision-language retrievers to ground visual queries in external textual evidence. Existing adversarial studies on RAG mainly manipulate the retrieval corpus or memory, while at…

A Wolf in Sheep's Clothing: Targeted Routing Hijacking in Federated RAG

2026-05-27 · Junjie Mu, Qiongxiu Li arxiv

Federated Retrieval-Augmented Generation (FedRAG) is attractive for privacy-sensitive applications because full local corpora remain on clients. As a result, routing must rely on client-provided semantic profiles, creati…

Federated Learning

Vera Verto: Multimodal Hijacking Attack

2024-07-31 · Minxing Zhang, Ahmed Salem, Michael Backes, Yang Zhang

The increasing cost of training machine learning (ML) models has led to the inclusion of new parties to the training pipeline, such as users who contribute training data and companies that provide computing resources. Th…

Decoderimage-classificationImage Classification

Automating Agent Hijacking via Structural Template Injection

2026-02-18 · Xinhao Deng, Jiaqing Wu, Miao Chen, Yue Xiao 외 arxiv

Agent hijacking, highlighted by OWASP as a critical threat to the Large Language Model (LLM) ecosystem, enables adversaries to manipulate execution by injecting malicious instructions into retrieved content. Most existin…

The Ranking Blind Spot: Decision Hijacking in LLM-based Text Ranking

2025-09-23 · Yaoyao Qian, Yifan Zeng, Yuchao Jiang, Chelsi Jain 외 arxiv

Large Language Models (LLMs) have demonstrated strong performance in information retrieval tasks like passage ranking. Our research examines how instruction-following capabilities in LLMs interact with multi-document com…

Information RetrievalPassage Ranking