|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-12-23 18:50 UTC] iliaa@php.net
[2002-12-29 15:02 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 23:00:01 2025 UTC |
While doing a security audit on a PHP web app, I was able to bypass a variable check wich later allowed me to remotely execute commands on the web server. Although this was a programming error, I found it very odd the behaviour from PHP. Consider the following code as an example: <? if ( isset($HTTP_GET_VARS['test']) || isset($HTTP_POST_VARS['test']) || isset($HTTP_COOKIE_VARS['test']) ) { echo "not allowed\r\n"; exit; } else echo "test not defined, proceed\r\n"; echo "<pre>"; echo "test HTTP_GET_VARS: ".$HTTP_GET_VARS['test']; echo "\r\n"; echo "var test: $test\r\n"; echo "\r\n"; ?> Having this, and requesting the page as: ola.php?test[= The output will be: test not defined in HTTP_*_VARS test HTTP_GET_VARS: var test: Array So, 'test' is an array, but appears as no set in HTTP_*_VARS. Regards, Joao Gouveia ------------ tharbad@kaotik.org