Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. langchain-core
  4. ›
  5. CVE-2026-34070

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

March 27, 2026 (updated March 31, 2026)

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

Note: 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. As part of this fix, the legacy APIs have been formally deprecated and will be removed in 2.0.0.

References

  • github.com/advisories/GHSA-qh6h-p6c9-ff54
  • github.com/langchain-ai/langchain
  • github.com/langchain-ai/langchain/commit/27add913474e01e33bededf4096151130ba0d47c
  • github.com/langchain-ai/langchain/releases/tag/langchain-core==1.2.22
  • github.com/langchain-ai/langchain/security/advisories/GHSA-qh6h-p6c9-ff54
  • nvd.nist.gov/vuln/detail/CVE-2026-34070

Code Behaviors & Features

Detect and mitigate CVE-2026-34070 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.2.22

Fixed versions

  • 1.2.22

Solution

Upgrade to version 1.2.22 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

pypi/langchain-core/CVE-2026-34070.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:18:32 +0000.