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

• Software Link:

• Affected Versions:

Version 6.5.23 CE and prior versions.

• Vulnerability Description:

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

	function serve(){
		$GLOBALS['log']->info('Begin: SugarRestSerialize->serve');
		$data = !empty($_REQUEST['rest_data'])? $_REQUEST['rest_data']: '';
		if(empty($_REQUEST['method']) || !method_exists($this->implementation, $_REQUEST['method'])){
			$er = new SoapError();
			$method = $_REQUEST['method'];
			$data = unserialize(from_html($data));
			if(!is_array($data))$data = array($data);
			$GLOBALS['log']->info('End: SugarRestSerialize->serve');

User input passed through the “rest_data” request parameter is not properly sanitized before being used in a call to the
“unserialize()” function at line 76. This can be exploited to inject arbitrary PHP objects into the application scope,
and could allow unauthenticated attackers to execute arbitrary PHP code via specially crafted serialized objects.

• Proof of Concept:

• Solution:

Update to version 6.5.24 CE or later to partially mitigate the vulnerability.

NOTE: version 6.5.23 CE includes a fix for this kind of vulnerability. However, the fix is not enough to prevent object injection attacks because the input validation check can be bypassed.

• Disclosure Timeline:

[12/06/2015] – Vendor notified
[09/03/2016] – Version 6.5.23 released along with a security advisory:
[13/05/2016] – Vendor notified about the ineffective fix
[17/06/2016] – CVE number requested
[23/06/2016] – Public disclosure
[21/07/2016] – Version 6.5.24 released along with a security advisory:
[07/09/2016] – Proof of concept published

• CVE Reference:

The Common Vulnerabilities and Exposures project (
has not assigned a CVE identifier for this vulnerability.

• Credits:

Vulnerability discovered by Egidio Romano.