CVE-2025-68665
8.6LangChain · LangChain JS
A serialization injection vulnerability in LangChain JS allows untrusted user input to be deserialized as internal objects, potentially leading to unauthorized data access.
Executive summary
A critical deserialization vulnerability in LangChain JS allows unauthenticated attackers to manipulate object serialization, posing a significant risk to application integrity.
Vulnerability
This is a deserialization of untrusted data (CWE-502) flaw occurring in the toJSON method. An unauthenticated attacker can inject arbitrary data containing specific internal keys that the framework misinterprets as legitimate serialized objects during the deserialization process.
Business impact
The exploitation of this flaw allows attackers to bypass standard data handling logic, potentially leading to unauthorized data disclosure or manipulation within LLM-powered applications. Given the CVSS score of 8.6, this represents a high-severity risk that could compromise the confidentiality and integrity of proprietary AI workflows and sensitive user data processed by the application.
Remediation
Immediate Action: Update @langchain/core to version 1.1.8 or 0.3.80, and update langchain to version 1.2.3 or 0.3.37 immediately.
Proactive Monitoring: Review application logs for unexpected JSON object structures or unusual serialization patterns that deviate from standard input schemas.
Compensating Controls: Implement strict input validation and sanitization for all user-provided data, ensuring that reserved internal keys are stripped or rejected before processing by the framework.
Exploitation status
Public Exploit Available: Unknown
Analyst recommendation
Organizations utilizing LangChain JS must prioritize the application of the provided patches. Because this vulnerability allows for the manipulation of object deserialization, it represents a direct threat to the core logic of your LLM-integrated systems. Immediate updates are the only reliable method to mitigate this exposure and protect your infrastructure from potential exploitation.
More LangChain CVEs
Sources
- https://github.com/langchain-ai/langchainjs/security/advisories/GHSA-r399-636x-v7f6
- https://github.com/langchain-ai/langchainjs/commit/e5063f9c6e9989ea067dfdff39262b9e7b6aba62
- https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain%2Fcore%401.1.8
- https://github.com/langchain-ai/langchainjs/releases/tag/langchain%401.2.3