cve.bz

CVE-2026-34070 langchain langchain core: Path traversal

7.5 highExploit referenceEPSS 1.5%Fix available

High (7.5) in langchain langchain core. EPSS 1.5% estimated probability of exploitation activity in the next 30 days. Fixed in langchain-core 1.2.22.

On this page
LangChain is a framework for building agents and LLM-powered applications. Prior to version 1.2.22, multiple functions in langchain_core.prompts.loading read files from paths embedded in deserialized config dicts without validating against directory traversal or absolute path injection. When an application passes user-influenced prompt configurations to load_prompt() or load_prompt_from_config(), an attacker can read arbitrary files on the host filesystem, constrained only by file-extension checks (.txt for templates, .json/.yaml for examples). This issue has been patched in version 1.2.22.

Severity

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
EPSS
1.5% (unchanged from 1.4% a week ago; 1.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 74th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: yes · Technical impact: partial, assessed 2026-03-31. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-22 Improper Limitation of a Pathname to a Restricted Directory (Path traversal)
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-34070 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-34070?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-34070?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-34070 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.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
langchain:langchain_corebefore 1.2.22

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-qh6h-p6c9-ff54PyPIlangchain-core<1.2.221.2.22
PYSEC-2026-2193PyPIlangchain-core<1.2.221.2.22

Red Hat

Red Hat rates this Important.

Red Hat's statement

This flaw is exploitable in applications that accept prompt configs from untrusted sources, including low-code AI builders and API wrappers that expose `load_prompt_from_config()`.

Also, the affected functions (`load_prompt`, `load_prompt_from_config` and the `.save()` method on prompt classes) are undocumented legacy APIs. They are superseded by the `dumpd`/`dumps`/`load`/`loads` serialization APIs in `langchain_core.load`, which do not perform filesystem reads and use an allowlist-based security model.

An attacker who controls or influences the prompt configuration dictionary can read files outside the intended directory, such as cloud-mounted secrets, internal system prompts, cloud credentials, Kubernetes manifests, CI/CD configs and application settings.

Due to these reasons, this vulnerability has been rated with an important severity.

Red Hat's mitigation

As described in the statement section, the vulnerable methods are legacy APIs and their use should be avoided. To mitigate this issue, the dumpd, dumps, load and loads methods from langchain_core.load should be used, as they supersede the legacy API and provide a more secure serialization model.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2.5ansible-automation-platform-25/lightspeed-rhel8:1780082949Fixed 2026-06-09RHSA-2026:24766
Red Hat Ansible Automation Platform 2.5ansible-automation-platform-25/lightspeed-rhel8:1787229385Fixed 2026-08-24RHSA-2026:59159
Red Hat OpenShift AI 3.3rhoai/odh-llama-stack-core-rhel9:1782471587Fixed 2026-07-09RHSA-2026:37275
Red Hat OpenShift AI 3.3rhoai/odh-trustyai-nemo-guardrails-server-rhel9:1782471606Fixed 2026-07-09RHSA-2026:37275
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/lightspeed-rhel8Will not fix
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/lightspeed-chatbot-rhel8Will not fix
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/lightspeed-rhel9Will not fix
Red Hat OpenShift AI (RHOAI)rhoai/odh-mlflow-rhel9Not affected

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-34070.

GitHub PoC (unverified)

Repositories on GitHub named after this CVE. Nobody has checked them and they are not scanned: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it.

  • Rickidevs/CVE-2026-34070 0 stars, created
    I Found a Zero-Day Vulnerability in langchain — Here’s How It Went

Attack patterns (CAPEC)

  • CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic Likelihood: High · Severity: High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-78 Using Escaped Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-79 Using Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-126 Path Traversal Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON