Skip to content

Add a new "referrer attribute" delivery mechanism - #175

Merged
mikewest merged 6 commits into
w3c:masterfrom
fmarier:referrer-anchor-element
Feb 19, 2015
Merged

mikewest merged 6 commits into
w3c:masterfrom
fmarier:referrer-anchor-element

Conversation

@fmarier

@fmarier fmarier commented Feb 12, 2015

Copy link
Copy Markdown

This delivery mechanism is meant to subsume the rel="noreferrer"
link type defined in the HTML5 spec:

https://html.spec.whatwg.org/multipage/semantics.html#link-type-noreferrer

This would allow for the following use case:

  • I don't want any referrers to be sent (i.e. global policy of
    "no-referrer" delivered via or CSP)
  • except for these two links that should reveal the origin of the
    referring page (i.e. local policy of "origin" on the two elements)

This delivery mechanism is meant to subsume the rel="noreferrer"
link type defined in the HTML5 spec:

  https://html.spec.whatwg.org/multipage/semantics.html#link-type-noreferrer

This would allow for the following use case:

- I don't want any referrers to be sent (i.e. global policy of
"no-referrer" delivered via <meta> or CSP)
- except for these two links that should reveal the origin of the
referring page (i.e. local policy of "origin" on the two <a> elements)
@fmarier
fmarier force-pushed the referrer-anchor-element branch from 6a25a32 to 0394a3d Compare February 13, 2015 03:32
@fmarier

fmarier commented Feb 13, 2015

Copy link
Copy Markdown
Author

@mikewest I think I've addressed all of the feedback from the list.

@annevk

annevk commented Feb 13, 2015

Copy link
Copy Markdown
Member

I think we should not do this and pursue https://www.w3.org/Bugs/Public/show_bug.cgi?id=26533 instead. We cannot keep adding request variables everywhere forever.

@mikewest

Copy link
Copy Markdown
Member

Well, either way we'd need to implement it as a parameter to Fetch, right? The question is whether we'd allow all of those parameters to live together in a single attribute (which makes sense to me).

I don't see any problem landing this to signal the direction we want to work in, iff we add another issue to the doc pointing at that bug, and work with Hixie, et al. to get whatever we end up with added to HTML.

@briansmith

Copy link
Copy Markdown

Do you mean that instead of having a referrer attribute, it should be part of some JSON blob inside a src-options attribute?

If so, I don't think that is a good idea at all. 1. src-options being a JSON string means that it becomes yet another attack vector for XSS (you have to JSON escape things, and then attribute escape them). 2. For authors, the referrer attribute is much better ergonomically, and web developer ergonomics is more important than specification or implementation ergonomics (this is in the HTML design principles). For those reasons, I expect the src-options stuff is going to get a lot of pushback from anywhere it will tried to be applied to, not just referrer.

We should block progress on the referrer spec on src-options. Per-element referrer control is blocking other important improvements to the referrer spec. We should go ahead and add the referrer attribute to the editor's draft now, and if/when src-options becomes a preferable alternative, we can switch the spec to that assuming that happens in a reasonable timeframe.

@fmarier
fmarier force-pushed the referrer-anchor-element branch from 0394a3d to 4e1b7ff Compare February 15, 2015 10:15
@fmarier

fmarier commented Feb 15, 2015

Copy link
Copy Markdown
Author

I've addressed @briansmith's concerns about the precedence by turning that paragraph into an issue.

I have also pruned the list of allowed values based on his comment to that effect.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to limit to just these three? It might make sense to support all of the following here: no-referrer, no-referrer-when-downgrade, origin, origin-when-cross-origin, unsafe-url

I only need the three listed at the moment.

Edit: oh I see you changed this in fmarier@705c9b4 . Makes sense. It does shift responsibility to the publisher to enforce but I suppose that is ok.

@sc0ttbeardsley

Copy link
Copy Markdown

I agree with @briansmith regarding https://www.w3.org/Bugs/Public/show_bug.cgi?id=26533 It seems like a lot of work which will be prone to error to specify this in a JSON blob.

I would like to see this PR land as it meets my needs for being able to override the per-document global policy for just a few links. LGTM

mikewest added a commit that referenced this pull request Feb 19, 2015
Add a new "referrer attribute" delivery mechanism
@mikewest
mikewest merged commit 0ba7cd4 into w3c:master Feb 19, 2015
@mikewest

Copy link
Copy Markdown
Member

We'll run with it for the moment, and see if the other bug resolves in a way that folks are happy with. If not, referrer it is. :)

Thanks, @fmarier!

@WooseokJeong

Copy link
Copy Markdown

Hi, would you confirm that this will support hierarchical inheritance and override in DOM structure?
`

`

@fmarier
fmarier deleted the referrer-anchor-element branch February 19, 2015 21:12
@fmarier

fmarier commented Feb 19, 2015

Copy link
Copy Markdown
Author

@WooseokJeong It works kinda like that except not with a <div>. You can set a default policy for the whole document (via the <meta> tag) and then you can override it on a per-link basis.

@WooseokJeong

Copy link
Copy Markdown

got it, thanks
I thought it might be good because we can control policies across element section level which also can reduce manipulation of every single links to override.

mikewest pushed a commit to mikewest/webappsec that referenced this pull request Jun 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants