5.3

CVE-2026-40087: langchain-ai langchain

CVSS: 5.3v3.1MediumAnalyzed
AliasesGHSA-926x-3r5x-gfhwPYSEC-2026-2563CGA-h9qq-qw3w-4vcv
Published 09-04-2026Last modified 14-04-2026

Vulnerability summary

CVE-2026-40087 is a medium (CVSS 5.3) vulnerability in langchain-ai langchain. EPSS estimates a 0.45% chance of exploitation in the next 30 days, higher than 38% of scored vulnerabilities.

Overall risk
21/100
0100
Low · default modelHow is this calculated?
CVSS score
5.3/10
010
Medium · v3.1 (CVE.org)
EPSS score
0.45%
0%100%
Low · +0.19 pp in 30 days
KEVNot listedIn no KEV catalog
RansomwareNone recordedNo known use recorded
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 0 · Related 1

Timeline

  1. 09-04-2026
    PublishedVulnerability first disclosed.
  2. 14-04-2026
    Last modifiedVulnerability information updated.

Description

LangChain is a framework for building agents and LLM-powered applications. Prior to 0.3.84 and 1.2.28, LangChain's f-string prompt-template validation was incomplete in two respects. First, some prompt template classes accepted f-string templates and formatted them without enforcing the same attribute-access validation as PromptTemplate. In particular, DictPromptTemplate and ImagePromptTemplate could accept templates containing attribute access or indexing expressions and subsequently evaluate those expressions during formatting. Second, f-string validation based on parsed top-level field names did not reject nested replacement fields inside format specifiers. In this pattern, the nested replacement field appears in the format specifier rather than in the top-level field name. As a result, earlier validation based on parsed field names did not reject the template even though Python formatting would still attempt to resolve the nested expression at runtime. This vulnerability is fixed in 0.3.84 and 1.2.28.

CVSS metrics

5 scores · 5 sources · 1 version

EPSS trend

Probability

0.45%

Chance of exploitation in the next 30 days

Percentile

38%

Versus all other CVEs

30-day change

+0.19 pp

From 0.26% on 19-09-2026

19-09-202619-10-2026
EPSS score
0.45%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Chainguard6 products
  • open-webui< 0.8.12-r3
  • py3-langchain< 1.3.0-r0
  • py3.10-langchain< 1.3.0-r0
  • py3.11-langchain< 1.3.0-r0
  • py3.12-langchain< 1.3.0-r0
Langchain1 product
Langchain-ai1 product
PyPI1 product
  • langchain-core< 0.3.84 | ≥ 1.0.0a1, < 1.2.28
Wolfi1 product
  • open-webui< 0.8.12-r3

5 vendors · 10 products

References

12 links
Show all 12 references