As a result of a
security vulnerability reported today, we are releasing the following patch instructions for anyone using Zen Cart v1.3.0, v1.3.0.1, v1.3.0.2:
It is strongly advised that you apply these fixes immediately!Make the following code edits to secure your site:---------------------------------------------
includes/application_top.phpline 83:
include($base_dir . $loader_file);
add this new line
immediately above it:$autoLoadConfig = array();
------------------------------------
includes/classes/shopping_cart.phpline 354:
set customers_basket_quantity = '" . $quantity . "'
should be replaced with:
set customers_basket_quantity = '" . (float)$quantity . "'
--------------------------------------
includes/modules/order_total/ot_coupon.phplines 104-108:
$coupon_result=$db->Execute("select coupon_id, coupon_amount, coupon_type, coupon_minimum_order,
uses_per_coupon, uses_per_user, restrict_to_products,
restrict_to_categories from " . TABLE_COUPONS . "
where coupon_code='". $_POST['dc_redeem_code']."'
and coupon_active='Y'");
should be replaced with:
$sql = "select coupon_id, coupon_amount, coupon_type, coupon_minimum_order, uses_per_coupon, uses_per_user,
restrict_to_products, restrict_to_categories
from " . TABLE_COUPONS . "
where coupon_code= :couponCodeEntered
and coupon_active='Y'";
$sql = $db->bindVars($sql, ':couponCodeEntered', $_POST['dc_redeem_code'], 'string');
$coupon_result=$db->Execute($sql);
-------------------------------
includes/modules/payment/paypal/paypal_functions.phpline 35:
$sql = "select * from " . TABLE_PAYPAL_SESSION . " where session_id = '" . $session_stuff[1] . "'";
should be replaced with these lines:
$sql = "SELECT *
FROM " . TABLE_PAYPAL_SESSION . "
WHERE session_id = :sessionID";
$sql = $db->bindVars($sql, ':sessionID', $session_stuff[1], 'string');
-------------------------------------
includes/functions/whos_online.php
(only applies to v1.3.0.2 ... if you don't have this line, then you don't have a full v1.3.0.2 install)line 101:
set session_id = '" . $new_session . "' WHERE session_id = '" . $old_session . "'";
should be replaced with these lines:
SET session_id = :newSessionID
WHERE session_id = :oldSessionID";
$sql = $db->bindVars($sql, ':newSessionID', $new_session, 'string');
$sql = $db->bindVars($sql, ':oldSessionID', $old_session, 'string');
-------------------------------
A new bugfix release will be published shortly and will contain these fixes.
It is strongly advised that you apply these fixes immediately!