Skip to content
Connect AISign inSign up free
CVE-2026-400875.3MediumCWE-1336

CVE-2026-40087: LangChain has incomplete f-string validation in prompt templates

langchain-ai · langchain

Affected: langchain-ai · Exploitation: unlikely (under 1%)

Not in CyberSIXT coverage yet: no article names this CVE. This page shows the public record.

0.3%probability of exploitation in the next 30 days
19th percentile
050100

Higher than 19% of scored CVEs

5.3MediumCVSS 3.1
LowMedium

DescriptionCVE.org

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 products1

From the CVE record. A product or version that is not listed is unknown, not unaffected.

  • langchain-ai · langchain< 0.3.83; >= 1.0.0a1, < 1.2.28

On the Atlas

Every published CVE is on the CyberSIXT Atlas, grouped by weakness, vendor and month.

Open the Atlas
Exploitation
Unlikely (under 1%). EPSS under 1%, or no score yet.
CISA KEV
Not listed
Public check
No public nuclei template
Published
April 2026

CoverageNo articles yet

No CyberSIXT article names CVE-2026-40087 yet, so there is no coverage timeline, action brief or change log for it. Everything on this page comes from the public CVE record, CISA KEV, EPSS and the nuclei template index. Search the archive or see the CVEs in the news.

References