LangChain serialization injection vulnerability enables secret extraction in dumps/loads APIs
CVE-2025-68664GHSA-c67j-w6g6-q2cm
What to do
Vendor fix available. Upgrade each affected package to the fixed version on its release line (langchain-core 1.2.5, 0.3.81), redeploy, then verify what is actually installed.
This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.
Affected packages
PyPI langchain-core
- Affected
- >= 1.0.0, < 1.2.5< 0.3.81
- Fixed in
- 0.3.81, 1.2.5
Sources
- GitHub Advisory Database and maintainer security advisories on GitHub
GitHub-reviewed advisory GHSA-c67j-w6g6-q2cm lists affected ranges: PyPI langchain-core >=1.0.0 =0 <0.3.81
VerifiedObserved Structured GitHub Advisory Database record (type=reviewed) from the GitHub REST API.
- Open Source Vulnerabilities (OSV.dev), including the GitHub Advisory Database
OSV record GHSA-c67j-w6g6-q2cm lists affected ranges: PyPI langchain-core >=1.0.0 =0 <0.3.81 (fixed)
VerifiedObserved Structured OSV record; GitHub-reviewed advisory.
Severity and exploitation
- Exploitation
- No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
- CVSS
- 9.3 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:N
- EPSS
- CVE-2025-68664: 42.93% estimated exploitation activity in the next 30 days; percentile 98.72 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description
As published by the source; long descriptions are shortened.
Summary 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.
Attack surface The core vulnerability was in `dumps()` and `dumpd()`: these functions failed to escape user-controlled dictionaries containing `'lc'` keys. When this unescaped data was later deserialized via `load()` or `loads()`, the injected structures were treated as legitimate LangChain objects rather than plain user data. This escaping bug enabled several attack vectors: 1. Injection via user data: Malicious LangChain object structures could be injected through user-controlled fields like `metadata`, `additional_kwargs`, or `response_metadata`…
Dates and revisions
- Published by the source
- Last modified by the source
- Source last checked
- Revision 5 · amended ·
Amended from osv record GHSA-c67j-w6g6-q2cm
- Revision 4 · amended ·
Amended from ghsa record GHSA-c67j-w6g6-q2cm
- Revision 3 · amended ·
Amended from ghsa record GHSA-c67j-w6g6-q2cm
- Revision 2 · amended ·
Amended from osv record GHSA-c67j-w6g6-q2cm
- Revision 1 · created ·
Published from ghsa record GHSA-c67j-w6g6-q2cm
Agent brief
Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.
# Patch Next advisory brief: CVE-2025-68664 Advisory: LangChain serialization injection vulnerability enables secret extraction in dumps/loads APIs IDs: CVE-2025-68664, GHSA-c67j-w6g6-q2cm Record: https://patchnext.com/advisories/cve-2025-68664 (revision 5, source checked 28 Oct 2026, 06:05 UTC) Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected. Severity: Critical (CVSS 9.3) Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV. Vendor response: Vendor fix available; fixed versions by package: langchain-core 1.2.5, 0.3.81. A vendor fix does not mean a deployment is fixed. ## Affected components - PyPI langchain-core: affected >= 1.0.0, < 1.2.5; < 0.3.81; fixed in 0.3.81, 1.2.5 ## Suggested inspection (read-only) - `python -m pip show langchain-core`: prints the installed version. Run with the environment that serves production active. ## Supported action Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version. ## Required regression checks - Run the test suite and a production build. - Exercise the features that depend on langchain-core. - Repeat the inspection and confirm that only fixed versions remain installed. ## Rollback considerations - Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward. ## Unresolved questions - Which deployments run an affected version? - Exploitation status can change. Check again before lowering the priority. - Mark the work resolved only after the fixed version is verified in production. ## Sources - Verified: https://github.com/advisories/GHSA-c67j-w6g6-q2cm (GitHub-reviewed advisory GHSA-c67j-w6g6-q2cm lists affected ranges: PyPI langchain-core >=1.0.0 =0 <0.3.81) - Verified: https://osv.dev/vulnerability/GHSA-c67j-w6g6-q2cm (OSV record GHSA-c67j-w6g6-q2cm lists affected ranges: PyPI langchain-core >=1.0.0 =0 <0.3.81 (fixed)) Commands are suggestions: review each one before running it.
Loading voting…