Arviser

CVE-2026-34070 in langchain-core: reading files through a prompt config

Advisory explainer. Facts come from the public advisory linked in the sources. Last checked: 2026-11-22.

Short answer: CVE-2026-34070 is a path traversal bug in the legacy prompt-loading functions of langchain-core. If your app passes a prompt configuration that a user can influence to load_prompt() or load_prompt_from_config(), that user could read files from the server, limited by file extension. Fixed in langchain-core 1.2.22. The advisory says the legacy functions are now deprecated and will be removed in 2.0.0.

What does the advisory record say?

Short answer: a high severity, CVSS 3.1 score 7.5, weakness type CWE-22 (path traversal), published on 2026-03-27 in the GitHub Advisory Database.

Field Value in the GitHub advisory
Advisory ID GHSA-qh6h-p6c9-ff54
CVE CVE-2026-34070
Package langchain-core on PyPI
Affected versions everything before 1.2.22
Fixed version 1.2.22
CVSS 3.1 vector AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

The advisory states that the affected functions read files from paths inside a config dictionary without checking for .. sequences or absolute paths.

What could an attacker read?

Short answer: files with the extensions the loader accepts. The advisory gives two groups.

The advisory says this 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(). It also notes that the severity score reflects the extension limits.

Is my product likely to be affected?

Short answer: only if untrusted input can reach a prompt config. The advisory describes these functions as undocumented legacy APIs, so many applications never call them. Check rather than assume.

Examples we use to look for exposure. The advisory itself names only low-code AI builders and API wrappers that expose load_prompt_from_config():

What should you check in your own system?

Short answer: version, calls, and what the process can read.

  1. Version. Run pip show langchain-core in each deployed image. The fixed version is 1.2.22.
  2. Calls. Search for load_prompt, load_prompt_from_config, template_path, example_prompt_path and .save( on prompt objects. Note who can write the config in each case.
  3. Migration. The advisory names the dumpd, dumps, load and loads APIs as the replacement, with an allowlist security model. This is a change of format, not a rename, so plan it as a small migration. Read the related advisory CVE-2025-68664 before you move, because that serialization path had its own bug and its own breaking changes.
  4. The escape hatch. The fix rejects absolute paths and .. by default and adds a keyword argument, allow_dangerous_paths=True, for trusted inputs. Do not set it on any config that a user can influence.
  5. File access. List what files the process can read. Mounted secrets and cloud credential files should only be present when the process needs them. A container that mounts only the files it needs, and no credential files, limits what a file read bug can expose.
  6. Regression test. Place a canary file outside the prompt directory in a test environment. Submit a prompt config that points to it, once with an absolute path and once with .. segments. Assert that the call fails and the canary content never appears. Keep the test in CI, see the AI security regression tests guide.

Sources

A record does not mean anyone was attacked.

We re-check this page against the advisory when it is updated. If you see a difference, write to contact@arviser.com.

Weekly advisories · digest by email planned

Hear when the weekly AI security digest starts

Every week we publish a plain-language digest of public advisories for AI frameworks, gateways and MCP servers, with the real dates and what to check for each. The email digest is planned. Leave your address and you get one message when it starts, with a link to confirm. Until then you get nothing else from this form. You can also follow the Atom feed.

Next: CVE-2025-68664 serialization injection · Agent tool permissions and MCP · Twelve security tests · AI Security Review · Request scope

Request a security review