Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2007
    Posts
    2,169
    Plugin Contributions
    16

    Default Security Alert question

    DrByte you said

    2. The following fix applies only to v1.3.0 thru v1.3.8a:

    Depending on what version, this section can be found around line 1650 up to line 1720:
    Simply change the $prodId= line to match what is shown below:

    function actionMultipleAddProduct($goto, $parameters) {
    global $messageStack;
    if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) {
    while ( list( $key, $val ) = each($_POST['products_id']) ) {
    if ($val > 0) {
    $adjust_max = false;
    $prodId = ereg_replace('[^0-9a-f:]', '', $key);
    $qty = $val;
    $add_max = zen_get_products_quantity_order_max($prodId);

    ...
    My question is around line 1720 in the /includes/classes/shopping_cart.php for v1.3.8a:This is the code you need for us to change, so does all the rest of the code stay in place like it is or what.

    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 = ereg_replace('[^0-9a-f:]', '', $key);
    $qty = $val;
    $add_max = zen_get_products_quantity_order_max($prodId);
    $cart_qty = $this->in_cart_mixed($prodId);
    // $new_qty = $qty;
    //echo 'I SEE actionMultipleAddProduct: ' . $prodId . '<br>';
    $new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart');


    Thank you in advance
    Is your site Upgraded to the current version 1.5.4 Yet?
    zencart-upgrades-website-installation

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Security Alert: SQL Injection Risk

    I said:
    Quote Originally Posted by DrByte
    Simply change the $prodId= line to match what is shown below


    Just change the one line. Don't touch anything else unless you want to make problems for yourself.
    .

    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.

  3. #3
    Join Date
    Jul 2007
    Posts
    2,169
    Plugin Contributions
    16

    Default Re: Security Alert question

    Thank you for clarifying that for me. I don't know why I did not get it the first time. I understand now. Thanks again.
    Is your site Upgraded to the current version 1.5.4 Yet?
    zencart-upgrades-website-installation

  4. #4
    Join Date
    Mar 2008
    Posts
    27
    Plugin Contributions
    0

    Default Re: Security Alert question

    I noticed that there is a difference in the code of shopping_cart.php between the post with the fix from Dr. Byte and what is shown in this example. For instance in Dr. Byte's post, the flisting from the final part of the shows as

    function actionMultipleAddProduct($goto, $parameters) {
    global $messageStack;
    if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) {
    while ( list( $key, $val ) = each($_POST['products_id']) ) {
    if ($val > 0) {
    $adjust_max = false;
    $prodId = ereg_replace('[^0-9a-f:]', '', $key);
    $qty = $val;
    $add_max = zen_get_products_quantity_order_max($prodId);
    Notice that the line containing 'while ( list ... ' is NOT commeted out.

    In my version of shopping_cart.php it looks like this

    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 = ereg_replace('[^0-9a-f:]', '', $key);
    $qty = $val;
    $add_max = zen_get_products_quantity_order_max($prodId);
    $cart_qty = $this->in_cart_mixed($prodId);
    // $new_qty = $qty;
    //echo 'I SEE actionMultipleAddProduct: ' . $prodId . '<br>';
    $new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart');
    Not only is the line containing 'while ( list....' commented out, there are also some extra lines.

    I am running 1.3.8a and the includes/classes/shopping_cart.php is dated 10/23/2007.

    When I apply the fix, I just get blank pages.

    What is the correct version of shopping_cart.php?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Security Alert question

    Just changing the one line mentioned should suffice, regardless what's around it.

    Perhaps your text editor is damaging the file?
    .

    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.

  6. #6
    Join Date
    Mar 2008
    Posts
    27
    Plugin Contributions
    0

    Default Re: Security Alert question

    Quote Originally Posted by DrByte View Post
    Just changing the one line mentioned should suffice, regardless what's around it.

    Perhaps your text editor is damaging the file?
    Well, I got it to work.

    I went back to the start and manually entered the various lines. Previously I had done a copy-paste on the $progID line in part 2 of the fix - this time I typed it in. I used the same text editor, PFE. Am guessing something got hosed when I did the copy-paste. Haven't had that happen before ;>

    Thanks for your help - I do appreciate it.

    Rich

 

 

Similar Threads

  1. v1.3.5 Security Alert
    By wilt in forum Zen Cart Release Announcements
    Replies: 1
    Last Post: 2 Oct 2006, 05:51 AM
  2. Security Alert email
    By sparktronic in forum General Questions
    Replies: 3
    Last Post: 18 Aug 2006, 01:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg