Skip to content
RCE Write-up Advanced

phpFox <= 4.8.13 (redirect) PHP Object Injection Vulnerability

The redirect route passed the user-supplied url parameter into PHP's unserialize() without sanitising it, so an unauthenticated attacker could inject arbitrary PHP objects. This could lead to a range of attacks, including execution of arbitrary PHP code.

karmainsecurity.com

Published on karmainsecurity.com

User input passed through the “url” request parameter to the /core/redirect route is not properly sanitized before being used in a call to the unserialize() PHP function. This can be exploited by remote, unauthenticated attackers to inject arbitrary PHP objects into the application scope, allowing them to perform a…

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

The application passed untrusted request input directly to PHP's unserialize() instead of using a safe format such as JSON or validating the value.

Impact

Remote, unauthenticated attackers could inject arbitrary PHP objects and potentially execute arbitrary PHP code, though the text does not demonstrate a working exploit chain.

What the attacker needed

No authentication required; reachable /core/redirect route

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.

PHP can turn a piece of text back into a live program object using a function called unserialize(). If a website feeds text from a visitor straight into that function, the visitor can choose which kind of object gets created, and some objects do dangerous things when they are created or cleaned up. Here an unauthenticated visitor could send a crafted value in the url parameter of the redirect page and potentially run their own PHP code 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.

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.