Skip to content
HighVulnerability

GHSA-qh6h-p6c9-ff54: LangChain Core has Path Traversal vulnerabilites in legacy `load_prompt` functions

Published
Record updated
View JSON
Affected
  • langchain-core < 1.2.22
Fixed in
1.2.22
  • released March 24, 2026, 3 days before disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
1.4%

Summary

Multiple functions in `langchain_core.prompts.loading` read files from paths in deserialized config dicts without checking for absolute paths or `..` traversal. When an application passes user-influenced prompt configurations to `load_prompt()` or `load_prompt_from_config()`, an attacker can read arbitrary host files, limited only by `.txt`, `.json`, `.yaml` and `.yml` extension checks.

Mitigation

Update `langchain-core` to >= 1.2.22. The fix rejects absolute paths and `..` sequences by default, with an `allow_dangerous_paths=True` argument for trusted inputs. The legacy APIs are deprecated and will be removed in 2.0.0; migrate to `dumpd`/`dumps`/`load`/`loads` from `langchain_core.load`.