# CVE-2026-34070: LangChain Core has Path Traversal vulnerabilites in legacy `load_prompt` functions

> Attackers can read arbitrary files on the host filesystem by exploiting path traversal in LangChain Core's legacy prompt loading functions.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Mar 2026
- **Updated:** 25 Aug 2026
- **Also known as:** CLSA-2026-1776126826, ECHO-34c7-ca18-1a8c, GHSA-qh6h-p6c9-ff54, PYSEC-2026-2193, ROOT-APP-PYPI-CVE-2026-34070

## What is CVE-2026-34070?

CVE-2026-34070 is a high-severity path traversal vulnerability in langchain-ai langchain, published on 31 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-34070?

3 open source packages ship an affected version, including langchain-core. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `langchain-core` | PyPI | All versions | 1.2.22 |
| `langchain-core` | PyPI | All versions | 1.2.22 |
| `langchain-core` | PyPI | All versions | 1.2.22 |

Products: Langchain Langchain Core.

## How do I fix CVE-2026-34070?

Upgrade langchain-core to 1.2.22 or later.

## Is CVE-2026-34070 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-34070 exists.

Public exploit code:

- I Found a Zero-Day Vulnerability in langchain — Here’s How It Went (github_poc): https://github.com/Rickidevs/CVE-2026-34070

## Other vulnerabilities in langchain-ai langchain

- [CVE-2025-68664](https://insights.sbomify.com/CVE-2025-68664/): LangChain serialization injection vulnerability enables secret extraction in dumps/loads APIs (critical 9.3)
- [CVE-2026-40087](https://insights.sbomify.com/CVE-2026-40087/): LangChain has incomplete f-string validation in prompt templates (medium 5.3)
- [CVE-2026-26013](https://insights.sbomify.com/CVE-2026-26013/): LangChain affected by SSRF via image_url token counting in ChatOpenAI.get_num_tokens_from_messages (low 3.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-34070 and fix it if it is affected.

What it is: CVE-2026-34070 is a high-severity path traversal vulnerability in langchain-ai langchain, published on 31 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-34070 exists.

Affected packages and fixed versions:
- langchain-core (PyPI): affected all versions; fixed in 1.2.22
- langchain-core (PyPI): affected all versions; fixed in 1.2.22
- langchain-core (PyPI): affected all versions; fixed in 1.2.22

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-34070/ (Markdown: https://insights.sbomify.com/CVE-2026-34070/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-34070
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-34070
- OSV: https://osv.dev/vulnerability/CVE-2026-34070

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-34070/
Summaries are generated and may contain mistakes; the official description above is the record.
