Re: [PHP-DEV] RE: (SRADV00001) Arbitrary file disclosure through PHP file upload From: Stanislav Malyshev (stas <email protected>)
Date: 09/04/00

S1>> <?php
S1>> if($userfile_size != filesize($userfile)){
S1>> echo "File upload variables have been tampered with.\n";
S1>> }
S1>>
S1>> ?>
S1>>
S1>> This will prevent most attacks, unless the filesize is the same
S1>> as the local file. Like I said - workaround.. but it is one you
S1>> can impliment in your code *now* instead of waiting for a patch.

I fear this is no good. If you need to steal /etc/passwd, you can easily
have 1000 tries and get the right size. Since you are not limited in the
number of tries, you'll succeed sooner or later.

-- 
Stanislav Malyshev   stas <email protected>  http://www.zend.com/        
+972-3-6139665 ext.106

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>