The root cause of the vulnerability is the deserialization of untrusted data using pickle, which can lead to remote code execution. The langgraph-checkpoint library's BaseCache class used JsonPlusSerializer with pickle_fallback=True as its default serializer. When an application enables a cache backend that inherits from BaseCache (e.g., InMemoryCache, RedisCache), this insecure default is active.
An attacker with write access to the cache backend could store a malicious pickle payload. When the LangGraph application attempts to retrieve this data from the cache, the JsonPlusSerializer.loads_typed method would be invoked. This method would identify the payload as a pickle object and use pickle.loads to deserialize it, resulting in arbitrary code execution in the context of the LangGraph process.
The vulnerability is fixed in langgraph-checkpoint>=4.0.0 by changing the default setting in BaseCache to JsonPlusSerializer(pickle_fallback=False), thus disabling the dangerous fallback to pickle.