Skip to content
RCE Write-up Advanced

SugarCRM <= 9.0.1 Multiple Phar Deserialization Vulnerabilities

The backup_dir parameter in the Administration module's Backups action was not sanitised before being used in a file operation, allowing PHP object injection through the phar:// stream wrapper. A malicious authenticated user could inject arbitrary PHP objects and potentially execute arbitrary PHP code.

karmainsecurity.com

Published on karmainsecurity.com

https://support.sugarcrm.com/Documentation/SugarVersions/9.0/Ent/Sugar9.0.2ReleaseNotes

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 backup_dir parameter is concatenated into a file path used with a stream wrapper without validation, so a phar:// path causes PHP to unserialise attacker-controlled metadata.

Impact

A malicious authenticated user could inject arbitrary PHP objects and carry out a variety of attacks, such as executing arbitrary PHP code.

What the attacker needed

Authenticated user with admin access; ability to place a crafted file on the server

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 store objects (bundles of data and code) inside special files, and when a program opens such a file it may automatically rebuild those objects. If an attacker can control part of a file path, they can point the program at a file they uploaded and have their own object rebuilt inside the application. That object can then trigger other code, which is why this can lead to running commands 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.