Re: [PATCH] Fix for bug #31440 (GLOBALS can be by G/P/C when register_globals=On)
| From: | Rasmus Lerdorf | Date: | Wed, 16 Feb 2005 16:46:57 +0000 |
| Subject: | Re: [PATCH] Fix for bug #31440 (GLOBALS can be by G/P/C when register_globals=On) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15028@lists.php.net to get a copy of this message | ||
Stanislav Malyshev wrote:
AG>>>Seems like a bad excuse. Being able to destroy a superglobal array like AG>>>that is clearly a bug that should be fixed. IMO there should be no possibility to destroy GLOBALS with ?GLOBALS=foo, but there should be possibility to write GLOBALS with ?GLOBALS[foo]=bar - why not, if we allow accessing globals anyway? I didn't check how hard it should be to separate these - if it's hard then restricting access to GLOBALS would be good.Yup, I agree. GLOBALS[foo]=bar is perfectly fine since that doesn't destroy the array and prevent a $foo global locally defined from overriding it. The problem with the current situation is code like this: <?php
$password_checked = true;
...
if($GLOBALS['password_checked']) do_something;
?>
This application can be hacked by simply sending it a ?GLOBALS=foo in the URL.
-Rasmus