OpenCart <= (cart.php) PHP Object Injection Vulnerability

Credit: Egidio Romano
Risk: High
Local: No
Remote: Yes
CWE: CWE-918

CVSS Base Score: 7.5/10
Impact Subscore: 6.4/10
Exploitability Subscore: 10/10
Exploit range: Remote
Attack complexity: Low
Authentication: No required
Confidentiality impact: Partial
Integrity impact: Partial
Availability impact: Partial

OpenCart <= (cart.php) PHP Object Injection Vulnerability &#8226; Software Link: &#8226; Affected Versions: Version and prior versions. &#8226; Vulnerability Description: The vulnerable code is located in the &#8220;Cart::getProducts()&#8221; method defined in /system/library/cart.php: foreach ($this->session->data['cart'] as $key => $quantity) { $product = explode(':', $key); $product_id = $product[0]; $stock = true; // Options if (!empty($product[1])) { $options = unserialize(base64_decode($product[1])); } else { $options = array(); } The vulnerability exists because this method uses the &#8220;unserialize()&#8221; function with the key values of the array stored into the &#8220;data[cart]&#8221; session variable without a proper validation. Such values might be manipulated by an unauthenticated attacker via the $_POST['quantity'] parameter during an &#8220;update&#8221; request. This can be exploited to inject arbitrary PHP objects into the application scope, and could allow an attacker to conduct Server-Side Request Forgery (SSRF) attacks by abusing the destructor method of the &#8220;DBMySQLi&#8220; class and possibly other attacks leveraging magic methods of classes defined in third-party extensions. NOTE: if OpenCart is running on PHP before version 5.3.23 or 5.4.13 this vulnerability could also be exploited to carry out XML External Entity (XXE) attacks, which in turn might allow arbitrary command execution if the PHP &#8220;expect&#8220; extension is installed. &#8226; Solution: Update to version when will be released or apply this patch: &#8226; Disclosure Timeline: [02/06/2014] &#8211; First attempt to contact the vendor [04/06/2014] &#8211; Issue reported to [06/06/2014] &#8211; CVE number requested [06/06/2014] &#8211; CVE number assigned [25/06/2014] &#8211; Vendor contacted again asking when will be released a fixed version [25/06/2014] &#8211; Vendor replied there&#8217;s no need to alert its users because the vulnerability is very weak [14/07/2014] &#8211; Public disclosure &#8226; CVE Reference: The Common Vulnerabilities and Exposures project ( has assigned the name CVE-2014-3990 to this vulnerability.


Vote for this issue:


Thanks for you vote!


Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.

(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2019,


Back to Top