W3C home > Mailing lists > Public > public-html@w3.org > February 2008

Re: [whatwg] Referer header sent with <a ping>?

From: Philip Taylor <pjt47@cam.ac.uk>
Date: Tue, 12 Feb 2008 21:54:25 +0000
Message-ID: <47B21591.9030903@cam.ac.uk>
To: Kornel Lesinski <kornel@geekhood.net>
CC: Julian Reschke <julian.reschke@gmx.de>, "public-html@w3.org" <public-html@w3.org>

Kornel Lesinski wrote:
> On Sun, 10 Feb 2008 10:42:47 -0000, Julian Reschke 
> <julian.reschke@gmx.de> wrote:
>> So you're saying that recipients treat the absence of a Referer header 
>> as indication the offering page was from the same origin? That would 
>> IMHO be contrary to what RFC2616 defines (the absence of the Referer 
>> header means that the Referrer either doesn't have a URI, or the 
>> client doesn't want to reveal it).
> If client does not reveal referrer, the website can't tell if request 
> was local or from another site. In order to avoid blocking legitimate 
> requests (local request from client/proxy that hides referrer) websites 
> have to accept all requests without Referer.
>> Pointers, please.
> The easiest example to find is anti-hotlinking code which deals with the 
> same issue:  [...]

The cost of false negatives in anti-hotlinking code is very small - it 
just results in a tiny amount of bandwidth usage from the users who 
don't send Referers, and still has the desired effect of making image 
hotlinking useless since it will block almost all users. It isn't 
inferring any trust based on the lack of Referer.

It's quite a different situation when the Referer is used as a security 
measure in deciding to trust a user's request, where false negatives can 
have significant consequences (like editing data via cross-site request 
forgery). That is the situation where <a ping> mustn't introduce new risks.

I looked for some examples of code that checks the Referer for security, 
and found:







If I'm not misreading the code, they all deny access if the Referer is 
absent (i.e. they default to 'safe', at the cost of blocking a small 
number of users). So it would not introduce any new vulnerabilities in 
those cases if <a ping> sent requests with no Referer.

I haven't yet seen any code which assumes a missing Referer should be 
trusted like a local Referer when performing some action (though 
obviously that's not evidence that such things don't exist).

Philip Taylor
Received on Tuesday, 12 February 2008 21:54:44 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:30 UTC