CSP 'referrer' directive: deprecate or remove?

37 views
Skip to first unread message

Emily Stark

unread,
Oct 19, 2016, 2:46:57 PM10/19/16
to blink-dev, Mike West, Jochen Eisinger
I'd like to remove the CSP 'referrer' directive. This directive sets a Referrer Policy for the page and has been obviated by the Referrer-Policy header.

The directive is seen on <= 0.0001% of page loads. However, removing the directive has privacy implications for pages that are using it. (For example, a page might have set a 'referrer' directive of 'no-referrer' to never send referrers on outgoing requests, and removing the CSP directive means that the page will silently start sending referrers again.)

Do any API owners have an opinion about whether we should go straight to removing the directive, or if it would be preferable to deprecate with a console message for a couple releases first?

Thanks,
Emily

Philip Jägenstedt

unread,
Oct 19, 2016, 2:55:01 PM10/19/16
to Emily Stark, blink-dev, Mike West, Jochen Eisinger
Is this a maintenance burden and do you expect that moving slowly would make it harder to remove? If not, then maybe deprecate for 1-2 releases? I also wonder if CSP reporting might be abused here to tell people that their using a deprecated part of CSP?

Mike West

unread,
Oct 20, 2016, 4:46:29 AM10/20/16
to Philip Jägenstedt, Rick Byers, Emily Stark, blink-dev, Jochen Eisinger
I think the risk to developers is minimal, as Chrome is the only browser that shipped this header, meaning that developers who aren't specifying a policy in a more universal way are already putting their users at risk. No other browser is going to ship this directive, and the usage is minimal.

Non-owner's LGTM to just remove the code. Deprecating for one release sounds reasonable if folks are worried about the risk, but I don't really think the risk is worth worrying about. :)

Adding a "this is deprecated" message to CSP's reporting mechanism is interesting, but I think it would be better to define a real notification mechanism on top of http://wicg.github.io/reporting/. Rick, wasn't this on your team's list somewhere? I'd be interested in sketching that out with y'all, if so.

-mike

Philip Jägenstedt

unread,
Oct 20, 2016, 5:20:48 AM10/20/16
to Mike West, Rick Byers, Emily Stark, blink-dev, Jochen Eisinger
Oh, so it was only ever shipped by Chrome. Is https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy totally wrong about the support for the Referrer-Policy header? If that already works in a few places, then indeed it seems likely that both mechanisms are used. So risk wise direct removal would probably work out.

(The deprecation reporting idea is https://crbug.com/564071, was just curious if it might be easy to experiment with the idea here, but if it'd be more than 10 lines of code I agree let's keep that idea separate.)

Are console messages logged when you have a typo in the CSP header? If not, that might help catch other mistakes, and would help developers figure out what's happened.

Jochen Eisinger

unread,
Oct 20, 2016, 5:38:22 AM10/20/16
to Philip Jägenstedt, Mike West, Rick Byers, Emily Stark, blink-dev
The Referrer-Policy header is different from the CSP header with the referrer directive.

We recently shipped the Referrer-Policy header. Now we'd like to remove the referrer directive from the CSP header.

Philip Jägenstedt

unread,
Oct 20, 2016, 5:44:03 AM10/20/16
to Jochen Eisinger, Mike West, Rick Byers, Emily Stark, blink-dev
My question about console messages was answered in the affirmative in the reflected-xss thread, so assuming that migrating to Referrer-Policy is easy, doing immediate removal in this case too SGTM.

Emily Stark

unread,
Oct 20, 2016, 9:40:09 PM10/20/16
to Philip Jägenstedt, Jochen Eisinger, Mike West, Rick Byers, Emily Stark, blink-dev
Alright, thanks all for the input! I'll send an official Intent to Remove.

Emily Stark

unread,
Oct 20, 2016, 9:45:37 PM10/20/16
to Emily Stark, Philip Jägenstedt, Jochen Eisinger, Mike West, Rick Byers, blink-dev
Actually, in writing up the Intent to Remove, I realized that it looks like Firefox did in fact implement this: https://bugzilla.mozilla.org/show_bug.cgi?id=965727

Does that change the calculus here? Since IE/Edge/Safari don't support it, I think Mike's argument still stands that developers are already putting their users at risk if they're using this feature alone to specify a Referrer Policy.
Reply all
Reply to author
Forward
0 new messages