langchain: Deserialization of Untrusted Data
CVE-2025-68664 is a high-severity deserialization of untrusted data vulnerability in langchain from LangChain AI, with a CVSS 3.1 base score of 8.2 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected langchain versions: >= 1.0.0, < 1.2.5; < 0.3.81. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 42.9% chance of exploitation within 30 days, which is in the top 1.26% of all scored CVEs.
EPSS places it among the vulnerabilities most likely to be exploited soon.
What to do
- Update Langchain Core to 0.3.81 or 1.2.5, whichever matches your release line, or a later version.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Langchain-ai | langchain | >= 1.0.0, < 1.2.5; < 0.3.81 | Not stated |
| Langchain | Langchain Core | before 0.3.81; 1.0.0 up to, but not including, 1.2.5 | 0.3.81, 1.2.5 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- LowLimited modification of data is possible.
- Availability
- NoneAvailability is not affected.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 9.3 | Critical | CNA (github.com) |
| CVSS 3.1 | 8.2 | High | NVD |
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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
How developers prevent this class of flaw
- If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
- When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.
- Explicitly define a final object() to prevent deserialization.
More Deserialization of Untrusted Data vulnerabilities (CWE-502)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: yes, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- github.com/langchain-ai/langchain/commit/5ec0fa69de31bbe3d76e4cf9cd65a6accb8466c8
- github.com/langchain-ai/langchain/commit/d9ec4c5cc78960abd37da79b0250f5642e6f0ce6
- github.com/langchain-ai/langchain/pull/34455Issue Tracking
- github.com/langchain-ai/langchain/pull/34458Issue Tracking
- github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D0.3.81Release Notes
- github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D1.2.5Release Notes
Other vulnerabilities in langchain
- 8.2 High severity
- 7.5 High severity
- 7.5 High severity
- 8.3 High severity
- 9.8 Critical severity
- 8.8 High severity
Recent Deserialization of Untrusted Data vulnerabilities
- 9.1 Critical severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
Spotted an error? Tell us.