CVE-2026-40190: LangChain LangSmith SDK prototype pollution in createAnonymizer

CVE-2026-40190 · Severity: medium · CVSS 5.6 · Published 2026-04-10

The LangSmith JavaScript/TypeScript SDK, used for interacting with the LangSmith AI development platform, contains a security flaw in its data anonymization component. An attacker who can provide specially crafted data to be processed by the SDK can manipulate the underlying application's memory. This can lead to serious consequences including bypassing security checks, causing the application to crash, or potentially executing unauthorized commands on the server.

Technologies: langsmith (npm). Vendors: npm.

Quick answers

Is CVE-2026-40190 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-40190 being exploited in the wild.
How severe is CVE-2026-40190?
Medium severity, with a CVSS score of 5.6, published 10 April 2026.
Which products and versions are affected?
langsmith (npm) <= 0.5.17, SEMVER:introduced=0,fixed=0.5.18.
Is there a fix for CVE-2026-40190?
Yes. langsmith (npm): upgrade to 0.5.18 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-40190 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-40190?
Check whether you run langsmith (npm) 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 (npm): upgrade to 0.5.18 or later
    npm install langsmith@0.5.18

Technical details

A prototype pollution vulnerability exists in the LangSmith JS/TS SDK due to an incomplete blacklist in the internally vendored lodash 'baseAssignValue' function. While the function blocks the '__proto__' key, it fails to account for 'constructor.prototype' traversal. An attacker can exploit this via the 'createAnonymizer()' API by providing nested objects with malicious keys; when the SDK attempts to write back anonymized values using 'set()', it traverses the prototype chain to 'Object.prototype'. This affects all objects within the Node.js process and can lead to authentication bypass or Remote Code Execution (RCE) depending on the application environment. The issue is fixed in version 0.5.18.

Affected products

  • LangChain langsmith <= 0.5.17

Identifiers

  • CVE-2026-40190
  • GHSA-fw9q-39r9-c252

Timeline

  • 2026-03-24: disclosed: Initial report submitted
  • 2026-04-09: patched: Vendor confirmed and fixed in 0.5.18
  • 2026-04-10: advisory: NVD publication date

References

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