# CVE-2026-40190: LangSmith Client SDKs has Prototype Pollution in langsmith-sdk via Incomplete `__proto__` Guard in Internal lodash `set()`

> Prototype pollution in LangSmith SDK allows attackers to modify Object.prototype via crafted keys, potentially leading to code execution or privilege escalation.

- **Severity:** Medium 5.6 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Apr 2026
- **Updated:** 13 Apr 2026
- **Also known as:** ECHO-4586-52d3-1687, GHSA-fw9q-39r9-c252, MINI-2r39-prj9-w236, MINI-2rgp-5c7v-fjpq, MINI-4fqr-xrww-2298, MINI-97h9-5638-wwrf, MINI-ff9f-8mfv-cc3w, MINI-hf29-x68f-gmh5, MINI-jh8c-2fjg-grg2, MINI-jwqq-43m6-q59j, MINI-m7vc-x936-jfh8, MINI-mq5x-4gg9-qgm9, MINI-rmw6-r33p-xwjq, ROOT-APP-NPM-CVE-2026-40190

## What is CVE-2026-40190?

CVE-2026-40190 is a medium-severity vulnerability in langchain-ai langsmith-sdk, published on 10 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

LangSmith Client SDKs provide SDK's for interacting with the LangSmith platform. Prior to 0.5.18, the LangSmith JavaScript/TypeScript SDK (langsmith) contains an incomplete prototype pollution fix in its internally vendored lodash set() utility. The baseAssignValue() function only guards against the __proto__ key, but fails to prevent traversal via constructor.prototype. This allows an attacker who controls keys in data processed by the createAnonymizer() API to pollute Object.prototype, affecting all objects in the Node.js process. This vulnerability is fixed in 0.5.18.

Weakness: CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes)

## Which versions are affected by CVE-2026-40190?

2 open source packages ship an affected version, including langsmith. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `langsmith` | npm | All versions | 0.5.18 |
| `langsmith` | npm | All versions | 0.5.18 |

Products: Langchain Langsmith.

## How do I fix CVE-2026-40190?

Upgrade langsmith to 0.5.18 or later.

## Is CVE-2026-40190 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40190 exists.

## Other vulnerabilities in langchain-ai langsmith-sdk

- [CVE-2026-25750](https://insights.sbomify.com/CVE-2026-25750/): LangSmith Studio has URL Parameter Injection Vulnerability that Enables Token Theft via Malicious baseUrl (high 8.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-40190 and fix it if it is affected.

What it is: CVE-2026-40190 is a medium-severity vulnerability in langchain-ai langsmith-sdk, published on 10 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40190 exists.

Affected packages and fixed versions:
- langsmith (npm): affected all versions; fixed in 0.5.18
- langsmith (npm): affected all versions; fixed in 0.5.18

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-40190/ (Markdown: https://insights.sbomify.com/CVE-2026-40190/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-40190
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-40190
- OSV: https://osv.dev/vulnerability/CVE-2026-40190

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-40190/
Summaries are generated and may contain mistakes; the official description above is the record.
