CVE-2025-65106 Details
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.
A template injection vulnerability has been identified in LangChain's prompt template system, specifically in versions through 0.3.79 and 1.0.0 to 1.0.6. This vulnerability allows attackers to access Python object internals through template syntax. It affects applications that accept untrusted template strings in 'ChatPromptTemplate' and related prompt template classes. The issue arises from improper validation of template strings, particularly in f-string templates, which can be exploited to access sensitive object attributes and internal properties.
To address this vulnerability, update to LangChain versions 0.3.80 or 1.0.7, and review your application's template usage to ensure that untrusted input is not allowed to control template strings. For Jinja2 templates, which have been hardened but still pose some risk, reserve their use for trusted sources only.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Nov 21, 2025CISA-ADP
Assessed Nov 21, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/langchain-ai/langchain/commit/c4b6ba254e1a49ed91f2e268e6484011c540542a | [email protected] | Source CodeVendor |
| https://github.com/langchain-ai/langchain/commit/fa7789d6c21222b85211755d822ef698d3b34e00 | [email protected] | Source CodeVendor |
| https://github.com/langchain-ai/langchain/security/advisories/GHSA-6qv9-48xg-fc7f | [email protected] | AdvisoryExploitRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-1336 | Improper Neutralization of Special Elements Used in a Template Engine | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| langchain-core | <= 0.3.79 (semver) >= 1.0.0, <= 1.0.6 (semver) |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 19, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Nov 21, 2025 | New CVE Received | [email protected] |
Volerion