CVE-2026-59152: LangChain LangSmith SDK arbitrary file read in TracingMiddleware

CVE-2026-59152 · Severity: medium · CVSS 5 · Published 2026-07-06

The LangSmith SDK, used for monitoring and tracing AI applications, contains a vulnerability in its TracingMiddleware component. An attacker can send a specially crafted web request that forces the server to read sensitive local files and upload them to the LangSmith monitoring platform. While the attacker needs access to the LangSmith workspace to view the stolen files, this allows low-privileged users or contractors to access server data they should not be able to see.

Technologies: LangChain LangSmith SDK, langsmith (PyPI). Vendors: LangChain, PyPI.

Quick answers

Is CVE-2026-59152 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-59152 being exploited in the wild.
How severe is CVE-2026-59152?
Medium severity, with a CVSS score of 5, published 6 July 2026.
Which products and versions are affected?
LangChain LangSmith SDK < 0.8.18; langsmith (PyPI) ECOSYSTEM:introduced=0,fixed=0.8.18.
Is there a fix for CVE-2026-59152?
Yes. langsmith (PyPI): upgrade to 0.8.18 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-59152 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-59152?
Check whether you run LangChain LangSmith SDK or langsmith (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • langsmith (PyPI): upgrade to 0.8.18 or later
    pip install "langsmith>=0.8.18"

Technical details

A path traversal vulnerability (CWE-22) exists in the LangSmith SDK's TracingMiddleware due to improper validation of tracing-propagation headers. Two defects contribute to the flaw: first, header fields are merged into trace runs without validation (CWE-346), and second, a type check intended to restrict filesystem access fails because of a type mismatch between decoded input and the guard (CWE-843). An attacker can trigger the server to open an arbitrary file and upload it as a trace attachment using the server's own API key. While triggering the read may be unauthenticated depending on deployment, retrieving the file contents requires read access to the destination LangSmith workspace. The issue is fixed in version 0.8.18.

Affected products

  • langchain-ai langsmith-sdk < 0.8.18

Identifiers

  • CVE-2026-59152
  • GHSA-f4xh-w4cj-qxq8

Timeline

  • 2026-06-19: advisory: GitHub advisory published by maintainers
  • 2026-07-06: disclosed: NVD publication date
  • 2026-08-18: patched: Fixed in version 0.8.18

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.