CVE-2025-65106: langchain · Template Injection
Affects langchainSource CVE Database V5
Not known to be exploited · CVSS 8.3 High : upgrade to 1.0.7 or 0.3.80 soon.
Data as of 26 Oct 2026, 14:05 UTC
- EPSS
- 0.5% chance of exploitation in 30 days – higher than 44% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 1.0.7, 0.3.80
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 21 Nov 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade langchain to 1.0.7 or 0.3.80.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
PyPIlangchainpkg:pypi/langchainOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
- Immediately upgrade all LangChain deployments to versions 0.3.80 or later, or 1.0.7 or later, where the vulnerability is patched.
- Audit all applications using LangChain to identify any acceptance of untrusted template strings, especially in ChatPromptTemplate and related classes.
- Implement strict input validation and sanitization to ensure that template strings are never sourced from untrusted or user-controlled inputs.
- Where dynamic template generation is necessary, use safe templating practices that separate template logic from data inputs, avoiding direct injection of template syntax.
- Employ runtime application self-protection (RASP) or web application firewalls (WAF) with custom rules to detect and block suspicious template injection attempts.
- Conduct security code reviews and penetration testing focusing on template injection vectors.
- Monitor application logs for unusual template processing behavior or errors indicative of exploitation attempts.
- Educate developers on secure use of template engines and the risks of processing untrusted template strings.
Description
LangChain is a framework for building agents and LLM-powered applications. From versions 0.3.79 and prior and 1.0.0 to 1.0.6, a template injection vulnerability exists in LangChain's prompt template system that allows attackers to access Python object internals through template syntax. This vulnerability affects applications that accept untrusted template strings (not just template variables) in ChatPromptTemplate and related prompt template classes. This issue has been patched in versions 0.3.80 and 1.0.7.