Insecure Deserialization → RCE
The application stored a serialised Python pickle object in a cookie, and the attacker could modify the serialised data to change their role from user to admin. By crafting a malicious pickle payload, the attacker achieved remote code execution on the Windows server.
medium.com
Published on medium.com
This is stored in the cookies, and the reverse process is called deserialization.
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 deserialised a user-controlled cookie using Python's pickle module without any integrity check or validation.
Impact
An attacker could escalate privileges from a normal user to admin and execute arbitrary commands on the server, leading to remote code execution.
What the attacker needed
A free account; ability to intercept and modify cookies
The fix
The application should never deserialise untrusted data; it should use a safe format like JSON and enforce strict validation.
How it was found
- Register an account and capture the request in Burp.
- Confirm the application uses pickle by running a detection script on the cookie value.
- Decode the cookie to see the serialised data.
- Modify the serialised data to change the role to admin.
- Inject the tampered cookie.
- Run a Python script that executes Windows commands and stores output in a file.
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.
Serialisation turns an object into a format that can be stored or sent, like a cookie. If a website trusts that data without checking it, an attacker can change it or make it run harmful code. Here the cookie held a Python pickle, and the attacker replaced it with one that ran 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.