Latest News:
v1.2.1 Release Date is Sunday August 31st
on August 27, 2008, 08:52:45 PM [View]
Welcome, Guest. Please login or register.
August 28, 2008, 08:54:26 AM
Show Unread Posts | View Replies to Your Posts


Login with username, password and session length
cpCommerce Support  |  Version 1.x.x  |  Bug Reports  |  Resolved  |  Topic: SQL injection, admin password and email address vulnerability 0 Members and 1 Guest are viewing this topic.
Pages: [1] Send this topic Print
Author Topic: SQL injection, admin password and email address vulnerability  (Read 1934 times)
9902468
Junior Member
*
Offline Offline

Posts: 3


View Profile
« on: May 27, 2007, 03:49:29 AM »

Hi, just red this at Secunias site:

http://secunia.com/advisories/25412/

Seems that we have a problem. Well, no not really as here is the solution:

_dbquery.php, function sql_query($query), add this function to top to disallow ALL union queries. (None found from the system.)

Code:
      if(strpos(strtolower($query), "union") > 0 ){
            die ("Sql error.");
      }

To be on the safe side add these also. (Dies if the id is not numeric.)
product.main.php
Code:
  if( isset($_GET['id_product']) && !is_numeric($_GET['id_product']) ){
  die("Invalid product.");
  }

category.main.php
Code:
  if( isset($_GET['id_category']) && !is_numeric($_GET['id_category']) ){
  die("Invalid category.");
  }

Ofcourse, these checks should be added to every single primary key load, as the key is always number.
Hopefully cpCommerce is little safer again.

 - 99

Report to moderator   Logged
tinpalace
Junior Member
*
Offline Offline

Posts: 2


View Profile
« Reply #1 on: June 27, 2007, 08:42:25 AM »

My site was hacked today JUNE 27/07

Garbage text has been inserted into various fields in the DB. In process of resolving.

I'm sure the hackers visit this forum to get gratification for their mayhem.

Thank you for the code above. I am hoping that CPCommerce incorporates this into a release rather then every user having to make these changes themselves since I imagine that if we make these changes ourselves it will be harder to update with the next release.

______________

I am running v1.0.7.3 - Does anyone know if the above issue is addressed in 1.1.0 - thanks!!!
« Last Edit: June 27, 2007, 09:26:20 AM by tinpalace » Report to moderator   Logged
cpradio
Administrator
Scholarly Member
*****
Offline Offline

Posts: 4021


cpradio


View Profile
« Reply #2 on: June 21, 2008, 04:08:57 PM »

This is completed in v1.2.0
Report to moderator   Logged
Pages: [1] Send this topic Print 
cpCommerce Support  |  Version 1.x.x  |  Bug Reports  |  Resolved  |  Topic: SQL injection, admin password and email address vulnerability
Jump to:  

Related Topics
Subject Started by Replies Views Last post
problem in create a subproduct mrdmsw 3 697 November 26, 2005, 11:40:49 AM
by mrdmsw
Modify Product Extra option sets softnow 10 748 January 04, 2006, 11:00:19 PM
by cpradio
Advanced Search error photofx 2 352 January 05, 2007, 05:34:25 PM
by cpradio
Error When Installing " No Such File or Directory.." caveman 7 744 July 11, 2007, 07:54:22 AM
by photofx
Problem when reloading marwol 7 604 January 31, 2007, 04:25:16 PM
by cpradio

Powered by MySQL Powered by PHP cpCommerce Support | Powered by SMF 1.1.
© 2004, Simple Machines LLC. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!