LangChain Vulnerable to Template Injection via Attribute Access in Prompt Templates
CVE-2025-65106 · GHSA-6qv9-48xg-fc7f · published 2025-11-20 · updated 2025-12-09
- Severity
- High
- CVSS score
- 8.3
- Chance of exploitation (EPSS)
- 0.52%
- Fixed in
- 1.0.7
- Exploitation No known exploitation
- Automatable No
- Technical impact Partial
- CISA SSVC
Attackers who can control template strings (not just template variables) can: Access Python object attributes and internal properties via attribute traversal Extract sensitive information from object internals (e.g., class, globals) Potentially escalate to more severe attacks depending on the objects passed to templates
Upgrade langchain-core to 1.0.7 or later. If you start it from an MCP config with npx or uvx, pin that version so an old cached copy is not used.
ChatPromptTemplate.from_messages( )
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| langchain-core | PyPI | <= 0.3.79 | 0.3.80 |
| langchain-core | PyPI | >= 1.0.0, <= 1.0.6 | 1.0.7 |
- CriticalUnauthenticated Remote Code Execution in Langflow via Public Flow Build EndpointlangflowExploited
- CriticalRay is vulnerable to Critical RCE via Safari & Firefox Browsers through DNS Rebinding AttackrayExploited
- CriticalLangflow Unauth RCElangflow, langflow-baseExploited
- HighLiteLLM: Authenticated command execution via MCP stdio test endpointslitellmExploited
- CriticalMLflow vulnerable to remote code execution on unauthenticated servers via third-party scorer deserialization importing caller-placed artifacmlflow
- CriticalAgno: Arbitrary code execution via `eval()` on `field_type` in `FunctionCall`agno
- CriticalLangChain serialization injection vulnerability enables secret extraction in dumps/loads APIslangchain-core, langchain-core
- HighLangChain vulnerable to unsafe deserialization of attacker-controlled objects through overly broad `load()` allowlistslangchain-core, langchain-core
- HighLangChain Core has Path Traversal vulnerabilites in legacy `load_prompt` functionslangchain-core
- MediumLangChain has incomplete f-string validation in prompt templateslangchain-core, langchain-core
- Mediumlangchain-core allows unauthorized users to read arbitrary files from the host file systemlangchain-core, langchain-core, langchain-core
- MediumLangChain's XMLOutputParser vulnerable to XML Entity Expansionlangchain-core
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.