Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43977 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14953 invoked from network); 15 May 2009 08:37:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2009 08:37:48 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.220.220 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.220.220 mail-fx0-f220.google.com Received: from [209.85.220.220] ([209.85.220.220:51688] helo=mail-fx0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/ED-27038-CD92D0A4 for ; Fri, 15 May 2009 04:37:48 -0400 Received: by fxm20 with SMTP id 20so1949986fxm.23 for ; Fri, 15 May 2009 01:37:45 -0700 (PDT) Received: by 10.103.246.1 with SMTP id y1mr2084174mur.120.1242376665002; Fri, 15 May 2009 01:37:45 -0700 (PDT) Received: from Macintosh-401.local (host81-99-static.42-85-b.business.telecomitalia.it [85.42.99.81]) by mx.google.com with ESMTPS id u9sm369070muf.7.2009.05.15.01.37.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 15 May 2009 01:37:44 -0700 (PDT) Message-ID: <4A0D29D5.2040004@lerdorf.com> Date: Fri, 15 May 2009 10:37:41 +0200 User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: Lukas Kahwe Smith CC: Michael Shadle , Nathan Rixham , PHP Development References: <4A0C9516.8060808@gmail.com> <4A0D2648.3050802@lerdorf.com> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Why does $_REQUEST exist? From: rasmus@lerdorf.com (Rasmus Lerdorf) Lukas Kahwe Smith wrote: > > On 15.05.2009, at 10:22, Rasmus Lerdorf wrote: > >> Michael Shadle wrote: >>> On Thu, May 14, 2009 at 3:03 PM, Nathan Rixham >>> wrote: >>> >>>> bc? all the reasoning in the world won't justify it to 1 million >>>> businesses >>>> running php 4 code which is reliant on $_REQUEST behind the scenes. >>>> >>>> although it would generate a tonne of freelance work :p >>> >>> that code has to change for 5.3 or 6.0 anyway. >>> >>> now is the time to yank out some of the legacy crap. we don't want PHP >>> to be like windows, do we? >> >> The more stuff like this we remove, the harder it becomes for people to >> quickly move to newer, faster and more secure versions of PHP. That >> causes way more frustration for everyone than a few "ugly" legacy >> features. If there is a decent technical reason, performance or >> security, then we need to take a hard look at it. In this case, the >> thing we should be looking at isn't whether we should remove $_REQUEST >> but whether we should remove cookie data from it. Many configurations >> already do that, including all of my own, and there is a strong valid >> security reason for not including cookies in $_REQUEST. Most people use >> $_REQUEST to mean GET or POST, not realizing that it could also contain >> cookies and as such bad guys could potentially do some cookie injection >> tricks and break naive applications. > > > Its already fixed in 5.3. There is a new ini option that defines what > should go into $_REQUEST. See the following blog post for details: > http://www.suspekt.org/2008/10/01/php-53-and-delayed-cross-site-request-forgerieshijacking/ > > > Also a lot of work was put into restructuring the php.ini files we ship > with PHP. Right, I obviously know that, I should have explained better. What I meant by removing cookie data from $_REQUEST was to never allow it at all. Right now you have to set request_order to "GP" in order to not get it. If, like most people, you upgrade and use the same php.ini file as before, then we default back to variables_order which has always included cookie data by default. So, as much as I appreciate the work that has gone into the new recommended php.ini settings, we all know that most people completely ignore our .ini suggestions and go with whatever their distro chooses or whatever they have had in there since their PHP4 days. My prediction is that the bulk of people after upgrading to 5.3 will still have cookies in their $_REQUEST. -Rasmus