Skip to content
RCE Write-up Advanced

Critical Remote Code Execution via Insecure Deserialization in Cu

A proprietary Java sync service on a non-standard port deserialised untrusted Java objects without class filtering, allowing an unauthenticated attacker to execute arbitrary code as root. The attacker could then use mounted cloud credentials to read and write production storage buckets.

T4nv1 Follow

Published on medium.com

While performing an unauthenticated perimeter assessment on a major enterprise cloud infrastructure platform (cloud-storage.target.com), I identified a proprietary binary service listening on non-standard port 9090.

T4nv1, 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

The service passed attacker-controlled bytes directly into Java's ObjectInputStream.readObject() without an ObjectInputFilter or any class allow-list, so gadget classes on the classpath were instantiated and executed during deserialisation.

Impact

An unauthenticated attacker could run commands as root inside the sync container and, through mounted cloud credentials, read and write production storage buckets holding customer files.

What the attacker needed

Network access to port 9090; no authentication required; Clojure library on the classpath

The fix

The service should apply a strict ObjectInputFilter allow-list before reading objects, migrate away from native Java serialisation to a safe format such as protobuf or schema-validated JSON, and bind internal sync services to private interfaces.

How it was found

  1. Scan the host and observe the Java serialisation magic bytes in the error response.
  2. Extract the daemon jar from a publicly exposed staging container and decompile the socket handler.
  3. Identify the 4-byte magic header and the 1-byte packet type that reaches ObjectInputStream.
  4. Review the classpath and find the Clojure library, then build a gadget chain for it.
  5. Wrap the serialised gadget in the protocol header and send it to the service.
  6. Observe an outbound callback from the target running as root.

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.

Java can turn a stream of bytes back into live objects, and some objects run code when they are rebuilt. If a server rebuilds objects sent by anyone on the internet without checking which classes are allowed, an attacker can send a crafted object that runs their command. Here that command ran as the root user, the most powerful account on the machine.

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 T4nv1

View all

113 more disclosed reports, 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.