Re: p1: whitespace in request-target

Mark Nottingham <> Tue, 30 April 2013 03:20 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id E5C3521F9C1C for <>; Mon, 29 Apr 2013 20:20:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -10.054
X-Spam-Status: No, score=-10.054 tagged_above=-999 required=5 tests=[AWL=0.545, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id hjSN8teUAm3Q for <>; Mon, 29 Apr 2013 20:20:26 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 1E87721F9B6A for <>; Mon, 29 Apr 2013 20:20:26 -0700 (PDT)
Received: from lists by with local (Exim 4.72) (envelope-from <>) id 1UX16C-0002wy-Sl for; Tue, 30 Apr 2013 03:19:24 +0000
Resent-Date: Tue, 30 Apr 2013 03:19:24 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtp (Exim 4.72) (envelope-from <>) id 1UX163-0002vp-FJ for; Tue, 30 Apr 2013 03:19:15 +0000
Received: from ([]) by with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <>) id 1UX15z-0004Oi-VF for; Tue, 30 Apr 2013 03:19:15 +0000
Received: from (unknown []) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id D8C5B509B8; Mon, 29 Apr 2013 23:18:47 -0400 (EDT)
Content-Type: text/plain; charset="iso-8859-1"
Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\))
From: Mark Nottingham <>
In-Reply-To: <>
Date: Tue, 30 Apr 2013 13:18:43 +1000
Cc: " Group" <>
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <>
To: Amos Jeffries <>
X-Mailer: Apple Mail (2.1503)
Received-SPF: pass client-ip=;;
X-W3C-Hub-Spam-Status: No, score=-4.3
X-W3C-Hub-Spam-Report: AWL=-2.382, BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001
X-W3C-Scan-Sig: 1UX15z-0004Oi-VF 30f93f8deffaf567db24612e98f71f29
Subject: Re: p1: whitespace in request-target
Archived-At: <>
X-Mailing-List: <> archive/latest/17707
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

So, I'm not hearing you say "don't make this a MUST" -- just noting that some broken software out there; correct?

On 18/04/2013, at 1:48 PM, Amos Jeffries <> wrote:

> On 18/04/2013 12:49 p.m., Mark Nottingham wrote:
>> p1 3.1.1 says:
>>> Unfortunately, some user agents fail to properly encode hypertext references that have embedded whitespace, sending the characters directly instead of properly encoding or excluding the disallowed characters. Recipients of an invalid request-line SHOULD respond with either a 400 (Bad Request) error or a 301 (Moved Permanently) redirect with the request-target properly encoded. Recipients SHOULD NOT attempt to autocorrect and then process the request without a redirect, since the invalid request-line might be deliberately crafted to bypass security filters along the request chain.
>> I note that the practice of correcting this is fairly widespread; e.g., in Squid, the default is to strip the whitespace, and IIRC has been for some time:
>> I think that the Squid documentation needs to be corrected, because the text in RFC2396 (and later in 3986) is about URIs in contexts like books, e-mail and so forth, not protocol elements:
> The relevant portion there being:
> "
>   For robustness, software that accepts user-typed URI should attempt
>   to recognize and strip both delimiters and embedded whitespace.
> "
> Note that Squid *does* accept user-typed HTTP messages and the software traditionally causing whitespace issues
> are usually the specialized clients sending URI through HTTP-compatible messages in the URL field (Outlook and Exchange with RCP, some shockwave ICY clients).
>> My question is why this is a SHOULD / SHOULD NOT. We say that SHOULD-level requirements affect conformance unless there's a documented exception here:
>> ... but these requirements don't mention any exceptions. Is the security risk here high enough to justify a MUST / MUST NOT? If not, they probably need to be downgraded to ought (or an exception needs to be highlighted).
> The biggest risk is software truncating portions of the URL, or (like Squid when there is a trailing SP on the line) determining that the HTTP/1 version label is part of the URL on a HTTP/0.9 syntax GET request - which results in any HTTP/1.x header features being ignored. The actual security worst-case risk of this undeterminable, but its not going to be good for the transaction at the best of times.
> Amos

Mark Nottingham