The LMVD-ID is an internal research identifier, not an official CVE identifier.
LangChain Poisoning Jailbreak
A vulnerability in Retrieval-Augmented Generation (RAG) systems utilizing LangChain allows for indirect jailbreaks of Large Language Models (LLMs). By poisoning the external knowledge base accessed by the LLM through…
Paper-evaluated models(6)
ChatGLM2 6B, ChatGLM3 6B, ERNIE 3.5 +3 more
- ChatGLM2 6B
- ChatGLM3 6B
- ERNIE 3.5
- Llama 2 7B
- Qwen 14B Chat
- Xinghuo-3.5
Description
A vulnerability in Retrieval-Augmented Generation (RAG) systems utilizing LangChain allows for indirect jailbreaks of Large Language Models (LLMs). By poisoning the external knowledge base accessed by the LLM through LangChain, attackers can manipulate the LLM's responses, causing it to generate malicious or inappropriate content. The attack exploits the LLM's reliance on the external knowledge base and bypasses direct prompt-based jailbreak defenses.
Examples
See https://github.com/CAM-FSS/jailbreak-langchain (opens in a new tab). The repository contains examples of poisoned knowledge bases and trigger prompts used to successfully jailbreak multiple LLMs. Specific examples include using encoded keywords (Morse code, Base64) within disguised malicious content embedded in PDF files to avoid keyword filtering. The trigger prompt then directs the LLM to the malicious content within the knowledge base.
Impact
Successful exploitation leads to the generation of harmful content by the LLM, including but not limited to: inciting violence, promoting self-harm, spreading misinformation, and generating discriminatory statements. This undermines the safety mechanisms of the LLM and could have severe consequences depending on the context of its deployment.
Affected Systems
LLM applications that utilize LangChain for RAG and rely on external knowledge bases are vulnerable. Specific models mentioned in the research include ChatGLM2, ChatGLM3, Llama2, Qwen, Xinghuo 3.5, and Ernie-3.5 (and likely others using similar architectures).
Mitigation Steps
- Implement robust input sanitization and validation for all data sources accessed by the LLM, including external knowledge bases.
- Employ more advanced content filtering techniques that go beyond simple keyword matching, such as semantic analysis and contextual understanding.
- Continuously monitor and update the knowledge base for malicious content. Regularly audit and update the content filtering mechanisms.
- Implement mechanisms to detect and block attempts to inject malicious data into the knowledge base. This can involve analyzing the content for suspicious patterns or characteristics.
- Consider using multiple independent knowledge sources or diversify data sources to reduce the impact of poisoning a single source.
Research context and confidence
- Evidence and verification
- Paper-reported; independent reproduction is not documented.
- Primary research source linked.
- Severity
- Not rated by this catalog.
- Source and publication type
- arXiv · Research preprint.
- Peer-review status is not provided by this source.
- Author and publication status
- Author metadata is not stored; see the primary paper.
- Threat model and attacker access
- Black-box model, service, or application access.
- Related deployment categories
- Retrieval-augmented generation
- Taxonomy labels only; paper-specific deployment prerequisites are not inferred.
- Affected systems
- LLM applications that utilize LangChain for RAG and rely on external knowledge bases are vulnerable. Specific models mentioned in the research include ChatGLM2, ChatGLM3, Llama2, Qwen, Xinghuo 3.5, and Ernie-3.5 (and…
Research Paper
Poisoned langchain: Jailbreak llms by langchain
Primary source: arXiv. Findings are reported by the cited research and have not been independently verified.
View PaperEvidence
This entry is based on a primary research source. Its findings are paper-reported; independent reproduction and verification are not claimed.
https://arxiv.org/abs/2406.18122Related research
- LLM Judge Manipulation
Published March 1, 2026 · model-layer, application-layer, prompt-layer
- Prompt Injection Alignment Bypass
Published September 1, 2025 · prompt-layer, model-layer, application-layer
- MLM Adaptive RAG Poisoning
Published March 1, 2025 · application-layer, injection, poisoning