Critical LangChain Core Vulnerability Exposes Secrets via Serialization Injection
Source The Hacker News
Mentioned vulnerabilities
Fixed in 1.2.5 : patch affected systems as a priority.
Data as of 1 Jan 2026, 22:42 UTC
Rated by Threat Radar
- Patch
- Available – fixed in 1.2.5
What to do
AI-suggested
European organizations should immediately upgrade LangChain Core to version 1.2.5 or later (or 0.3.81 for earlier branches) to apply the official patch addressing CVE-2025-68664. Disable the 'secrets_from_env' option to prevent automatic loading of environment secrets during deserialization. Implement strict allowlists for deserializable classes using the 'allowed_objects' parameter to restrict object instantiation to safe, known types. Block or sanitize Jinja2 templates in user inputs to prevent template injection attacks. Conduct thorough input validation and sanitization on all user-controllable fields, especially those influencing LLM response metadata or additional_kwargs. Monitor LLM orchestration loops for suspicious serialization/deserialization activities and anomalous object instantiations. Employ runtime application self-protection (RASP) or behavior-based anomaly detection to identify exploitation attempts. Review and harden environment variable management to minimize sensitive data exposure. Educate developers on secure handling of AI model outputs and the risks of treating LLM responses as trusted inputs. Finally, audit dependencies for similar vulnerabilities, including LangChain.js, and apply corresponding patches.
Description
A critical security flaw has been disclosed in LangChain Core that could be exploited by an attacker to steal sensitive secrets and even influence large language model (LLM) responses through prompt injection. LangChain Core (i.e., langchain-core) is a core Python package that's part of the LangChain ecosystem, providing the core interfaces and model-agnostic abstractions for building