Get the book

Go Back   Zen Cart Support > News and Announcements > Zen Cart Release Announcements

Zen Cart Release Announcements Watch this forum for new releases and other important announcements.
Click here to subscribe to these announcements.

Closed Thread
 
Thread Tools Display Modes
Old 20th September 2008, 04:51 AM   #1
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 44,025
Default Security Alert: SQL Injection Protection 2008-09-19

UPDATE TO Security Alert: SQL Injection Risk

On Aug 31 we posted an alert regarding an SQL Injection Vulnerability

Further code review has revealed that the proposed code fix was incomplete.
Also, the "fix" recommended previously was somewhat complicated to implement due to the need to edit PHP files in a few places.

As such, the following fix is recommended.

ALL v1.2.x and v1.3.x STORES SHOULD INSTALL THIS SIMPLE PATCH:

a) Download and unzip the attached file (shown in the next post, below).
b) Use your FTP program to upload the file to your /includes/extra_configures/ folder

That's all.
  • This one fix applies to both v1.2.x and v1.3.x
  • If you've already applied the Aug 31 patch updates, you need to make an edit to them, as documented in the next post below ... and you should still install the patch file.
  • If you haven't installed the Aug 31 update, you don't need to: just install the patch file below instead.


Thanks to Yuki Shida at zen-cart.jp for assistance in this discovery.
__________________
Zen Cart - putting the dream of business ownership within reach of anyone!

Last edited by DrByte; 23rd September 2008 at 08:33 PM. Reason: removed incorrect patch file ... use the one from the next post instead
DrByte is offline  
Old 23rd September 2008, 08:32 PM   #2
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 44,025
Default Re: Security Alert: SQL Injection Protection 2008-09-19

UPDATE:

Apparently the fixes from Aug 31 and Sept 19 (above) were a little over-enthusiastic , and can break functionality in two specific cases:
a) if you have checkbox-style attributes assigned to your products, they can't be added to your cart
b) if you have your store set to use fractional product quantities, the quantity was being handled wrong because it was disallowing the decimal point.

Thus, two adjustments are needed:

1. ** EVERYONE SHOULD DO THIS ** The attached patch file is an update to (and yes, is the *same* filename), and should replace, the one originally issued on Sept 19. After unzipping, it should be uploaded to /includes/extra_configures/
If you have not already uploaded this patch, you should do it now, using the attached file.

2. ** SOME SITES SHOULD DO THIS **
* If you have NOT already made the Aug 31 edits, you can ignore them and just use the attached patch file, installing it as described in the post above.

* If you *HAVE* already made the Aug 31 edits to /includes/classes/shopping_cart.php and you are using v1.3.x, you NEED to fix it as shown below:
Specifically, you will need to change the last line you edited, and add a "." inside the square brackets as shown:
Change from this:
Code:
          $prodId = ereg_replace('[^0-9a-f:]', '', $key);
to this:
Code:
          $prodId = ereg_replace('[^0-9a-f:.]', '', $key);


NOTE: These changes are not compatible with PHP 5.3. If using PHP 5.3, apply the PHP 5.3 patch AFTER making these changes.
Attached Files
File Type: zip security_patch_v138_20080919.php.zip (851 Bytes, 7839 views)
__________________
Zen Cart - putting the dream of business ownership within reach of anyone!

Last edited by DrByte; 24th September 2008 at 02:20 AM. Reason: corrected name of file: /includes/classes/shopping_cart.php
DrByte is offline  
Old 30th September 2008, 06:21 AM   #3
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 44,025
Default Re: Security Alert: SQL Injection Protection 2008-09-19

And ... for everyone who wonders ...

The "missing" ?> tag at the end of the file is intentional. See this related FAQ: http://tutorials.zen-cart.com/index.php?article=313
__________________
Zen Cart - putting the dream of business ownership within reach of anyone!
DrByte is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Security Alert: SQL Injection Risk Aug 31 DrByte Zen Cart Release Announcements 1 20th September 2008 04:53 AM
v1.3.5 Security Alert wilt Zen Cart Release Announcements 1 2nd October 2006 05:51 AM
Security Alert email sparktronic General Questions 3 18th August 2006 01:39 PM


All times are GMT +1. The time now is 04:11 PM.

Learn tips, tricks & secrets for your Zen Cart™
Sign up for our FREE Newsletter

Powered by vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content and Graphics Copyright (c) 2006, 2007, 2008, 2009, 2010 Zen Ventures, LLC - all rights reserved
Get Zen Cart E-Commerce Shopping Cart at SourceForge.net. Fast, secure and Free Open Source software downloads