Skip to content
RCE Write-up Advanced

SugarCRM <= 6.5.18 Two PHP Code Injection Vulnerabilities

The report claims that SugarCRM's array utility function builds PHP code strings from user-controlled array keys and values without escaping, allowing an attacker to inject PHP code. The text does not show a complete exploit path or confirm that the injected code is later executed.

karmainsecurity.com

Published on karmainsecurity.com

The overridevaluetostringrecursive2() function is being used to save an array into a configuration file with a .php extension. However, this function does not properly escape key names, and this can be exploited to inject and execute arbitrary PHP code through e.g. the following URL, which will write arbitrary 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-controlled array keys and values are concatenated into a PHP code string without escaping, so special characters can break out of the intended string context.

What the attacker needed

Ability to control array keys or values

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.

The application takes input from a user and pastes it into a piece of PHP code it builds as text. If that text is later run as code, the user's input could become instructions the server follows. The report only shows the function that builds the text, not the full route from user input to execution.

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.