Skip to content
RCE Write-up Advanced

Advanced Bug Bounty Write-Ups — Part 2: Deserialization, Mobile

The report describes a collection of fictional bug bounty write-ups, including a Java deserialization flaw where a legacy endpoint still accepts a serialized-object content type, and a Python pickle cookie that is trusted without a signature. In both cases a crafted serialized object could run code on the server, demonstrated only by writing a marker file.

LAWCY official Follow

Published on medium.com

POST /api/v1/legacy/import accepts application/json in the documented API, but the underlying Spring controller still has a commented-in (not removed) @RequestMapping consumes clause that also accepts application/x-java-serialized-object. Sending a serialized object with a known gadget chain (a maintained library…

LAWCY official, on medium.com

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 untrusted input (a legacy content type and an unsigned cookie) using unsafe native deserialisers that execute code during object reconstruction.

Impact

An attacker could run arbitrary code on the server, though the researcher stopped at a marker file rather than a reverse shell or persistence.

What the attacker needed

An authenticated test token; knowledge of dependency versions; ability to send crafted requests

The fix

The legacy content type should be removed and restricted to JSON only, the vulnerable dependency upgraded, a deserialisation filter added, and pickle replaced with a signed structured format.

How it was found

  1. Send a benign serialized string to the legacy import endpoint with the serialized-object content type and note the different error.
  2. Build a gadget-chain payload that writes a marker file to a temporary directory.
  3. Submit the payload to the same endpoint.
  4. Confirm execution by listing the temporary directory through a separate debug endpoint.
  5. For the second issue, decode the draft-state cookie and confirm it is raw pickle output.
  6. Replace the cookie with a crafted pickle payload and request the resume page to confirm the marker 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.

Some programs store data by turning an object into a stream of bytes and later turning it back into an object. If the program does that with data a user can supply, the user can shape the bytes so that rebuilding the object runs their own code. Here the site accepted such bytes from a normal request and from a cookie, so an attacker could 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.

More by LAWCY official

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.