# CVE-2025-68665: LangChain serialization injection vulnerability enables secret extraction

> Attackers can inject malicious objects via user-controlled data to extract secrets or execute code during deserialization in LangChain JS.

- **Severity:** High 8.6 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Dec 2025
- **Updated:** 24 Dec 2025
- **Also known as:** CLEANSTART-2026-CZ76970, CLEANSTART-2026-TX70118, ECHO-8c60-58c3-e7a5, GHSA-r399-636x-v7f6, MINI-2pfh-rpgg-45qm, MINI-8mhc-xcr8-5jf9, MINI-f8p8-cwrc-63p9, MINI-fcwp-2ggg-x29m, MINI-fhgx-3qx6-vwrr, MINI-j67g-8qwp-8v9q, MINI-m8qc-mf4g-qc2m, MINI-v4j9-q4xx-g62c, MINI-w68f-82vf-h2cc, ROOT-APP-NPM-CVE-2025-68665

## What is CVE-2025-68665?

CVE-2025-68665 is a high-severity unsafe deserialization vulnerability in langchain-ai langchainjs, published on 23 Dec 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

LangChain is a framework for building LLM-powered applications. Prior to @langchain/core versions 0.3.80 and 1.1.8, and prior to langchain versions 0.3.37 and 1.2.3, a serialization injection vulnerability exists in LangChain JS's toJSON() method (and subsequently when string-ifying objects using JSON.stringify(). The method did not escape objects with 'lc' keys when serializing free-form data in kwargs. The 'lc' key is used internally by LangChain to mark serialized objects. When user-controlled data contains this key structure, it is treated as a legitimate LangChain object during deserialization rather than plain user data. This issue has been patched in @langchain/core versions 0.3.80 and 1.1.8, and langchain versions 0.3.37 and 1.2.3

Weakness: CWE-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2025-68665?

8 open source packages ship an affected version, including @langchain/core and langchain. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@langchain/core` | npm | All versions | 0.3.80 |
| `@langchain/core` | npm | All versions | 0.3.80 |
| `@langchain/core` | npm | From 1.0.0 | 1.1.8 |
| `@langchain/core` | npm | From 1.0.0 | 1.1.8 |
| `langchain` | npm | All versions | 0.3.37 |
| `langchain` | npm | All versions | 0.3.37 |
| `langchain` | npm | From 1.0.0 | 1.2.3 |
| `langchain` | npm | From 1.0.0 | 1.2.3 |

Products: Langchain Langchain.js, Langchain Langchain\/Core.

## How do I fix CVE-2025-68665?

Upgrade @langchain/core to a fixed version for your release line: 0.3.80 or 1.1.8.

## Is CVE-2025-68665 being exploited?

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

## Other vulnerabilities in langchain-ai langchainjs

- [CVE-2024-7774](https://insights.sbomify.com/CVE-2024-7774/): Path Traversal in langchain-ai/langchainjs (medium 6.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-68665 and fix it if it is affected.

What it is: CVE-2025-68665 is a high-severity unsafe deserialization vulnerability in langchain-ai langchainjs, published on 23 Dec 2025. 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-2025-68665 exists.

Affected packages and fixed versions:
- @langchain/core (npm): affected all versions; fixed in 0.3.80
- @langchain/core (npm): affected all versions; fixed in 0.3.80
- @langchain/core (npm): affected from 1.0.0; fixed in 1.1.8
- @langchain/core (npm): affected from 1.0.0; fixed in 1.1.8
- langchain (npm): affected all versions; fixed in 0.3.37
- langchain (npm): affected all versions; fixed in 0.3.37
- langchain (npm): affected from 1.0.0; fixed in 1.2.3
- langchain (npm): affected from 1.0.0; fixed in 1.2.3

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-2025-68665/ (Markdown: https://insights.sbomify.com/CVE-2025-68665/index.md)
```

## Sources

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

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