Corrige une faille critique permettant de creer un sous domaine pointant sur / du systÚme

This commit is contained in:
Nahuel Angelinetti 2006-11-27 18:21:17 +00:00
parent 5f50bbaf41
commit 3f648fcf1e
1 changed files with 10 additions and 5 deletions

View File

@ -195,11 +195,16 @@ function checkuserpath($path) {
$usar=substr($user,0,1);
if (substr($path,0,1)=="/")
$path="/".$path;
if (is_dir("/var/alternc/html/$usar/$user$path")) {
return 1;
}
if (is_file("/var/alternc/html/$usar/$user$path")) {
return 2;
$rpath = realpath("/var/alternc/html/$usar/$user$path");
$userpath = realpath("/var/alternc/html/$usar/$user");
if(strpos($rpath,$userpath) === 0){
if (is_dir("/var/alternc/html/$usar/$user$path")) {
return 1;
}
if (is_file("/var/alternc/html/$usar/$user$path")) {
return 2;
}
}
return 0;
}