Skip to content
RCE Write-up Advanced

SugarCRM <= 6.5.23 (SugarRestSerialize.php) PHP Object Injection Vulnerability

The SugarRestSerialize REST endpoint passes the rest_data request parameter into PHP's unserialize() without proper sanitisation. An attacker could send a crafted serialised object to trigger PHP object injection, which may lead to further exploitation depending on available gadget chains.

karmainsecurity.com

Published on karmainsecurity.com

The vulnerable code is located in the /service/core/REST/SugarRestSerialize.php script:

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 calls unserialize() on user-controlled input from the rest_data parameter without validating or restricting the allowed classes.

What the attacker needed

Network access to the REST endpoint; a valid method name in the request

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 object using a function called unserialize. If a website lets a visitor supply that text, the visitor can choose which object gets built, and some objects do dangerous things when they are created or destroyed. Here the REST endpoint takes the visitor's text and unserialises it directly, so a malicious visitor can inject their own object.

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.