CVE-2025-68664 LangChain serialization injection vulnerability enables secret extraction in dumps/loads APIs
Attackers can inject malicious objects via serialization APIs to execute code or extract secrets in LangChain applications.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-68664?
CVE-2025-68664 is a critical unsafe deserialization vulnerability in langchain-ai langchain, 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 agents and LLM-powered applications. Prior to versions 0.3.81 and 1.2.5, a serialization injection vulnerability exists in LangChain's dumps() and dumpd() functions. The functions do not escape dictionaries with 'lc' keys when serializing free-form dictionaries. 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 versions 0.3.81 and 1.2.5.
Weakness: CWE-502
Which versions are affected by CVE-2025-68664?
5 open source packages ship an affected version, including langchain-core. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
langchain-core PyPI | All versions | 0.3.81, 1.2.5 |
langchain-core PyPI | All versions | 0.3.81 |
langchain-core PyPI | All versions | 0.3.81 |
langchain-core PyPI | From 1.0.0 | 1.2.5 |
langchain-core PyPI | From 1.0.0 | 1.2.5 |
Products include Langchain Langchain Core.
How do I fix CVE-2025-68664?
Upgrade langchain-core to a fixed version for your release line: 0.3.81 or 1.2.5.
Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.
Is CVE-2025-68664 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-68664 exists.
Public exploit code: 1 Exploit-DB entry and 4 proofs of concept on GitHub.
Other vulnerabilities in langchain-ai langchain
Sources
Also known as ECHO-fb5a-79b4-ed97, GHSA-c67j-w6g6-q2cm, MINI-g399-jhx6-775w, PYSEC-2026-373, ROOT-APP-PYPI-CVE-2025-68664.