We will not be posting the exact details of how to exploit the problem for obvious reasons.
All users are advised to apply the following patch IMMEDIATELY in order to protect their site from possible intrusion:
1. Open the index.php file.
2. Find the following code:
/* start fixing security hole */
function harden_parse($vars){
$vars2=trim($vars);
$vars2=strip_tags($vars2);
$vars2=str_replace("#","& #35;",$vars2);
$vars2=str_replace("(","& #40;",$vars2);
$vars2=str_replace(")","& #41;",$vars2);
$vars2=str_replace("%","& #37;",$vars2);
return $vars2;
}
if (count($vars) && $auth["perms"]!="admin" && $auth["perms"]!="storeadmin"){
while (list($key, $value) = each ($vars)) {
if (is_array($value)){
while (list($keyA, $valueA) = each ($value)) {
$varsA[$keyA]=harden_parse($valueA);
} $vars2[$key] = $varsA; unset ($varsA);
}
else { $vars2[$key]=harden_parse($value); }
if ($HTTP_POST_VARS[$key]){ $HTTP_POST_VARS[$key]=$vars2[$key]; }
if ($HTTP_GET_VARS[$key]){ $HTTP_GET_VARS[$key]=$vars2[$key]; }
$$key = $vars2[$key];
}
$vars = $vars2;
$QUERY_STRING = harden_parse($QUERY_STRING);
}
3. Replace with:
/* start fixing security hole */
function harden_parse($vars){
$vars2=trim($vars);
$vars2=strip_tags($vars2);
$vars2=str_replace("#","& #35;",$vars2);
$vars2=str_replace("(","& #40;",$vars2);
$vars2=str_replace(")","& #41;",$vars2);
$vars2=str_replace("[","& #91;",$vars2);
$vars2=str_replace("]","& #93;",$vars2);
$vars2=str_replace("%","& #37;",$vars2);
return $vars2;
}
if (count($vars) && $auth["perms"]!="admin" && $auth["perms"]!="storeadmin"){
while (list($key, $value) = each ($vars)) {
if (is_array($value)){
while (list($keyA, $valueA) = each ($value)) {
$varsA[$keyA]=harden_parse($valueA);
} $vars2[$key] = $varsA; unset ($varsA);
}
else { $vars2[$key]=harden_parse($value); }
if ($HTTP_POST_VARS[$key]){ $HTTP_POST_VARS[$key]=$vars2[$key]; }
if ($HTTP_GET_VARS[$key]){ $HTTP_GET_VARS[$key]=$vars2[$key]; }
$$key = harden_parse($vars2[$key]);
}
$vars = $vars2;
$QUERY_STRING = harden_parse($QUERY_STRING);
}
4. IMPORTANT: In order to publish this on our site, we had to put a space inside the code characters. For example "& #35;" has a space in it. Please remove the spaces in the codes for #,(,),[,],%.
5. Save the file.
This will effectively eliminate the risk posed by the security threat.
A special thank you goes to Jason (a.k.a. JTrusty in the forums) for discovering and reporting the issue to us.
I will post an updated release of phpShop so that no new downloads include this bug.
Thank you.