Improper Neutralization of Special Elements Used in a Template Engine Affecting langchain-core package, versions [,0.3.84)[0.4.0.dev0, 1.2.28)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.26% (18th 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-15953340
  • published9 Apr 2026
  • disclosed8 Apr 2026
  • creditUnknown

Introduced: 8 Apr 2026

CVE-2026-40087  (opens in a new tab)
CWE-1336  (opens in a new tab)

How to fix?

Upgrade langchain-core to version 0.3.84, 1.2.28 or higher.

Overview

langchain-core is a Building applications with LLMs through composability

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements Used in a Template Engine via the template formatting. An attacker can access internal object fields or nested data by supplying specially crafted template strings that include attribute access or indexing expressions, which are evaluated during formatting.

CVSS Base Scores

version 4.0
version 3.1