Advisory

PYSEC-2026-1517

Also known as: CVE-2024-10940, GHSA-5chr-fjjv-38qv

Summary

langchain-core allows unauthorized users to read arbitrary files from the host file system

Details

A vulnerability in langchain-core versions >=0.1.17,<0.1.53, >=0.2.0,<0.2.43, and >=0.3.0,<0.3.15 allows unauthorized users to read arbitrary files from the host file system. The issue arises from the ability to create langchain_core.prompts.ImagePromptTemplate's (and by extension langchain_core.prompts.ChatPromptTemplate's) with input variables that can read any user-specified path from the server file system. If the outputs of these prompt templates are exposed to the user, either directly or through downstream model outputs, it can lead to the exposure of sensitive information.

Severity

Medium Basis: CVSS v3 score 5.3, vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Dates

Published
2026-07-07 14:34 UTC
Modified
2026-07-07 17:46 UTC

Affected packages and fixes

langchain-core

PyPI · All systems

Affected

  • introduced 0.1.17, fixed 0.1.53, introduced 0.2.0, fixed 0.2.43, introduced 0.3.0, fixed 0.3.15 (ecosystem)

Fixed versions

0.1.53, 0.2.43, 0.3.15

Fix

  • Fixed version 0.1.53
    pip install --upgrade langchain-core==0.1.53
  • Fixed version 0.2.43
    pip install --upgrade langchain-core==0.2.43
  • Fixed version 0.3.15
    pip install --upgrade langchain-core==0.3.15

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences