Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    1

    SQL Injection Protection Escaping Queries

    What has SunShop done in the latest release to protect against SQL injections?

    Looking at the latest source code from SunShop. I'm not impressed with the direct calls to Globals in SQL queries. For example:
    Line 478 in global.php:
    PHP Code:
                $prod $DB_site->query_first("SELECT * FROM `".$dbprefix."orders_products` where `orderid`='".$_GET[oid]."' AND `productid`='".$_GET[pid]."'"); 
    Hrm, maybe we are escaping the queries in query_first()... Nope.
    PHP Code:
        function query_first($query_string) {
            
    $query_id $this->query($query_string);
            
    $returnarray $this->fetch_assoc($query_id$query_string);
            
    $this->free_result($query_id);
            return 
    $returnarray;
        } 
    So the million dollar question is: What is keeping an attacker from using this to their advantage?

  2. #2
    Join Date
    Aug 2006
    Location
    San Diego, CA
    Posts
    4,336
    All variables are cleaned in the libsecure.php file before that are used in any of the code. The libsecure.php is the first file called so everything passes through that file.
    Chris Talavera
    Turnkey Web Tools, Inc.
    chris{at}twt-inc.com
    1-800-673-4898

Similar Threads

  1. avail_to, what does this do for queries?
    By entee in forum Troubleshooting and Problems
    Replies: 2
    Last Post: 01-13-2012, 05:24 AM
  2. Customization related queries(help)
    By archunan in forum Services & For Sale
    Replies: 0
    Last Post: 11-30-2009, 09:10 PM
  3. Replies: 1
    Last Post: 02-05-2009, 03:45 PM
  4. PHP Injection Exploit issues
    By rcullet in forum Troubleshooting and Problems
    Replies: 8
    Last Post: 11-11-2008, 12:44 PM
  5. Paypal Check out protection
    By saw in forum General Discussion
    Replies: 2
    Last Post: 03-27-2006, 12:46 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
  •