CubeCart <= 5.2.0 (cubecart.class.php) PHP Object Injection Vulnerability

• Software Link:

• Affected Versions:

All versions from 5.0.0 to 5.2.0

• Vulnerability Description:

The vulnerable code is located in the Cubecart::_basket() method defined in the /classes/cubecart.class.php script:

		// Update shipping values
		if (isset($_POST['shipping']) && !empty($_POST['shipping'])) {
			$GLOBALS['cart']->set('shipping', unserialize(base64url_decode($_POST['shipping'])));
			if (!isset($_POST['proceed'])) {

User input passed through the $_POST['shipping'] parameter is not properly sanitized before being
used in an unserialize() call at line 521. This can be exploited to inject an arbitrary object into the
application scope. For e.g. the destructor method of the “Config” class could be abused:

	public function __destruct() {
		//Do we need to write to the db
		if ($this->_write_db) {

By sending a specially crafted serialized “Config” object, an attacker might be able to change the
application configuration settings with arbitrary values, and this can lead to make the application
vulnerable to malicious attacks such as Cross-Site Scripting, SQL Injection or Denial of Service.

• Solution:

Upgrade to version 5.2.1 or higher.

• Disclosure Timeline:

[27/01/2013] – Issue reported to
[31/01/2013] – Version 5.2.1 released:
[31/01/2013] – CVE number requested
[04/02/2013] – CVE number assigned
[06/02/2013] – Public disclosure

• CVE Reference:

The Common Vulnerabilities and Exposures project (
has assigned the name CVE-2013-1465 to this vulnerability.

• Credits:

Vulnerability discovered by Egidio Romano.