CVE-2008-6985 : Detail

CVE-2008-6985

SQL Injection
A03-Injection
0.72%V3
Network
2009-08-18
08h00 +00:00
2018-10-11
17h57 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

Multiple SQL injection vulnerabilities in includes/classes/shopping_cart.php in Zen Cart 1.2.0 through 1.3.8a, when magic_quotes_gpc is disabled, allow remote attackers to execute arbitrary SQL commands via the id parameter when (1) adding or (2) updating the shopping cart.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.

Metrics

Metrics Score Severity CVSS Vector Source
V2 6.8 AV:N/AC:M/Au:N/C:P/I:P/A:P [email protected]

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 43436

Publication date : 2008-09-03 22h00 +00:00
Author : GulfTech Security
EDB Verified : No

Zen Cart SQL Injection Vendor: Zen Ventures, LLC Product: Zen Cart Version: <= 1.3.8a Website: http://www.zen-cart.com BID: 31023 CVE: CVE-2008-6985 OSVDB: 48346 SECUNIA: 31758 PACKETSTORM: 69640 Description: Zen Cart is a full featured open source ecommerce web application written in php that allows users to build, run and promote their own online store. Unfortunately there are multiple SQL Injection issues in Zen Cart that may allow an attacker to execute arbitrary SQL queries on the underlying database. This may allow for an attacker to gather username and password information, among other things. An updated version of Zen Cart has been released to address these issues and users are encouraged to upgrade as soon as possible. SQL Injection There are a couple of SQL Injection issues within Zen Cart that may allow for a malicious attacker to execute arbitrary SQL queries, and gather arbitrary data from the database. The first issue is due to product attribute values not being properly sanitized (particularly the value of certain "id" parameters) when adding to or updating the shopping cart. The queries that are vulnerable to SQL injection can either be an update query, or an insert query depending on current shopping cart state and whether or not the customer is logged in. However, Zen Cart installations running with a database that supports sub selects are vulnerable to exploitation. Otherwise the issue is limited in regards to it's ability to be exploited. function actionMultipleAddProduct($goto, $parameters) { global $messageStack; if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) { foreach($_POST['products_id'] as $key=>$val) { // while ( list( $key, $val ) = each($_POST['products_id']) ) { if ($val > 0) { $adjust_max = false; $prodId = $key; $qty = $val; $add_max = zen_get_products_quantity_order_max($prodId); $cart_qty = $this->in_cart_mixed($prodId); The above code comes from the actionMultipleAddProduct function in the shopping_cart class, and unlike the first issue I discussed introduces a highly exploitable SQL Injection issue in to Zen Cart. The root of the problem is that the in_cart_mixed function uses $prodId in a query without any sanitation. products_id[-99' UNION SELECT IF(SUBSTRING(admin_pass,1, 1) = CHAR(97), BENCHMARK (1000000, MD5(CHAR(1))), null),2 FROM zencart_admin/*] It's possible for an attacker to submit a request to the "multiple_products_add_product" action with a products_id like the one above (remember to set the value to one if you wish to test this) and successfully enumerate database contents based on query response time. Of course other attacks may be possible also depending on server configuration. For example, if an attacker select INTO OUTFILE then this issue can allow for remote php code execution. Solution: The Zen Cart developers were very prompt and professional in releasing a fix for the previously mentioned issues. An updated version, as well as patches can be found at the following location. http://www.zen-cart.com/forum/showthread.php?p=604473 Credits: James Bercegay of the GulfTech Security Research Team

Products Mentioned

Configuraton 0

Zen-cart>>Zen_cart >> Version 1.2.0d

Zen-cart>>Zen_cart >> Version 1.2.1_patch1

    Zen-cart>>Zen_cart >> Version 1.2.1d

    Zen-cart>>Zen_cart >> Version 1.2.2d

    Zen-cart>>Zen_cart >> Version 1.2.3d

    Zen-cart>>Zen_cart >> Version 1.2.4.1

    Zen-cart>>Zen_cart >> Version 1.2.4d

    Zen-cart>>Zen_cart >> Version 1.2.5d

    Zen-cart>>Zen_cart >> Version 1.2.6d

    Zen-cart>>Zen_cart >> Version 1.3

    Zen-cart>>Zen_cart >> Version 1.3.2

    Zen-cart>>Zen_cart >> Version 1.3.5

    Zen-cart>>Zen_cart >> Version 1.3.6

    Zen-cart>>Zen_cart >> Version 1.3.7

    Zen-cart>>Zen_cart >> Version 1.3.8

    Zen-cart>>Zen_cart >> Version 1.3.8a

    References

    http://secunia.com/advisories/31758
    Tags : third-party-advisory, x_refsource_SECUNIA
    http://www.securityfocus.com/bid/31023
    Tags : vdb-entry, x_refsource_BID
    http://www.osvdb.org/48346
    Tags : vdb-entry, x_refsource_OSVDB