Skip to content
RCE Write-up Intermediate

How customer collaboration during a pentest can lead to finding a Remote Code Execution (RCE)

The application removed script tags non-recursively, allowing a self-XSS that could be turned into stored XSS via an IDOR to affect all users. Separately, an out-of-scope Atlassian Bamboo instance running a vulnerable Struts2 version allowed remote command execution through crafted HTTP headers.

blog.cobalt.io

Published on blog.cobalt.io

I was asked to share a blog post about a Remote Code Execution vulnerability that I identified in a past pentest. Although I don’t think it’s anything too technically advanced, I do think that the process offers some good insights on the way we test at Cobalt, which is a collaborative approach with the Cobalt Core…

Rogerio Resende, on blog.cobalt.io

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 input sanitisation removed script tags only once, not repeatedly, and an outdated Struts2 version had a known remote code execution flaw.

Impact

An attacker could execute arbitrary commands on the server and run JavaScript in users' browsers, though the XSS required an IDOR to be exploited at scale.

What the attacker needed

Access to the application; an IDOR vulnerability to target other users; out-of-scope asset included with customer approval

How it was found

  1. Test XSS payloads and notice script tags are removed non-recursively.
  2. Craft a payload that after removal becomes a working script tag.
  3. Use an IDOR to apply the payload to other users' signatures.
  4. Discover an out-of-scope Atlassian Bamboo instance via nmap.
  5. Confirm with the customer to include the asset in scope.
  6. Run a Burp Active Scan with Active Scan++ to find a vulnerable Struts2 version.

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.

The application tried to block dangerous HTML tags but did so in a way that could be bypassed by nesting them, letting an attacker run their own JavaScript in other users' browsers. Also, an old server was found that had a known bug allowing an attacker to run commands on it.

What is RCE?

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

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.