Zero Day MonitorZDM
DashboardVulnerabilitiesTrendingZero-DaysNewsAbout
Login
ImpressumPrivacy Policy
Zero Day Monitor © 2026
2809 articles · 109656 vulns · 38/41 feeds (7d)
← Back to list
5.3
CVE-2026-40087EXPLOITEDPATCHED
pypa · langchain-core

LangChain has incomplete f-string validation in prompt templates

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.

Affected Products

VendorProductVersions
pypalangchain-core< 0.3.83, >= 1.0.0a1, < 1.2.28, 0.3.82, 1.2.27

Also Affects

Downstream vendors/products affected by this vulnerability

VendorProductSourceConfidence
piplangchain-coreGHSA85%

References

  • https://github.com/langchain-ai/langchain/security/advisories/GHSA-926x-3r5x-gfhw(x_refsource_CONFIRM)
  • https://github.com/langchain-ai/langchain/pull/36612(x_refsource_MISC)
  • https://github.com/langchain-ai/langchain/pull/36613(x_refsource_MISC)
  • https://github.com/langchain-ai/langchain/commit/6bab0ba3c12328008ddca3e0d54ff5a6151cd27b(x_refsource_MISC)
  • https://github.com/langchain-ai/langchain/commit/af2ed47c6f008cdd551f3c0d87db3774c8dfe258(x_refsource_MISC)
  • https://github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D0.3.84(x_refsource_MISC)
  • https://github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D1.2.28(x_refsource_MISC)

Related News (1 articles)

Tier C
VulDB4h ago
CVE-2026-40087 | langchain-ai langchain up to 0.3.82/1.2.27 special elements used in a template engine
→ No new info (linked only)
CVSS 3.15.3 HIGH
VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
CISA KEV❌ No
Actively exploited✅ Yes
Patch available
langchain-core@0.3.84langchain-core@1.2.28
CWECWE-1336
PublishedApr 8, 2026
Last enriched3h agov2
Tags
GHSA-926x-3r5x-gfhwpip
Trending Score46
Source articles1
Independent1
Info Completeness9/14
Missing: epss, kev, exploit, iocs, mitre_attack

Community Vote

0
Login to vote
0 upvotes0 downvotes
No votes yet

Related CVEs (5)

CRITICALCVE-2026-39987EXPKEV
marimo Affected by Pre-Auth Remote Code Execution via Terminal WebSocket Authentication Bypass
Trending: 111
HIGHCVE-2026-39981
AGiXT has a Path Traversal in safe_join()
Trending: 27
HIGHCVE-2026-34824
Mesop: Unbounded Thread Creation in WebSocket Handler Leads to Denial of Service
Trending: 23
MEDIUMCVE-2026-34052
LTI JupyterHub Authenticator: Unbounded Memory Growth via Nonce Storage (Denial of Service)
Trending: 11
HIGHCVE-2024-49048
TorchGeo Remote Code Execution Vulnerability
Trending: 8

Pin to Dashboard

Verification

State: unverified
Confidence: 0%

Vulnerability Timeline

CVE Published
Apr 8, 2026
Discovered by ZDM
Apr 9, 2026
Actively Exploited
Apr 9, 2026
Patch Available
Apr 9, 2026
Updated: affectedVersions, severity, activelyExploited
Apr 9, 2026

Version History

v2
Last enriched 3h ago
v2Tier C3h ago

Updated affected versions to include 0.3.82 and 1.2.27, changed severity to HIGH, and noted that no exploit is available.

affectedVersionsseverityactivelyExploited
via VulDB
v14h ago

Initial creation