CyberSecBulletin
CVE-2025-68664NVD status: Analyzed

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.

Patch this week

EPSS places it among the vulnerabilities most likely to be exploited soon.

What to do

  1. Update Langchain Core to 0.3.81 or 1.2.5, whichever matches your release line, or a later version.
  2. Read the advisory on github.com for workarounds and exact fixed builds.
  3. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
Langchain-ailangchain>= 1.0.0, < 1.2.5; < 0.3.81Not stated
LangchainLangchain Corebefore 0.3.81; 1.0.0 up to, but not including, 1.2.50.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 systemScoreSeverityScored by
CVSS 3.19.3CriticalCNA (github.com)
CVSS 3.18.2HighNVD

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

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: poc, automatable: yes, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Other vulnerabilities in langchain

All langchain vulnerabilities

Recent Deserialization of Untrusted Data vulnerabilities

Spotted an error? Tell us.