Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2010
    Posts
    154
    Plugin Contributions
    0

    Idea or Suggestion [N/A] /includes/modules/new_products.php (and others) errors

    This might be minor, or irrelevant, but I thought I'd report it incase it offers some injection hacks.

    Zen Cart 1.3.8a
    Patch: 1::
    Database Patch Level: 1.3.8
    v1.3.8 [2010-02-15 20:00:16] (Fresh Installation)

    All security patches, etc. have been applied. I made an error in patching new_products.php which meant I've just inserted an error_reporting(E_ALL); into it to fix it (which I did).

    However, while I had error reporting on, I noticed the following warnings:

    Notice: Undefined index: music_genre_id in E:\wamp\www\rawrocks\public_html\zenrocks\includes\modules\zr_basic\new_products .php on line 22

    Notice: Undefined index: record_company_id in E:\wamp\www\rawrocks\public_html\zenrocks\includes\modules\zr_basic\new_products .php on line 22

    along with...

    Notice: Undefined index: music_genre_id in E:\wamp\www\rawrocks\public_html\zenrocks\includes\modules\featured_products.php on line 21

    Notice: Undefined index: record_company_id in E:\wamp\www\rawrocks\public_html\zenrocks\includes\modules\featured_products.php on line 21

    Notice: Undefined index: music_genre_id in E:\wamp\www\rawrocks\public_html\zenrocks\includes\modules\specials_index.php on line 21

    Notice: Undefined index: record_company_id in E:\wamp\www\rawrocks\public_html\zenrocks\includes\modules\specials_index.php on line 21

    Notice: Undefined index: music_genre_id in E:\wamp\www\rawrocks\public_html\zenrocks\includes\modules\upcoming_products.php on line 24

    Notice: Undefined index: record_company_id in E:\wamp\www\rawrocks\public_html\zenrocks\includes\modules\upcoming_products.php on line 24

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: /includes/modules/new_products.php (and others) errors

    Quote Originally Posted by Celtic View Post
    incase it offers some injection hacks.
    Please explain why you're led to believe that these could be related to injection hacks.
    .

    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
    Feb 2010
    Posts
    154
    Plugin Contributions
    0

    Default Re: /includes/modules/new_products.php (and others) errors

    DrByte,

    The $GET values themselves in the reported lines appear to be expected direct from the $GET stream, and as they are not (in the lines noted) being escaped in any way then they might offer injection opportunities.

    It could well be that by the time zenCart processes these lines that the $GET's have already been adequately escaped, but I don't know enough about the structure of ZenCart coding yet to know if that is the case, so I thought I'd mention it.

    The warnings were due to $GET values not being present, so I guess they need to be checked prior to attempting to read them at the very least.

    PS. Oops, I should have removed the local paths from above before posting it to make it clearer which files were being reported.
    Last edited by Celtic; 22 Feb 2010 at 01:02 PM.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: /includes/modules/new_products.php (and others) errors

    1. $_GET is already sanitized.

    2. "Notice" messages are just that: notices. They will show up when coding assumes the presence of certain variables, even if they're not defined. When not defined, their value is treated as blank. Slightly more efficient coding would first check that the variable exists before checking its value. And that's something the developers have been doing as a matter of course in the upcoming v2.0. But the existence of "Notice" messages is almost always safe to ignore, unless it's happening in new code you're writing yourself and you're doing personal debugging.

    There is no security threat in the content you reported.
    .

    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.

  5. #5
    Join Date
    Feb 2010
    Posts
    154
    Plugin Contributions
    0

    Default Re: /includes/modules/new_products.php (and others) errors

    Quote Originally Posted by DrByte View Post
    There is no security threat in the content you reported.
    Cheers DrB, good to know.

 

 

Similar Threads

  1. v151 override \includes\modules\pages\shopping_cart\header.php.php??
    By tlyczko in forum General Questions
    Replies: 7
    Last Post: 27 Nov 2012, 06:12 PM
  2. v150 PHP Fatal error: Out of memory in includes/modules/attributes.php
    By donnyb in forum General Questions
    Replies: 0
    Last Post: 6 Apr 2012, 12:15 AM
  3. Problems with includes/config.php and admin/includes.php
    By Scott83 in forum Basic Configuration
    Replies: 2
    Last Post: 23 Oct 2009, 07:09 PM
  4. new_products.php - replacing $new_products->fields['products_name'] with manufacturer
    By limelites in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 15 Mar 2009, 10:18 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR