CVSS 3.1
5.3 mediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:NMedium (5.3) in langchain langchain core. EPSS 0.3% estimated probability of exploitation activity in the next 30 days. Fixed in langchain-core 0.3.84, 1.2.28.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:Nlangchain-core (PyPI): fixed in 0.3.84, 1.2.28Explain CVE-2026-40087 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-40087?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-40087?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-40087 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.
From the NVD's CPE matches.
| Product | Affected |
|---|---|
| langchain:langchain_core | before 0.3.84 |
| langchain:langchain_core | from 1.0.0 before 1.2.28 |
| Advisory | Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|---|
| GHSA-926x-3r5x-gfhw | PyPI | langchain-core | <0.3.84 | 0.3.84 |
| GHSA-926x-3r5x-gfhw | PyPI | langchain-core | >=1.0.0a1 <1.2.28 | 1.2.28 |
| PYSEC-2026-2563 | PyPI | langchain-core | <0.3.84 >=1.0.0a1 <1.2.28 | 0.3.84, 1.2.28 |
Red Hat rates this Moderate.
To exploit this vulnerability, an attacker needs to supply a specially crafted input to the `DictPromptTemplate` or `ImagePromptTemplate` classes. The payload must contain Python attribute access expressions (e.g., accessing internal object classes), which bypass the template validator and get executed by the underlying f-string formatter, potentially causing information disclosure. There is no memory corruption or arbitrary code execution. Due to these reasons, this flaw has been rated with a moderate severity.
To mitigate this vulnerability, validate and sanitize any user-supplied input before it is passed into a DictPromptTemplate or ImagePromptTemplate. Reject any input containing curly braces unless they are strictly necessary and controlled. Furthermore, strip or reject input strings that attempt to use nested replacement fields (e.g., fields hidden within format specifiers like {value:{nested_format}}).
| Product | Package | State | Advisory |
|---|---|---|---|
| Migration Toolkit for Applications 8 | redhat-user-workloads/art-images | Fix deferred | |
| OpenShift Lightspeed | openshift-lightspeed/lightspeed-service-api-rhel9 | Fix deferred | |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-24/lightspeed-rhel8-operator | Fix deferred | |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-25/lightspeed-chatbot-rhel8 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) 3 | rhelai3/bootc-cuda-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) 3 | rhelai3/bootc-rocm-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) 3 | rhelai3/disk-image-cuda-rhel9 | Fix deferred | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-llama-stack-core-rhel9 | Fix deferred | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-mlflow-rhel9 | Fix deferred | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-trustyai-nemo-guardrails-server-rhel9 | Fix deferred |
Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-40087.