Security Digest: December 23, 2025 - 2 Critical Vulnerabilities
Today's alert highlights two critical vulnerabilities affecting LangChain's serialization functions. These weaknesses allow attackers to execute unauthorized code and extract sensitive environment variables.
· 3 min read
Critical Vulnerabilities in LangChain Serialization Functions
Today's alert highlights two critical vulnerabilities affecting LangChain's serialization functions. These weaknesses allow attackers to execute unauthorized code and extract sensitive environment variables. Immediate patching and configuration changes are essential to prevent exploitation.
Critical Vulnerabilities
CVE-2025-68664: LangChain Serialization Injection
- Impact: Attackers can extract environment variables and execute unauthorized code by exploiting serialization flaws.
- Affected Systems: Applications using
langchain-corethat serialize/deserialize data withdumps,dumpd,load, orloads. - Immediate Action: Apply the latest patch for LangChain and update impacted configurations to enforce new security defaults.
- Mitigation: Ensure environment variable loading is disabled unless explicitly required and limit deserialization to trusted objects only.
CVE-2025-68665: LangChain JS Serialization Injection
- Impact: Attackers can extract secrets and execute unauthorized code through injected JSON structures.
- Affected Systems: Applications using
@langchain/corethat serialize/deserialize withtoJSONorJSON.stringify. - Immediate Action: Update LangChain JS libraries and configure to disable automatic secret loading from environment variables.
- Mitigation: Limit deserialization to trusted modules using controlled import maps and set
maxDepthfor JSON structures.
What to Do Now
- Apply patches for LangChain and LangChain JS immediately.
- Review and update application configurations to disable environment variable loading unless necessary.
- Ensure your applications only deserialize trusted data by using allowlists and controlled import maps.
- Monitor logs for any suspicious deserialization activities or unauthorized access attempts.
Related Resources
- Read our internal blog post for detailed patch integration steps.
- Refer to the official LangChain vendor advisories for further guidance.