Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:31275
HistoryOct 16, 2014 - 12:00 a.m.

[KIS-2014-08] OpenCart <= 1.5.6.4 (cart.php) PHP Object Injection Vulnerability

2014-10-1600:00:00
vulners.com
87

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

[-] Software Link:

http://www.opencart.com/

[-] Affected Versions:

Version 1.5.6.4 and prior versions.

[-] Vulnerability Description:

The vulnerable code is located in the "Cart::getProducts()" method defined in /system/library/cart.php:

  1. foreach &#40;$this-&gt;session-&gt;data[&#39;cart&#39;] as $key =&gt; $quantity&#41; {
    
  2. 	$product = explode&#40;&#39;:&#39;, $key&#41;;
    
  3. 	$product_id = $product[0];
    
  4. 	$stock = true;
    
  5. 	// Options
    
  6. 	if &#40;!empty&#40;$product[1]&#41;&#41; {
    
  7. 		$options = unserialize&#40;base64_decode&#40;$product[1]&#41;&#41;;
    
  8. 	} else {
    
  9. 		$options = array&#40;&#41;;
    
  10. 	}
    

The vulnerability exists because this method uses the "unserialize()" function with the key values of the
array stored into the "data['cart']" session variable without a proper validation. Such values might be
manipulated by an unauthenticated attacker via the $_POST['quantity'] parameter during an "update" 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 "DBMySQLi"
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 "expect" extension is installed.

[-] Solution:

Update to version 1.5.6.5 when will be released or apply this patch: http://git.io/F3dGoA

[-] Disclosure Timeline:

[02/06/2014] - First attempt to contact the vendor
[04/06/2014] - Issue reported to http://git.io/uOsKfA
[06/06/2014] - CVE number requested
[06/06/2014] - CVE number assigned
[25/06/2014] - Vendor contacted again asking when will be released a fixed version
[25/06/2014] - Vendor replied there's no need to alert its users because the vulnerability is very weak
[14/07/2014] - Public disclosure

[-] CVE Reference:

The Common Vulnerabilities and Exposures project (cve.mitre.org)
has assigned the name CVE-2014-3990 to this vulnerability.

[-] Credits:

Vulnerability discovered by Egidio Romano.

[-] Original Advisory:

http://karmainsecurity.com/KIS-2014-08

Related for SECURITYVULNS:DOC:31275