Forums / Zen Cart Release Announcements / XSS protection patch - Nov 30 2009

XSS protection patch - Nov 30 2009

Locked

Started by drbyte on 30 Nov 2009, 10:14 PM · Views: 24,822

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
30 Nov 2009, 10:14 PM
#1
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

XSS protection patch - Nov 30 2009

While XSS or CSRF attacks are difficult to trigger and may not manifest very often, it is still important to protect against the ill effects which could be caused by them.

As such, the following XSS patches are advised in order to protect yourself from a recently-reported vulnerability:

The following edits should be made to the respective files.
THESE UPDATES APPLY TO ALL VERSIONS OF ZEN CART UP TO (& including)v1.3.8a (although line numbers may vary)

NOTE: These updates should be made EVEN if you've renamed your admin folder. (Merely renaming your admin folder will NOT protect you from XSS issues.)

**/admin/index.php
**Add the new lines shown, around approx line 135:```
while (!$customers->EOF) {
[B] $customers->fields['customers_firstname'] = zen_output_string_protected($customers->fields['customers_firstname']);
$customers->fields['customers_lastname'] = zen_output_string_protected($customers->fields['customers_lastname']);
[/B]
echo ' <div class="row"><span class="left"><a href="' . zen_href_link(FILENAME_CUSTOMERS ....[I](code snipped here for brevity)[/I]........


**/admin/customers.php
**Add the new line shown, around approx line 1173:```
    default:
      if (isset($cInfo) && is_object($cInfo)) {
[B]        if (isset($_GET['search'])) $_GET['search'] = zen_output_string_protected($_GET['search']);[/B]
        $customers_orders = $db->Execute("select o.orders_id, o.date_purchased, o.order_total, o.currency, o.currency_value,

/admin/sqlpatch.php* (ONLY relevant for v1.3.5 to (including) v1.3.8a)*
Add the "(bool)" as shown here on line 808:```

<?php if (isset($_GET['nogrants'])) echo '<input type="hidden" id="nogrants" name="nogrants" value="'.[B](bool)[/B]$_GET['nogrants'].'" />'; ?>

*
Thanks to Pedro Joaquín at webvuln for the alert.*

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.