Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75190 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49769 invoked from network); 3 Jul 2014 05:42:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2014 05:42:18 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.46 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.46 mail-qa0-f46.google.com Received: from [209.85.216.46] ([209.85.216.46:53403] helo=mail-qa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1A/22-47713-93DE4B35 for ; Thu, 03 Jul 2014 01:42:17 -0400 Received: by mail-qa0-f46.google.com with SMTP id i13so9605139qae.5 for ; Wed, 02 Jul 2014 22:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tOrL/MEfGYEXcJ2HQszdjcY1S64+9OLLZa03wj0kEzI=; b=a8QsMeDjv34DlwmLAy1K6uNvpQydbspDIconONNLoKitBrzctxv6UVFOMXyKTudrMx 07f7NSntbV3ZarryaKBvQFLhk0yr1fxsw0su7XVw/89cN7sQ5H1YY8S6cIZ4msgEAakZ +p2ZXvAuigz9IjpbwKJMO342gILCp0l1Cf3Qw8cHnuONRRINgMUIM5dm68ICfWgS/3GG y8yygKBBTluF/7SGGTAQ17SShvNJUJMTE12Pv+8U1PqahS/FfrBCLbq1x6tKuEqDpWea JCmpVmQ7xSUmdbJVFvF/oYBsxoLK7NAmoqMM4iZ/mv+VetUhkCGmy7ZHxE2YNF1Nd8Ww LRnA== MIME-Version: 1.0 X-Received: by 10.140.27.108 with SMTP id 99mr3524627qgw.77.1404366134520; Wed, 02 Jul 2014 22:42:14 -0700 (PDT) Received: by 10.140.47.175 with HTTP; Wed, 2 Jul 2014 22:42:14 -0700 (PDT) In-Reply-To: References: <20140703003646.GA12662@openwall.com> <53B4AC6E.5050401@sugarcrm.com> <20140703012402.GA13015@openwall.com> Date: Thu, 3 Jul 2014 07:42:14 +0200 Message-ID: To: Adam Harvey Cc: Solar Designer , Andrea Faulds , Stas Malyshev , PHP internals , D0znpp Content-Type: multipart/alternative; boundary=001a11c146e49533e904fd437865 Subject: Re: [PHP-DEV] multiline HTTP headers support in header() From: tyra3l@gmail.com (Ferenc Kovacs) --001a11c146e49533e904fd437865 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Jul 3, 2014 at 7:36 AM, Ferenc Kovacs wrote: > > > > On Thu, Jul 3, 2014 at 3:29 AM, Adam Harvey wrote: > >> On 2 July 2014 18:24, Solar Designer wrote: >> > On Thu, Jul 03, 2014 at 02:09:05AM +0100, Andrea Faulds wrote: >> >> On 3 Jul 2014, at 02:05, Stas Malyshev wrote= : >> >> > So IE violates the RFC by misparsing the multiline headers? I'd say >> it's >> >> > an one more reason to never use IE :) RFC 7230 indeed proposes to >> remove >> >> > this capability, but it's not accepted yet, as far as I can see. We >> can >> >> > probably drop this immediately for 5.6, for previous versions I'm n= ot >> >> > sure if anybody uses this feature. So if anybody knows any use of i= t, >> >> > please tell, otherwise it's probably a good idea to kill it for >> stable >> >> > versions too. >> >> >> >> As I?ve had to implement HTTP myself for a particular non-PHP >> application, I?ve read the original HTTP/1.1 RFC. As far as I know, >> multi-line headers are semantically equivalent to single-line headers, s= o >> couldn?t we just ?flatten? them automatically? It shouldn?t break anythi= ng >> unless you?re deliberately misusing header(). >> > >> > I think we could, and your analysis looks correct to me, but I see no >> > good enough reason to go for the extra complexity. Having a function >> > defined in a more complicated manner and implemented with more code is >> > asking for more bugs and mis-interactions. >> >> I'd tend to agree: if we're going to do this, let's just rip the >> band-aid off completely. I've got a quick and dirty patch at >> >> https://github.com/LawnGnome/php-src/compare/remove-multiline-headers?ex= pand=3D1 >> that does this, and applies cleanly against every branch from 5.4 to >> master. >> >> I'm not so sure about the versions this should be applied too, though: >> my current inclination is to only apply it to master and maybe 5.6 if >> the RMs agreed. While it's a very, very small BC break (and hence one >> I'm OK with in a minor branch like 5.6), I don't think we should do >> this in a 5.4 or 5.5 point release =E2=80=94 recent history (the unseria= lize() >> hack) suggests that it's a nightmare to document and explain those >> sorts of breaks. >> >> Adam >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > If I'm reading this correctly this would reintroduce > https://bugs.php.net/bug.php?id=3D60227 > those checks aren't there to support header splitting but to prevent them= , > as "\r\n" isn't the only separator which will cause browsers to split the > header. > > > -- > Ferenc Kov=C3=A1cs > @Tyr43l - http://tyrael.hu > and for the record, my irc history tells me that Nikita sent an email about http://lab.onsec.ru/2012/08/php-multiple-headers-bypass-available.html to security@php.net back in 2012-08-24, so maybe there were some discussion there which I'm missing. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001a11c146e49533e904fd437865--