Skip to content
RCE Write-up Intermediate

Mantis Bug Tracker <= 1.1.3 (utility_api.php) PHP Code Injection Vulnerability

Mantis Bug Tracker before 1.1.4 passed a user-supplied sort parameter into PHP's create_function() inside multi_sort(), so the parameter was treated as PHP code. A remote authenticated user could therefore execute arbitrary code on the server.

karmainsecurity.com

Published on karmainsecurity.com

manageprojpage.php in Mantis before 1.1.4 allows remote authenticated users to execute arbitrary code via a sort parameter containing PHP sequences, which are processed by createfunction() within the multisort() function in core/utilityapi.php.

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 input for the sort parameter was concatenated into a string passed to create_function(), which evaluates its body as PHP code instead of treating it as data.

Impact

An authenticated attacker could execute arbitrary code on the server, potentially leading to full compromise.

What the attacker needed

A valid Mantis account; access to the project management page

The fix

The issue was fixed in Mantis 1.1.4, likely by no longer passing user input into create_function().

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 bug tracker let a logged-in user choose how a list was sorted. The sorting code built a small PHP function out of that choice without checking it, so a malicious choice could contain extra PHP instructions that the server then ran. That means a normal user account could take over 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.

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.