cve.bz

CVE-2025-65106 langchain-ai langchain

8.3 highEPSS 0.5%Fix available

High (8.3) in langchain-ai langchain. EPSS 0.5% estimated probability of exploitation activity in the next 30 days. Fixed in langchain-core 0.3.80, 1.0.7.

On this page
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.

Severity

CVSS 4.0

8.3 high
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
EPSS
0.5% (unchanged from 0.5% a week ago; 0.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 45th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2025-11-21. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-1336 Improper Neutralization of Special Elements Used in a Template Engine
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

  • langchain-core (PyPI): fixed in 1.0.7, 0.3.80

Ask an AI about this CVE

Show the promptExplain CVE-2025-65106 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-65106?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-65106?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-65106 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
langchain-ai langchain>= 1.0.0, < 1.0.7
langchain-ai langchain< 0.3.80

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-6qv9-48xg-fc7fPyPIlangchain-core>=1.0.0 <1.0.71.0.7
GHSA-6qv9-48xg-fc7fPyPIlangchain-core<0.3.800.3.80
PYSEC-2026-1518PyPIlangchain-core<0.3.80
>=1.0.0 <1.0.7
0.3.80, 1.0.7

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability marked as an Important vulnerability rather than a Moderate flaw because the template injection pathway enables attackers to reach and traverse Python object internals, including attributes like __class__, __dict__, and potentially __globals__, when untrusted template structures are evaluated. This goes far beyond simple variable misuse: once an attacker can access internal object graphs, they may extract highly sensitive data such as environment variables, configuration objects, authentication tokens, or internal state held within LangChain message objects. The attack requires no privileges, no user interaction, and succeeds over a network whenever applications accept user-provided prompt templates—meaning the impact is systemic and not isolated to a single component. Although method execution is blocked, attribute traversal combined with indexing ([]) is still sufficient to expose confidential server-side data, creating a high confidentiality impact. Because the flaw allows reading sensitive runtime state rather than just causing template mis-renders or limited information exposure, the risk crosses the threshold from Moderate to Important.

Red Hat's mitigation

No mitigation is currently available that meets Red Hat Product Security’s standards for usability, deployment, applicability, or stability.

ProductPackageStateAdvisory
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/de-minimal-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/de-minimal-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/de-supported-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/de-supported-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/ee-minimal-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/ee-minimal-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/ee-supported-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/ee-supported-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/lightspeed-rhel8Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/platform-resource-runner-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/aap-cloud-metrics-collector-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/ansible-dev-tools-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/de-minimal-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/de-minimal-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/de-supported-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/de-supported-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/ee-cloud-services-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/ee-minimal-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/ee-minimal-rhel9Not affected
29 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-65106.

References

Check your stackJSON