close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Security Issues

Thread began 5/24/2010 12:56 am by tyler815351411 | Last modified 9/06/2011 12:34 pm by Jason Byrnes | 3348 views | 9 replies |

tyler815351411

Security Issues

Hi,

I have used all your web assist products for a while now and think there great. I have problem with the Power Store.

I have produced an ecommerce website using power store, but my customer wanted to added macfee onto the website. But this program has found several possible security issues.

Description

During our analysis of your web application, we were able to intentionally generate database specific errors. By causing a system to output errors such as these, it is often possible to determine the database version and inject database command syntax that would allow us to extract data.

The information gathered from the specific error responses generated using various input validation techniques by the web application scanner has determined the remote host may be running a MySQL database.

The extent of the damage that can be caused by this vulnerability varies greatly depending on environment and configuration. While input validation via webapp may cause a database to generate an error, the database configuration will also play an important role in determining how much it can be altered. A remote attacker may be able to gain access to very sensitive information, or gain administrative access.

General Solution

THE SINGLE BEST WAY TO FIX THIS VULNERABILITY IS TO IDENTIFY THE ACCEPTABLE INPUT FOR EACH FORM PARAMETER AND REJECT INPUT THAT DOES NOT MEET THAT CRITERIA.

The following is an acceptable solution however it is not optimal.

Implement content parsing on data input fields including URL parameters.

Remove the following characters from any user or dynamic database input: (examples in VBScript)
• ' (escape the single quote) input = replace( input, "'", "''" )
• " (double quote) input = replace( input, """", "" )
• ) (close parenthesis) input = replace( input, ")", "" )
• ( (open parenthesis) input = replace( input, "(", "" )
• ; (semi-colon) input = replace( input, ";", "" )
• - (dash) input = replace( input, "-", "" )
• | (pipe) input = replace( input, "|", "" )
On text input it is recommended to append quotes around the user supplied input.

Please contact ScanAlert Support if you need further instructions.


Is this something I have to worry about?

And would you make the changes they are advising?

Kind Regards

Brian

Sign in to reply to this post

Eric Mittman

Was there any more specific information that was included in the report that was generated? I know that throughout the site in the code there is use of the 'or die(mysql_error())'. This code will print out a mysql error if an error occurs with the query. In this error it is mentioned that the query is a MySQL query.

Since it was not determined how the vulnerability was found I'm not sure if this is what is being referred to but it sounds like it would match. If this is the case you could test it out by making a backup of your site first, then do a site wide find and replace for:

php:
or die(mysql_error())



and remove the mysql_error() so that it is like this:

php:
or die()



If you can run this check on the updated version of the powerstore and do not get this issue then it would indicate that this is the problem. The bad thing about removing this is that you will not get an error if one occurs within the sql on the site.

Sign in to reply to this post

tyler815351411

Report Attached

Hi,

Not sure if this is any help, but I have attached the report (copied from word and pasted into notepad to make file smaller.

Kind Regards

brian

Sign in to reply to this post

Eric Mittman

Thanks for getting back with that. I'm not an expert at reviewing these types of reports but from what I can see the issues it is referring to are MySQL errors. It looks like these are being considered errors based on the assumption that divulging the type and version of you database server can present a vulnerability for the site. I'm not so sure that I agree with this assumption but that is what it is saying.

Since the report seems to only be referring to MySQL errors that are occurring you could overcome this by removing the mysql_error() from within the die statements after the queries. You should make a backup of the site first, then update it by doing a site wide find and replace for the following values:

find:

php:
die(mysql_error())



replace with:

php:
die()



Making this change will cause the page to stop processing at this point and not return any type of error if an error occurs.

Sign in to reply to this post

Eric Mittman

I have been informed by a colleague who has looked into this that the specific problem that was causing the MySQL type of errors to occur can be addressed with a code update to the page.

On the products results page update the code that is on lines 75-91

from this:

php:
<?php

if ( isset($_GET["Search"]))  {
  
$_SESSION["WADbSearch1_Products_Cat"]="";
  if (isset(
$_GET["ProductCategoryID"]))  {
    if (
$WADbSearch1->whereClause != "")  {
      
$WADbSearch1->whereClause .= " AND ";
    } else  {
      
$WADbSearch1->whereClause .= " WHERE ";
    }
    
$WADbSearch1->whereClause .= "ProductID IN (SELECT ProductID FROM ps3_productcategories WHERE (CategoryID = ".implode($_GET["ProductCategoryID"]," OR CategoryID = ")."))";
    
$_SESSION["WADbSearch1_Products_Results"]=$WADbSearch1->whereClause;
    if (
sizeof($_GET["ProductCategoryID"]) == 1)  {
      
$_SESSION["WADbSearch1_Products_Cat"]=$_GET["ProductCategoryID"][0];
    }
  }
}
?>



to this

php:
<?php 

if ( isset($_GET["Search"]))  { 
$_SESSION["WADbSearch1_Products_Cat"]=""
if (isset(
$_GET["ProductCategoryID"]))  { 
  if (
$WADbSearch1->whereClause != "")  { 
     
$WADbSearch1->whereClause .= " AND "
  } else  { 
     
$WADbSearch1->whereClause .= " WHERE "
  } 
   for (
$x=0$x<sizeof($_GET["ProductCategoryID"]); $x++)  { 
        
$_GET["ProductCategoryID"][$x] = intval($_GET["ProductCategoryID"][$x]); 
   } 
  
$WADbSearch1->whereClause .= "ProductID IN (SELECT ProductID FROM ps3_productcategories WHERE (CategoryID = ".implode($_GET["ProductCategoryID"]," OR CategoryID = ")."))"
  
$_SESSION["WADbSearch1_Products_Results"]=$WADbSearch1->whereClause
  if (
sizeof($_GET["ProductCategoryID"]) == 1)  { 
     
$_SESSION["WADbSearch1_Products_Cat"]=$_GET["ProductCategoryID"][0]; 
  } 

}
?>



Please give this a try on your products results page then run this check again to see if you get any more vulnerabilities. If you do please post back with the info for them.

Sign in to reply to this post

Web Designer Troy

MySql message is not the issue

I have spoken to some security experts and they are saying your applications are leaving the database wide open to communication by hackers. Is this being addressed?

Just recently I experienced a an SQL injection attack through the DataAssist app although there was no input field or mysql error message.

Sign in to reply to this post

Web Designer Troy

http://osvdb.org/67939

The problem is discussed here:

67939

Has this been resolved? How about in DataAssist?

Sign in to reply to this post

Jason ByrnesWebAssist

you reported issues in another thread as well where i started a support incident, we will look into this issue with you at the same time as the other one.

Sign in to reply to this post

Web Designer Troy

WebAssist Sql Attack

Thank you. I would like to know as soon as possible if my clients' data is protected form these type of attacks.

The page that was attacked was felix.php?ID=128. I recently took out a search field, which was not validating text, and I deactivated all mysql error messages, however the person scanning the page told me that he was still able to communicate with my database.

Sign in to reply to this post

Jason ByrnesWebAssist

please add this information to your support incident and ray will look into this with you.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...