Skip to main content
VulnerabilityPublished

CVE-2025-65106: langchain · Template Injection

Affects langchainSource CVE Database V5

0

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, 17:16 UTC

CVSS 4.0 base score
8.3High
How severe the flaw is on the 0–10 CVSS scale.
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:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 21 Nov 2025

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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

ProductAffectedFixed in
PyPIlangchainpkg:pypi/langchainOther threatsAffected
  • <0.3.80
  • >=1.0.0 <1.0.7
Fixed in
  • 0.3.80
  • 1.0.7

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

  1. Immediately upgrade all LangChain deployments to versions 0.3.80 or later, or 1.0.7 or later, where the vulnerability is patched.
  2. Audit all applications using LangChain to identify any acceptance of untrusted template strings, especially in ChatPromptTemplate and related classes.
  3. Implement strict input validation and sanitization to ensure that template strings are never sourced from untrusted or user-controlled inputs.
  4. Where dynamic template generation is necessary, use safe templating practices that separate template logic from data inputs, avoiding direct injection of template syntax.
  5. Employ runtime application self-protection (RASP) or web application firewalls (WAF) with custom rules to detect and block suspicious template injection attempts.
  6. Conduct security code reviews and penetration testing focusing on template injection vectors.
  7. Monitor application logs for unusual template processing behavior or errors indicative of exploitation attempts.
  8. 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.

References

Community reviews

Loading reviews…