Skip to content
RCE Write-up Intermediate

From “Info Disclosure” to Critical RCE: How I Turned Legacy C

The target ran an outdated WordPress version bundling a vulnerable PHPMailer library, and the library file was publicly reachable without WAF blocking. An attacker could inject sendmail arguments to write a PHP web shell and execute commands on the server.

Ujjwal Sharma Follow

Published on medium.com

In the world of bug bounty hunting, “Outdated Software” is often the most ignored finding. Scanners scream about it constantly, and triagers often mark it as “Informational” or “Low Severity” unless you can prove a specific impact.

Ujjwal Sharma, 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 bundled PHPMailer version did not sanitise the Sender email address, allowing argument injection into the sendmail command.

Impact

An attacker could achieve remote code execution as the web server user, read configuration files to steal database credentials, and pivot into the internal network; the text notes the tester did not execute the shell.

What the attacker needed

Outdated WordPress with vulnerable PHPMailer; vulnerable library file publicly reachable; no WAF blocking the request

The fix

The site should be updated to the latest WordPress branch, the WAF should block shell command separators and the -X flag, and public access to /wp-includes/ should be denied.

How it was found

  1. Inspect static asset version parameters to fingerprint WordPress 4.6.17.
  2. Identify that this version bundles PHPMailer below 5.2.18, which is vulnerable to argument injection.
  3. Probe the PHPMailer library file directly and observe an HTTP 200 response, confirming it is accessible and not blocked by a WAF.

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 site used an old version of WordPress that included a mail-sending component with a known flaw. That flaw lets someone sneak extra instructions into a system mail command, which can create a file on the website that runs code when opened. The tester confirmed the vulnerable file was reachable, making the risk real rather than theoretical.

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 Ujjwal Sharma

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.