LangChain LangGraph BaseCache Deserialization of Untrusted Data Remote Code Execution Vulnerability
The BaseCache class in LangChain LangGraph fails to validate user-supplied data before deserialising it, so untrusted input can be turned into live objects. An unauthenticated remote attacker could use this to run arbitrary code as the service account.
Originally disclosed on Zero Day Initiative
This vulnerability allows remote attackers to execute arbitrary code on affected installations of LangChain LangGraph. Authentication is not required to exploit this vulnerability.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the BaseCache class deserialises cached data without validating or restricting what it accepts, allowing attacker-controlled input to be turned into arbitrary objects.
Impact
An unauthenticated remote attacker could execute arbitrary code in the context of the service account, though the text gives no further detail on how the malicious data reaches the cache.
What the attacker needed
Network access to the affected component; no authentication required
The fix
The vendor issued an update to correct the vulnerability, so affected installations should be upgraded to the fixed version.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program saves an object it often turns it into a stream of bytes, and later turns those bytes back into an object; that second step is called deserialisation. If an attacker can supply those bytes, they may be able to craft them so that rebuilding the object also runs their own code. Here the caching component accepted such data without checking it, so anyone who could reach it could potentially run commands on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.