Q: Where to I go to make these changes and see if they work?
I know very little of php please be patient with me.
A: They are are all over the place. The biggest problem I have seen is with $HTTP_GET_VARS and $_GET and $_SESSION. $HTTP_GET_VARS and $_GET are used to get the data from the form and the php url encoding. The php url encoding is:
http://127.0.0.1/aloaded_temp/product_info.php?products_id=8 In the code you would see something like
$product_id = $HTTP_GET_VARS['products_id'];
This take what ever was after the products_id= to the next & symbol or to the end of the line. If this link happens to be on another site and send the person to your site. the original site can add some javascript thta can run and get information from your site. Like raw database information, like you customer data.
Because we did not type class or filter the input we put about anything we want after the products_id=. This includes javascript.
by changing this line to $product_id = (int)$HTTP_GET_VARS['products_id'];
we have changed the get to be an integer only so there will be no text allowed. We used (int) because we know a product id is always an integer on this page. If we don't allow text the script won't be any any form that makes sense and can run.
I would also like to add the in creloaded this was not done intentionly the programer was more ware of the fact that they needed to fix a problem or the original code was done by some one who was a new programer that did not understand that they needed to filter to type class all get post and session data they get and use.
Q: How do you find this stuff?
A: To tell the trueth it is not always easy to find these problems, you have to do an audit of all the code. and look at all code file to see if this problem exists. You look for such things as:
$product_id = $HTTP_GET_VARS['products_id'];
$affiliate_id = $_SESSION['affiliate_id'];
$breadcrumb->add(NAVBAR_TITLE_DEFAULT, tep_href_link(FILENAME_ARTICLES, 'CDpath=' . $_SESSION['CDpath']) ); should be : $breadcrumb->add(NAVBAR_TITLE_DEFAULT, tep_href_link(FILENAME_ARTICLES, 'CDpath=' . tep_db_prepare_input($_SESSION['CDpath'])) );
This done this way because CDpath is not an integer so we need to filter and change some characters that will break the script. The function tep_db_prepare_input does this by changing the < > and + characters .
So for the person who is not a programer you end up having to rely on those that are to do an audit. Most likely cre won't do much with the 6.2 since for them it's at its end of life and they want people to upgrade to 6.3
Q: Is any one else doing an audit for cross site scripting ?
A: Yes, an audit has been started it has taken about 15 hours to check the files in the root directory a lone. But there is still a ways to go. So there is not yet a projected completion time.