How an Insecure Deserialization Flaw in a Cache Layer Triggered a
The application stored session data in Redis using Python pickle serialization, and an SSRF vulnerability allowed the attacker to inject a malicious pickle payload into the cache. When the application deserialized the poisoned session data, it executed arbitrary commands, leading to remote code execution on the production server.
When we talk about hunting for Remote Code Execution (RCE), we usually look at the file upload components or the main input fields of an API. But some of the most dangerous vulnerabilities hide in infrastructure components that users never interact with directly.
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application used Python's pickle to deserialize session data from an unauthenticated Redis cache that was reachable via SSRF, allowing arbitrary code execution.
What the attacker needed
SSRF vulnerability in avatar URL fetch; Redis unauthenticated on localhost; Valid session cookie
The fix
The company added password authentication and firewall rules to Redis, and replaced pickle with JSON for session storage.
How it was found
- Intercept a session-load request and observe the session cookie is a base64-encoded Python pickle object.
- Modify the cookie and confirm the signature is validated, blocking direct tampering.
- Discover an SSRF in the avatar URL fetch feature that can reach internal services on localhost.
- Use the SSRF to send raw Redis commands and overwrite the session key with a malicious pickle payload.
- Refresh the profile page with the original signed cookie to trigger deserialization and execute the payload.
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 write-up has not been written yet. The Original tab links to the source.
This report describes a chain of two bugs. First, a server-side request forgery (SSRF) let the attacker make the server talk to its own internal Redis cache. Second, that cache stored session data in a format called pickle, which can run code when loaded. By combining them, the attacker replaced their session data with a malicious pickle that executed 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.