CVE-2026-27794: LangGraph BaseCache Deserialization Vulnerability Leading to Remote Code Execution
Summary
CVE-2026-27794: LangGraph: BaseCache Deserialization of Untrusted Data may lead to Remote Code Execution. Affects langgraph-checkpoint versions < 4.0.0. Fixed in 4.0.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
LangGraph is an open-source library designed for building stateful applications using graphs. It provides a caching layer to enhance performance by storing intermediate results. However, when cache backends inherit from the BaseCache class and caching is enabled, the library becomes vulnerable to deserialization attacks, particularly when using the default serializer configuration.
Vulnerability Detail
The vulnerability arises from the default configuration of the BaseCache class, which uses JsonPlusSerializer with pickle_fallback enabled. This allows for deserialization of untrusted data through pickle.loads when msgpack serialization fails. If an attacker can write malicious payloads to the cache backend, they can exploit this vulnerability to execute arbitrary code within the LangGraph process. The exploitation requires write access to the cache backend, making it a post-compromise escalation vector.
How To Fix
Minimum fixed version
4.0.0
This is the first release that contains the fix.
pip install --upgrade "langgraph-checkpoint==4.0.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading is not immediately possible, consider disabling caching in your application or using a cache backend that does not inherit from BaseCache. Here is an example of how to disable caching:
builder = StateGraph(dict)
# Do not pass cache=... to disable caching
builder.add_node("my_node", my_node)
Conclusion
The LangGraph vulnerability CVE-2026-27794 poses a significant risk due to its potential for remote code execution through deserialization of untrusted data. It is crucial for users to upgrade to the patched version or implement workarounds to safeguard their applications.
See every vulnerability recorded for langgraph-checkpoint →
FAQ
The CVSS score of this vulnerability is 6.6, indicating a moderate severity level.
Versions prior to langgraph-checkpoint 4.0.0 are affected by this vulnerability.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If exploited, this vulnerability can lead to arbitrary code execution within the LangGraph process, potentially compromising the entire application.
Yes, you can disable caching in your application or use a different cache backend that does not inherit from BaseCache.
References
Related vulnerabilities
Recent vulnerabilities recorded for langgraph-checkpoint.