Skip to content
RCE Write-up Intermediate

Chaining Vulnerabilities To Achieve Remote Code Execution Rce

A directory with a URL-fetching feature was vulnerable to SSRF, allowing access to an internal development endpoint. That endpoint reflected a user-controlled parameter into a server-side template, enabling SSTI and remote code execution.

Josewice7 Follow

Published on systemweakness.com

Hey, I am W1C3, and today I will explain how, through chained vulnerabilities, we were able to achieve Remote Code Execution (RCE). In this challenge, we first used brute force techniques to discover directories that were previously unknown.

Josewice7, on systemweakness.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 URL-fetching feature lacked restrictions on internal addresses, and the internal page inserted user input into a server-side template without sanitisation.

Impact

An attacker could execute arbitrary commands on the server, leading to full remote code execution.

What the attacker needed

Access to the web application; ability to send requests to the URL-fetching feature

The fix

The developer should validate and filter user input, restrict access to internal resources, and sanitise server-side templates.

How it was found

  1. Enumerate directories to find the Browser directory.
  2. Use the URL-fetching feature to access the internal /dev endpoint by including the correct port.
  3. Fuzz parameters to find one that is reflected on the page.
  4. Test for SSTI by submitting a template expression that evaluates to 49.
  5. Enumerate subclasses to find subprocess.Popen and execute a command.

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 website had a feature that fetched a URL you gave it, but it did not check where it was fetching from, so it could be tricked into contacting internal servers. One internal page put your input directly into a template, and the template engine ran it as code, letting the attacker 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 Josewice7

View all

4 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.