Security Vulnerability Report
中文
CVE-2025-68665 CVSS 8.6 HIGH

CVE-2025-68665

Published: 2025-12-23 23:15:45
Last Modified: 2026-01-13 16:17:23

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

CVSS Details

CVSS Score
8.6
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N

Configurations (Affected Products)

cpe:2.3:a:langchain:langchain.js:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:langchain:langchain.js:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:langchain:langchain\/core:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:langchain:langchain\/core:*:*:*:*:*:node.js:*:* - VULNERABLE
@langchain/core < 0.3.80
@langchain/core < 1.1.8
langchain < 0.3.37
langchain < 1.2.3

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
const maliciousPayload = { "lc": 1, "id": ["恶意的", "对象"] }; // 通过toJSON()或JSON.stringify()触发漏洞

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-68665", "sourceIdentifier": "[email protected]", "published": "2025-12-23T23:15:45.097", "lastModified": "2026-01-13T16:17:22.673", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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"}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N", "baseScore": 8.6, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 4.0}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-502"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:langchain:langchain.js:*:*:*:*:*:*:*:*", "versionEndExcluding": "0.3.37", "matchCriteriaId": "79F6F9C9-7927-4C72-9F8F-63186F6D59A2"}, {"vulnerable": true, "criteria": "cpe:2.3:a:langchain:langchain.js:*:*:*:*:*:*:*:*", "versionStartIncluding": "1.0.0", "versionEndExcluding": "1.2.3", "matchCriteriaId": "32341D52-B3FD-484F-940F-CB8EB24CFB43"}, {"vulnerable": true, "criteria": "cpe:2.3:a:langchain:langchain\\/core:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "0.3.80", "matchCriteriaId": "7D44DA1A-0433-4A46-8E85-D8363F1E5C99"}, {"vulnerable": true, "criteria": "cpe:2.3:a:langchain:langchain\\/core:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "1.0.0", "versionEndExcluding": "1.1.8", "matchCriteriaId": "CECC1942-DCA4-42B5-B9C1-E2F420B27D9A"}]}]}], "references": [{"url": "https://github.com/langchain-ai/langchainjs/commit/e5063f9c6e9989ea067dfdff39262b9e7b6aba62", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain%2Fcore%401.1.8", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/langchain-ai/langchainjs/releases/tag/langchain%401.2.3", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/langchain-ai/langchainjs/security/advisories/GHSA-r399-636x-v7f6", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://github.com/langchain-ai/langchainjs/security/advisories/GHSA-r399-636x-v7f6", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Vendor Advisory"]}]}}