CyberSecBulletin
CVE-2025-68665NVD status: Analyzed

langchainjs: Deserialization of Untrusted Data

CVE-2025-68665 is a critical-severity deserialization of untrusted data vulnerability in langchainjs from LangChain AI, with a CVSS 3.1 base score of 9.1 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected langchainjs versions: @langchain/core >= 1.0.0, < 1.1.8; @langchain/core < 0.3.80; langchain >= 1.0.0, < 1.2.3, and others listed below. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 0.79% chance of exploitation within 30 days, higher than 57% of scored CVEs.

Patch this week

Critical severity: a successful attack would have severe impact.

What to do

  1. Update Langchain.js to 0.3.37 or 1.2.3, whichever matches your release line, or a later version.
  2. Update Langchain/core to 0.3.80 or 1.1.8, whichever matches your release line, or a later version.
  3. Read the advisory on github.com for workarounds and exact fixed builds.
  4. 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-ailangchainjs@langchain/core >= 1.0.0, < 1.1.8; @langchain/core < 0.3.80; langchain >= 1.0.0, < 1.2.3; langchain < 0.3.37Not stated
LangchainLangchain.jsbefore 0.3.37; 1.0.0 up to, but not including, 1.2.30.3.37, 1.2.3
LangchainLangchain/corebefore 0.3.80; 1.0.0 up to, but not including, 1.1.80.3.80, 1.1.8

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
HighData or code can be modified at will.
Availability
NoneAvailability is not affected.

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.18.6HighCNA (github.com)
CVSS 3.19.1CriticalNVD

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

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 langchainjs

All langchainjs vulnerabilities

Recent Deserialization of Untrusted Data vulnerabilities

Spotted an error? Tell us.