Skip to content
RCE Write-up Intermediate

Php-Stats 0.1.9.2 Multiple PHP Code Injection Vulnerabilities

Several files in Php-Stats [redacted] pass the php-stats-options record from the _options table into an eval call, so an authenticated administrator can store PHP code there and have it executed. The text notes this was demonstrated by altering _options through a backup restore action in admin.php.

karmainsecurity.com

Published on karmainsecurity.com

Multiple eval injection vulnerabilities in Php-Stats 0.1.9.2 allow remote authenticated administrators to execute arbitrary code by writing PHP sequences to the php-stats-options record in the options table, which is used in an eval function call by (1) admin.php, (2) click.php, (3) download.php, and unspecified other…

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 the application stores configuration values in the database and later passes them directly to eval, so any value written there is executed as PHP code.

Impact

An authenticated administrator could execute arbitrary code on the server, though the text does not describe any way for a lower-privileged user to do so.

What the attacker needed

Administrator account on Php-Stats

How it was found

  1. Log in as an administrator.
  2. Use the backup restore action in admin.php to modify the php-stats-options record in the _options table.
  3. Write PHP code into that record.
  4. Trigger one of the affected pages so the stored value reaches the eval call.

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.

This software keeps some of its settings in a database table. Instead of treating those settings as plain text, it hands them to a PHP feature that runs whatever code it is given. Because an admin can change those settings, they can slip in their own code and the server will run 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.