|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-03-18 18:18 UTC] rlm at pricegrabber dot com
The entire point of "register_globals Off" is to provide a mechanism to disable automatic registration of EGPCS (Environment, Get, Post, Cookie, System) variables. However, for this to be an effective strategy, scripts need access to these variables by other means. This SHOULD be the HTTP_*_VARS and _GET[], _POST[], etc. variables. But as of 4.1.2, track_vars (which is set on by default) doesn't work unless (1) register_globals is set On, AND (2) variables_order contains the particular type of variable you want. That is, unless you set variables_order to contain "G", neither _GET[] nor HTTP_GET_VARS[] will be contain the results from the GET request, but if variables_order does contain "G", they *will*. Considering the number of exploits caused by namespace pollution that register_globals has been accused (and convicted) of, this is about as serious a security bug as I can think of. I will be digging through the source tree to come up with a patch. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 05:00:01 2025 UTC |
Ah, I think I understand maybe why you can't replicate this. In my /etc/httpd/conf/include.d directory (the entire dir is parsed by Apache on startup), I have a file that has the following lines in it, in the order following: php_value variables_order "es" php_flag register_globals Off Remove the file containing these lines, and it works. Install the file containing these lines, and it fails.This is a feature request as it's documented and expected bahavior. Your points are valid and shared by many. It's a matter of sitting down, thinking it through, and coming up with a nice BC friendly solution. In speaking with Zeev, he tentively suggested the following: (a) Decouple variables_order from the $_* / $HTTP_*_VARS completely. (b) Make it possible to prevent $_ENV and $_SERVER from being populated. Like env_autoglobal = on and server_autoglobal = on. (c) It shouldn't be possible to prevent $_GET, $_POST, $_COOKIE, and $_FILES from being populated. This falls in line with your suggestions. The current variables_order manual entry is vague on this particular matter, yes, but it's there, and it's much clearer in the other aforementioned entries. With variables_order = GPCS and register_globals = off, the global namespace will not be polluted. Not sure what you mean there as $_GET['id'] will exist, $id will not.