CVE-2026-40087: LangChain incomplete f-string validation in prompt templates
LangChain
LangChain exhibited incomplete prompt template validation where certain classes permitted attribute access or indexing expressions during formatting. This could allow unintended data evaluation within prompt templates.
disclosed CVENo confirmed exploitation, so this record is tracked as a disclosed vulnerability and not counted as an incident. It moves into the counts if CISA or the vendor confirms exploitation. Why
- CVSS
- 5.3
- EPSS
- <0.01 · top 81% · 2026-11-13
- fix status
- Fix status unknown
- first report
- 8 Apr 2026
- last update
- 9 Apr 2026
- CVE ids
Timeline · 2
Sources · 2
Advisories and databases
- 2026-04-08CVE-2026-40087: LangChain has incomplete f-string validation in prompt templatesGitHub Advisory Database · github.com/advisories/GHSA-926x-3r5x-gfhw
- 2026-04-09CVE-2026-40087: LangChain is a framework for building agents and LLM-powered applications.NVD · nvd.nist.gov/vuln/detail/CVE-2026-40087
Titles and links belong to their publishers. The summary above is written by gcdRadar in its own words; data is CC BY-SA 4.0.
Classification
- lane
- Patch now
- AI role
- Attack on AI
- categories
- Infrastructure vulnerability
- severity
- 2 · Disclosed vulnerability
- fix status
- Fix status unknown
- targets
- Framework / tooling
- owasp llm top 10
- LLM03:2025 Supply Chain
- mitre atlas
- no technique for these categories
- tags
- prompt-template
- dates
- happened 8 Apr 2026 · first reported 8 Apr 2026
- origin
- GitHub Advisory DatabaseVulnerability record from NVD / the GitHub Advisory Database. This product uses the NVD API but is not endorsed or certified by the NVD.
- record
- confidence 0.95 · created 2026-10-18 07:00Z · updated 2026-10-18 10:04Z
Lane, AI role, categories and severity come from the classifier; the OWASP and ATLAS rows are derived from the categories. How these are assigned
Copy a brief
This record as a short Markdown brief, for a ticket, a chat or a coding agent.
the brief as text
# CVE-2026-40087: LangChain incomplete f-string validation in prompt templates https://gcdradar.vercel.app/incidents/cve-2026-40087-langchain-incomplete-f-string-validation-in-p · AIR-2026-0562 · closed 2026-04-08 - Lane: Patch now - Severity: 2 (Disclosed vulnerability) - Fix status: Fix status unknown - First reported: 2026-04-08 - AI role: Attack on AI - Products: LangChain - CVE ids: CVE-2026-40087 - CVSS: 5.3 ## Summary LangChain exhibited incomplete prompt template validation where certain classes permitted attribute access or indexing expressions during formatting. This could allow unintended data evaluation within prompt templates. ## What to do No action recorded; read the sources below and the vendor's advisory. ## Latest updates - 2026-04-09: CVE-2026-40087: LangChain is a framework for building agents and LLM-powered applications. (https://nvd.nist.gov/vuln/detail/CVE-2026-40087) - 2026-04-08: CVE-2026-40087: LangChain has incomplete f-string validation in prompt templates (https://github.com/advisories/GHSA-926x-3r5x-gfhw) ## Sources - 2026-04-08 GitHub Advisory Database: CVE-2026-40087: LangChain has incomplete f-string validation in prompt templates https://github.com/advisories/GHSA-926x-3r5x-gfhw - 2026-04-09 NVD: CVE-2026-40087: LangChain is a framework for building agents and LLM-powered applications. https://nvd.nist.gov/vuln/detail/CVE-2026-40087 Verify against the vendor's advisory before changing production. Data CC BY-SA 4.0, https://gcdradar.vercel.app.
Related
- closed8.2LangChain family CVE-2026-44843: LangChain vulnerable to unsafe deserialization
Patch now · Disclosed · since 8 May 2026 · updated 26 May 2026 · CVE-2026-44843
AI - closed3.1LangChain family LangChain langchain-openai TOCTOU DNS rebinding vulnerability
Patch now · Disclosed · since 24 Apr 2026 · CVE-2026-41488
AI - closed6.5LangChain family LangChain URL validation SSRF vulnerability in HTMLHeaderTextSplitter
Patch now · Disclosed · since 24 Apr 2026 · CVE-2026-41481
AI - closedLangChain family RCE Vulnerabilities in LLM-Integrated Applications via Prompt Injection
Research · since 27 Feb 2025
AI - closed7.5LangChain family CVE-2026-34070: LangChain Core Has Path Traversal Vulnerabilities in load_prompt
Patch now · Disclosed · since 27 Mar 2026 · updated 31 Mar 2026 · CVE-2026-34070
AI - closed8.6LangChain family CVE-2026-72848: LangChain SitemapLoader vulnerable to unrestricted sitemap scraping
Patch now · Disclosed · since 20 Aug 2026 · CVE-2026-72848
AI