LangChain serialization injection vulnerability enables secret extraction in dumps/loads APIs (langchain-ai langchain)
At a glance
- Source
- NVD
- EPSS
- EPSS 42.93 % · percentile 99 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- GitHub_M
- NVD status
- Analyzed
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.
Weaknesses (CWE)
- CWE-502 — Deserialization of Untrusted Data
References
- https://github.com/langchain-ai/langchain/security/advisories/GHSA-c67j-w6g6-q2cm
- https://github.com/langchain-ai/langchain/pull/34455
- https://github.com/langchain-ai/langchain/pull/34458
- https://github.com/langchain-ai/langchain/commit/5ec0fa69de31bbe3d76e4cf9cd65a6accb8466c8
- https://github.com/langchain-ai/langchain/commit/d9ec4c5cc78960abd37da79b0250f5642e6f0ce6
- https://github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D0.3.81
- https://github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D1.2.5
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.1 | CRITICAL 9.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:N | GitHub_M |
| CVSS 3.1 | CRITICAL 9.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:N | NVD · security-advisories@github.com (Secondary) |
| CVSS 3.1 | HIGH 8.2 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N | NVD · nvd@nist.gov (Primary) |
Advisories
- GHSA-c67j-w6g6-q2cm — LangChain serialization injection vulnerability enables secret extraction in dumps/loads APIs
- PYSEC-2026-373 — LangChain serialization injection vulnerability enables secret extraction in dumps/loads APIs
European references
- ENISA EUVD · EUVD-2025-204849
- GCVE · GCVE-0-2025-68664
CERT-FR advisories
- CERTFR-2026-AVI-0224 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
Affected configurations (NVD CPE)
cpe:2.3:a:langchain:langchain_core:*:*:*:*:*:python:*:*< 0.3.81cpe:2.3:a:langchain:langchain_core:*:*:*:*:*:python:*:*≥ 1.0.0 < 1.2.5
Affected products
| Product | Versions |
|---|---|
| langchain-ai · langchain | affected >= 1.0.0, < 1.2.5 ; affected < 0.3.81 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| CERT-FR (ANSSI) | Licence Ouverte / Etalab 2.0 |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |