Template Injection Affecting langchain-core package, versions [,0.3.80)[0.4.0.dev0, 1.0.7)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.05% (14th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-LANGCHAINCORE-14100977
  • published23 Nov 2025
  • disclosed21 Nov 2025
  • credit0xn3va

Introduced: 21 Nov 2025

NewCVE-2025-65106  (opens in a new tab)
CWE-1336  (opens in a new tab)

How to fix?

Upgrade langchain-core to version 0.3.80, 1.0.7 or higher.

Overview

langchain-core is a Building applications with LLMs through composability

Affected versions of this package are vulnerable to Template Injection in the prompt template system. An attacker can access internal Python object attributes by submitting specially crafted template strings to ChatPromptTemplate and related prompt template classes.

Note: The vulnerability specifically requires that applications accept template strings (the structure) from untrusted sources, not just template variables (the data).

Most applications either do not use templates or else use hardcoded templates and are not vulnerable.

CVSS Base Scores

version 4.0
version 3.1