CVE-2026-34070: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in langchain-ai langchain
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.
AI Analysis
Technical Summary
LangChain versions before 1.2.22 contain a path traversal vulnerability in multiple functions within langchain_core.prompts.loading. These functions read files from paths embedded in deserialized configuration dictionaries without proper validation against directory traversal or absolute path injection. When user-controlled prompt configurations are passed to load_prompt() or load_prompt_from_config(), an attacker can exploit this to read arbitrary files on the host filesystem, limited only by file extension checks for .txt, .json, and .yaml files. The vulnerability is tracked as CVE-2026-34070 with a CVSS v3.1 score of 7.5 (high severity). The issue has been fixed in version 1.2.22. Red Hat has published advisories confirming the vulnerability and providing remediation guidance.
Potential Impact
An attacker able to supply user-influenced prompt configurations to vulnerable functions can read arbitrary files on the host system, potentially exposing sensitive information. The impact is confidentiality loss without integrity or availability impact. The attack surface is limited by file extension restrictions to .txt, .json, and .yaml files.
Mitigation Recommendations
This vulnerability is patched in langchain version 1.2.22. Users should upgrade to version 1.2.22 or later to remediate this issue. Red Hat advisories confirm the availability of this fix. No additional mitigations are specified beyond applying the official patch.
CVE-2026-34070: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in langchain-ai langchain
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.
CVSS v3.1
Score 7.5high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
LangChain versions before 1.2.22 contain a path traversal vulnerability in multiple functions within langchain_core.prompts.loading. These functions read files from paths embedded in deserialized configuration dictionaries without proper validation against directory traversal or absolute path injection. When user-controlled prompt configurations are passed to load_prompt() or load_prompt_from_config(), an attacker can exploit this to read arbitrary files on the host filesystem, limited only by file extension checks for .txt, .json, and .yaml files. The vulnerability is tracked as CVE-2026-34070 with a CVSS v3.1 score of 7.5 (high severity). The issue has been fixed in version 1.2.22. Red Hat has published advisories confirming the vulnerability and providing remediation guidance.
Potential Impact
An attacker able to supply user-influenced prompt configurations to vulnerable functions can read arbitrary files on the host system, potentially exposing sensitive information. The impact is confidentiality loss without integrity or availability impact. The attack surface is limited by file extension restrictions to .txt, .json, and .yaml files.
Mitigation Recommendations
This vulnerability is patched in langchain version 1.2.22. Users should upgrade to version 1.2.22 or later to remediate this issue. Red Hat advisories confirm the availability of this fix. No additional mitigations are specified beyond applying the official patch.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-03-25T16:21:40.867Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2026-34070","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:24766","vendor":"Red Hat"}]
Threat ID: 69cc1e09e6bfc5ba1d33b7e8
Added to database: 03/31/2026, 19:18:33 UTC
Last enriched: 07/18/2026, 14:44:04 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 196
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.