exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

zencart138a-sql.txt

zencart138a-sql.txt
Posted Sep 4, 2008
Authored by James Bercegay | Site gulftech.org

Zen Cart versions 1.3.8a and below suffer from a remote SQL injection vulnerability.

tags | exploit, remote, sql injection
SHA-256 | be50c144a7bb9397136e61ebc33e8a71f17305cf9da35b26ea43ff0369df72ee

zencart138a-sql.txt

Change Mirror Download
##########################################################
# GulfTech Security Research September 04, 2008
##########################################################
# Vendor : Zen Ventures, LLC
# URL : http://www.zen-cart.com
# Version : Zen Cart <= 1.3.8a
# Risk : SQL Injection
##########################################################


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



Related Info:
The original advisory can be found at the following location
http://www.gulftech.org/?node=research&article_id=00129-09042008
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close