LangChain Core
CVE-2025-68664
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit 'lc'-keyed dict in user field
-
DeliveryApp serializes via dumps/dumpd without escaping
-
ExploitData deserialized by load/loads as LC object
-
ExecutionTrusted-namespace class instantiated
-
ImpactSecrets extracted or init side-effects triggered
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the application to serialize untrusted/user-controlled data with LangChain's dumps() or dumpd() and later deserialize it with load() or loads(). Concretely, affected applications are those that: (1) use astream_events(version='v1') - note version='v2' is NOT affected; (2) use Runnable.astream_log(); or (3) directly call dumps()/dumpd() on untrusted input and trust that output for later deserialization. The attacker must be able to place an 'lc'-keyed dictionary into a user-controlled field such as metadata, additional_kwargs, or response_metadata. Limiting factors: instantiation is restricted to pre-approved trusted namespaces (langchain_core, langchain, langchain_community) since namespace validation already existed before the patch, so arbitrary external class loading is NOT possible; applications on langchain-core >=0.3.81/>=1.2.5, or those that never deserialize serialized untrusted data, or that only use astream_events v2, are not exposed. |
| Impact | This is a genuine but conditional risk rather than a drop-everything emergency. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N) scores 8.2 and describes network-reachable, low-complexity, unauthenticated exploitation with high confidentiality impact (C:H) and limited integrity impact (I:L, S:U) - consistent with the GHSA framing that the core consequence is secret extraction plus instantiation of side-effecting classes confined to LangChain's already-trusted namespaces (langchain_core, langchain, langchain_community). Publicly available exploit information exists in the form of the GitHub Security Advisory GHSA-c67j-w6g6-q2cm, but there is NO CISA KEV listing and NO EPSS score in the provided data, so exploitation status is 'publicly available exploit code exists' and not active exploitation. The key tension is that the headline CVSS assumes no special conditions, yet the advisory explicitly scopes exploitability to applications using astream_events(version='v1'), Runnable.astream_log(), or those that call dumps()/dumpd() on untrusted data and later deserialize with load()/loads() - so the real-world attack surface is narrower than the raw vector implies. EPSS is MISSING and cannot be compared; without it, prioritize based on whether your deployment actually exercises the affected code paths. |
| Exploit ScenarioDerived | An attacker supplies crafted content in a user-controlled field (such as message metadata, additional_kwargs, or response_metadata) containing a dictionary with an 'lc' key that mimics LangChain's internal serialized-object marker. The application serializes this data with dumps()/dumpd() and later deserializes it via load()/loads() - for example through astream_events(version='v1') or astream_log() - causing the injected structure to be instantiated as a trusted LangChain object, enabling secret extraction or triggering side-effecting __init__ methods. Exploit details are public via the GitHub Security Advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Serialization injection in langchain-core (below 0.3.81, and 1.0.0 through 1.2.4) allows unauthenticated attackers to smuggle 'lc'-keyed dictionaries through user-controlled fields such as metadata, additional_kwargs, or response_metadata, so that load()/loads() later treats attacker data as a legitimate LangChain Serializable object instead of plain data, enabling secret extraction and instantiation of trusted-namespace classes whose __init__ performs side effects like file or network operations. Exposure is conditional rather than universal: the application must either serialize untrusted data with dumps()/dumpd() and later deserialize it, use astream_events(version='v1'), or use Runnable.astream_log() - astream_events v2 is explicitly not affected, and class instantiation remains confined to the pre-approved langchain_core, langchain, and langchain_community namespaces. Publicly available exploit code exists and NVD rates the flaw 8.2, though our assessment applies AC:H given the preconditions; CISA KEV does not list it, so this is a genuine but conditional risk rather than a drop-everything emergency, and the fix ships breaking changes that require planning.
RemediationAI
Upgrade langchain-core to 0.3.81 (0.3.x line) or 1.2.5 (1.x line) - the vendor-released fix documented in GHSA-c67j-w6g6-q2cm, released via GitHub PRs 34455 and 34458. Because the patch is a hardening release, expect breaking changes and test before rollout: allowed_objects defaults to 'core' (only serialization-mapping classes deserialize), secrets_from_env defaults to False (secrets resolved from environment at load time will stop resolving unless explicitly re-enabled), and Jinja2 templates referenced in deserialized objects are blocked by default via the new InitValidator - re-enable specific classes with an explicit allowed_objects allowlist rather than by loosening the validator globally. Where an immediate upgrade is not possible, compensating controls with their trade-offs are: switch astream_events callers from version='v1' to version='v2' (v2 is not affected; output shape and event schema differ, so consumers must be updated) and replace Runnable.astream_log() with astream_events v2 or manual callback-based logging (both require refactoring log consumers); sanitize or reject 'lc'-keyed dicts in metadata, additional_kwargs, and response_metadata at the API boundary before they reach dumps()/dumpd() (brittle, as nested structures and the __lc_escaped__ sentinel itself must be handled); and never round-trip untrusted data through dumps()/loads() - treat serialized output as data, not as a trust boundary (requires application logic changes but eliminates the exposure class entirely). If deserialization of untrusted payloads cannot be avoided, run it in a sandbox with no filesystem or network reachability to limit the side effects of any instantiated Serializable subclass. Signing off the fix also warrants scanning stored/queued serialized blobs produced by vulnerable versions for embedded 'lc' manifests before they are replayed through load().
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw is CWE-502 (deserialization of untrusted data) implemented as a serialization-injection escape bug in langchain-core's serialization layer. LangChain marks serialized objects with a reserved 'lc' key in the JSON/dict representation produced by Serializable.to_json(); load() and loads() walk that structure and re-instantiate the classes it names. Prior to the fix, dumps() and dumpd() passed free-form, user-supplied dictionaries through unmodified, so a dict containing 'lc' and the expected manifest fields survived round-tripping and was interpreted by the deserializer as a genuine LC object rather than inert data. The patch (commits 5ec0fa69 and d9ec4c5c, PRs 34455/34458) adds libs/core/langchain_core/load/_validation.py, which wraps any user dict whose keys include 'lc' (or that consists solely of the sentinel) as {'__lc_escaped__': {...}} during serialization and unwraps it back to a plain dict during deserialization, plus recursive _serialize_value handling for nested kwargs, lists, and tuples. The patch also hardens defaults: an allowlist via allowed_objects='core' restricted to the serialization mappings, secrets_from_env flipped from True to False, and default Jinja2 template blocking through a new InitValidator. Importantly, the deserializer's namespace allowlist (langchain_core, langchain, langchain_community) predates this patch, so the practical impact ceiling is instantiation of already-trusted Serializable subclasses with side-effecting constructors and exfiltration of secret values, not arbitrary Python code execution from attacker-supplied classes.
Know when Langchain Core gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
Network-reachable and unauthenticated (PR:N), but AC:H because the app must use a specific vulnerable serialize-then-deserialize path; C:H for secret extraction, I:L for constrained trusted-class instantiation, A:N.
Primary rating from NVD.
CVSS VectorNVD
DescriptionNVD
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.
Blast Radius
ecosystem impact- 4 pypi packages depend on langchain-core (4 direct, 0 indirect)
Ecosystem-wide dependent count for version 1.0.0.
Executive ViewAI
A high-severity vulnerability in langchain-core (CVE-2025-68664) could enable attackers to extract secrets or trigger unauthorized file and network operations in applications that serialize and deserialize untrusted data or use specific streaming APIs. Although exploitation is conditional on certain application configurations, publicly available exploit code exists, raising the risk for affected teams. Leadership should prioritize remediation to protect sensitive information and maintain system integrity.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.
GHSA-c67j-w6g6-q2cm
NVD
CVE.org
EPSS
Exploit-DB