Skip to content
RCE Write-up Intermediate

Sharetronix <= 3.1.1 Two PHP Code Injection Vulnerabilities

Two POST parameters, activities_text and comments_text, are passed unsanitised into preg_replace() with the e modifier, which evaluates the replacement as PHP code. An attacker could inject and execute arbitrary PHP code on the server.

karmainsecurity.com

Published on karmainsecurity.com

[06/11/2013] – Vendor response stating “Please immediately cease and desist all such communications”

The author, on karmainsecurity.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 user-controlled input reaches preg_replace() with the e modifier, which evaluates the replacement string as PHP code.

What the attacker needed

Ability to send POST requests to the affected endpoints

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 takes text a user submits and feeds it into a PHP function that treats part of the input as code to run. Because the input is not cleaned first, someone can slip in their own PHP commands and the server will execute them.

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.