CVE-2025-68664: CWE-502: Deserialization of Untrusted Data in langchain-ai langchain
CVE-2025-68664 is a critical deserialization vulnerability in the LangChain framework versions prior to 0. 3. 81 and 1. 2. 5. The vulnerability arises because LangChain's dumps() and dumpd() serialization functions do not properly escape dictionaries containing the 'lc' key, which is internally used to mark serialized objects. Malicious actors can craft user-controlled data with this key to trigger unsafe deserialization, leading to potential remote code execution or unauthorized data manipulation. The vulnerability has a CVSS score of 9. 3, indicating high severity with network attack vector, no privileges or user interaction required, and a scope change. European organizations using vulnerable LangChain versions in AI or agent-based applications face risks of confidentiality breaches and integrity violations.
AI Analysis
Technical Summary
CVE-2025-68664 is a critical security vulnerability classified under CWE-502 (Deserialization of Untrusted Data) affecting the LangChain framework, a popular tool for building agents and large language model (LLM)-powered applications. The issue exists in LangChain versions prior to 0.3.81 and 1.2.5, specifically in the dumps() and dumpd() serialization functions. These functions fail to properly escape or validate dictionaries containing the 'lc' key, which LangChain internally uses to identify serialized objects. When user-controlled input includes this 'lc' key structure, the deserialization process mistakenly treats it as a legitimate LangChain object rather than plain data. This flaw enables attackers to inject malicious serialized objects that can execute arbitrary code or manipulate application logic during deserialization. The vulnerability is remotely exploitable without requiring authentication or user interaction, and it affects the confidentiality and integrity of affected systems while not impacting availability. The CVSS v3.1 base score is 9.3, reflecting its critical nature and the potential for widespread impact. Although no known exploits are currently reported in the wild, the vulnerability's characteristics make it a high-risk target for attackers, especially in environments that process untrusted input through LangChain's serialization mechanisms. The issue has been addressed in LangChain versions 0.3.81 and 1.2.5, and users are strongly advised to upgrade to these or later versions to mitigate the risk.
Potential Impact
For European organizations, the impact of CVE-2025-68664 can be significant, especially for those leveraging LangChain in AI-driven applications, chatbots, or automated agents. Exploitation could lead to unauthorized code execution, allowing attackers to exfiltrate sensitive data, alter application behavior, or pivot within internal networks. Confidentiality breaches could expose proprietary AI models, user data, or intellectual property. Integrity violations may result in corrupted outputs or manipulated decision-making processes in AI workflows. Given the network-exploitable nature and lack of required privileges, attackers could remotely compromise vulnerable systems, potentially affecting cloud-hosted services and SaaS platforms widely used in Europe. The vulnerability could also undermine trust in AI applications and cause regulatory compliance issues under GDPR if personal data is compromised. The absence of known exploits currently provides a window for proactive defense, but the critical severity demands urgent attention.
Mitigation Recommendations
1. Immediately upgrade all LangChain deployments to version 0.3.81 or 1.2.5 or later, where the vulnerability is patched. 2. Audit all application components that use LangChain serialization/deserialization to ensure they do not process untrusted or user-supplied data without validation. 3. Implement strict input validation and sanitization to detect and reject dictionaries containing the 'lc' key or other suspicious serialized structures before deserialization. 4. Employ runtime application self-protection (RASP) or web application firewalls (WAFs) with custom rules to monitor and block anomalous deserialization payloads targeting LangChain endpoints. 5. Restrict network exposure of services using LangChain serialization to trusted internal networks or authenticated users only. 6. Conduct thorough code reviews and penetration testing focused on deserialization flows in AI applications. 7. Monitor security advisories and threat intelligence feeds for any emerging exploits related to this CVE. 8. Educate developers and DevOps teams about secure deserialization practices and the risks associated with untrusted data processing.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland
CVE-2025-68664: CWE-502: Deserialization of Untrusted Data in langchain-ai langchain
Description
CVE-2025-68664 is a critical deserialization vulnerability in the LangChain framework versions prior to 0. 3. 81 and 1. 2. 5. The vulnerability arises because LangChain's dumps() and dumpd() serialization functions do not properly escape dictionaries containing the 'lc' key, which is internally used to mark serialized objects. Malicious actors can craft user-controlled data with this key to trigger unsafe deserialization, leading to potential remote code execution or unauthorized data manipulation. The vulnerability has a CVSS score of 9. 3, indicating high severity with network attack vector, no privileges or user interaction required, and a scope change. European organizations using vulnerable LangChain versions in AI or agent-based applications face risks of confidentiality breaches and integrity violations.
AI-Powered Analysis
Technical Analysis
CVE-2025-68664 is a critical security vulnerability classified under CWE-502 (Deserialization of Untrusted Data) affecting the LangChain framework, a popular tool for building agents and large language model (LLM)-powered applications. The issue exists in LangChain versions prior to 0.3.81 and 1.2.5, specifically in the dumps() and dumpd() serialization functions. These functions fail to properly escape or validate dictionaries containing the 'lc' key, which LangChain internally uses to identify serialized objects. When user-controlled input includes this 'lc' key structure, the deserialization process mistakenly treats it as a legitimate LangChain object rather than plain data. This flaw enables attackers to inject malicious serialized objects that can execute arbitrary code or manipulate application logic during deserialization. The vulnerability is remotely exploitable without requiring authentication or user interaction, and it affects the confidentiality and integrity of affected systems while not impacting availability. The CVSS v3.1 base score is 9.3, reflecting its critical nature and the potential for widespread impact. Although no known exploits are currently reported in the wild, the vulnerability's characteristics make it a high-risk target for attackers, especially in environments that process untrusted input through LangChain's serialization mechanisms. The issue has been addressed in LangChain versions 0.3.81 and 1.2.5, and users are strongly advised to upgrade to these or later versions to mitigate the risk.
Potential Impact
For European organizations, the impact of CVE-2025-68664 can be significant, especially for those leveraging LangChain in AI-driven applications, chatbots, or automated agents. Exploitation could lead to unauthorized code execution, allowing attackers to exfiltrate sensitive data, alter application behavior, or pivot within internal networks. Confidentiality breaches could expose proprietary AI models, user data, or intellectual property. Integrity violations may result in corrupted outputs or manipulated decision-making processes in AI workflows. Given the network-exploitable nature and lack of required privileges, attackers could remotely compromise vulnerable systems, potentially affecting cloud-hosted services and SaaS platforms widely used in Europe. The vulnerability could also undermine trust in AI applications and cause regulatory compliance issues under GDPR if personal data is compromised. The absence of known exploits currently provides a window for proactive defense, but the critical severity demands urgent attention.
Mitigation Recommendations
1. Immediately upgrade all LangChain deployments to version 0.3.81 or 1.2.5 or later, where the vulnerability is patched. 2. Audit all application components that use LangChain serialization/deserialization to ensure they do not process untrusted or user-supplied data without validation. 3. Implement strict input validation and sanitization to detect and reject dictionaries containing the 'lc' key or other suspicious serialized structures before deserialization. 4. Employ runtime application self-protection (RASP) or web application firewalls (WAFs) with custom rules to monitor and block anomalous deserialization payloads targeting LangChain endpoints. 5. Restrict network exposure of services using LangChain serialization to trusted internal networks or authenticated users only. 6. Conduct thorough code reviews and penetration testing focused on deserialization flows in AI applications. 7. Monitor security advisories and threat intelligence feeds for any emerging exploits related to this CVE. 8. Educate developers and DevOps teams about secure deserialization practices and the risks associated with untrusted data processing.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2025-12-22T23:28:02.917Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 694b1e31d0b9012ffd688bf5
Added to database: 12/23/2025, 10:56:49 PM
Last enriched: 12/31/2025, 12:27:04 AM
Last updated: 2/6/2026, 9:38:53 PM
Views: 468
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2026-25732: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in zauberzeug nicegui
HighCVE-2026-25574: CWE-639: Authorization Bypass Through User-Controlled Key in payloadcms payload
MediumCVE-2026-25544: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in payloadcms payload
CriticalCVE-2026-25516: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in zauberzeug nicegui
MediumCVE-2026-2067: Buffer Overflow in UTT 进取 520W
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.