Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attributionsrc request referrer header behavior #382

Closed
johnivdel opened this issue Apr 20, 2022 · 8 comments · Fixed by #1254
Closed

attributionsrc request referrer header behavior #382

johnivdel opened this issue Apr 20, 2022 · 8 comments · Fixed by #1254
Assignees
Labels
enhancement New feature or request

Comments

@johnivdel
Copy link
Collaborator

EVENT.md currently doesn't document how the browser is issuing attributionsrc requests, and whether these are treated like other subresources on the page, or are treated more similar to which does not include a referrer header: https://html.spec.whatwg.org/multipage/links.html#hyperlink-auditing

@bmayd
Copy link

bmayd commented Apr 22, 2022

I assume it would make sense to treat it like the request to the ad-server that responds with the attributionsrc, i.e. like other sub-resources on the page. If it was omitted, I assume those who want it would add it in parameter in the attributionsrc URL.

@csharrison
Copy link
Collaborator

I think I agree with @bmayd here that it makes sense to treat this like a normal request to the ad server. There is no reason (that I know of) from a privacy POV to avoid the referrer and it seems cleaner to encourage users to embed this information in a structured way vs. an unstructured way by embedding it in the URL.

However, I really don't feel too strongly about it, so if there are differing opinions I'm happy to hear them.

@johnivdel
Copy link
Collaborator Author

As an additional data point: while <a ping=> doesn't send the referrer (it send no-referrer), navigator.sendBeacon() does include it.

There is some context on the rationale for excluding from <a ping=> here: https://lists.w3.org/Archives/Public/public-html/2008Feb/0194.html

For the most part, this doesn't seem to be applicable so I would also lean towards explicitly including the referrer for these requests and aligning with sendbeacon().

aarongable pushed a commit to chromium/chromium that referenced this issue May 3, 2022
Since discussions are ongoing as to whether to change this behavior, we
should ensure that the existing behavior is covered by tests.

WICG/attribution-reporting-api#382

Change-Id: I7e5de1d8a01a061785d581379c62f2f2053f9d2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3621396
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: John Delaney <johnidel@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Cr-Commit-Position: refs/heads/main@{#998823}
aarongable pushed a commit to chromium/chromium that referenced this issue May 3, 2022
This will allow us to inspect the header's actual value once it is
changed per
WICG/attribution-reporting-api#382.

Change-Id: I299255221a50c95871bd16955962be57ddf1276b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3624239
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: John Delaney <johnidel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999081}
@csharrison
Copy link
Collaborator

Talking with @apasel422 offline, we are trying to think through whether these requests need to abide by Referrer Policy. To me, it seems like it should, i.e. an attributionsrc parallel request on an <a> tag should have the same effective referrer policy as the navigation request on that would result from. Ditto for an <img> tag.

cc @mikewest in case this doesn't sound right. For context, we are designing a system where the browser will issue parallel subresource requests alongside existing request paths. We are trying to figure out how Referrer should work for these new requests.

@mikewest
Copy link
Member

mikewest commented May 6, 2022

If it's a "normal request to the ad server", then it certainly makes sense to respect the referrer policy of the page responsible for the request. By default, that will strip the referrer down to an origin for cross-origin requests, but the page could reasonably choose something more or less restrictive.

@apasel422
Copy link
Collaborator

If it's a "normal request to the ad server", then it certainly makes sense to respect the referrer policy of the page responsible for the request. By default, that will strip the referrer down to an origin for cross-origin requests, but the page could reasonably choose something more or less restrictive.

That makes sense, but should these requests also respect the element-level referrerpolicy / rel="noreferrer" attribute if present?

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#integration_with_html

@mikewest
Copy link
Member

mikewest commented May 6, 2022

That makes sense, but should these requests also respect the element-level referrerpolicy / rel="noreferrer" attribute if present?

Is there a good reason not to?

I think the philosophical discussion could go either way as to whether specifying an attributionsrc attribute means something useful about the site's intent to reveal a specific piece of information, but if the site specifies how it wants us to handle referrer for a given element, it makes sense to me to be consistent in the way we generate requests from that element.

@apasel422
Copy link
Collaborator

Is there a good reason not to?

I agree that we should support it. We will have to consider whether to augment the window.attributionReporting.registerSource JS API with the ability to set the referrer policy this way, or whether it makes sense to rethink that API entirely so that it can avoid duplicating functionality already built into, e.g., window.fetch.

aarongable pushed a commit to chromium/chromium that referenced this issue May 9, 2022
Rather than always specify no-referrer.

WICG/attribution-reporting-api#382

We will propagate element-specific referrer policies (referrerpolicy
attribute on <a> and <img>, rel=noreferrer on <a>) in a followup CL.

Bug: 1323272
Change-Id: I527ee7a367ec9f294975cf3e6317b60ce091aff8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3632160
Reviewed-by: John Delaney <johnidel@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1001107}
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
Since discussions are ongoing as to whether to change this behavior, we
should ensure that the existing behavior is covered by tests.

WICG/attribution-reporting-api#382

Change-Id: I7e5de1d8a01a061785d581379c62f2f2053f9d2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3621396
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: John Delaney <johnidel@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Cr-Commit-Position: refs/heads/main@{#998823}
NOKEYCHECK=True
GitOrigin-RevId: e13f0ffea6644b1307c00ed8d46167d19f29da1d
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
Rather than always specify no-referrer.

WICG/attribution-reporting-api#382

We will propagate element-specific referrer policies (referrerpolicy
attribute on <a> and <img>, rel=noreferrer on <a>) in a followup CL.

Bug: 1323272
Change-Id: I527ee7a367ec9f294975cf3e6317b60ce091aff8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3632160
Reviewed-by: John Delaney <johnidel@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1001107}
NOKEYCHECK=True
GitOrigin-RevId: 83f727f99d017931731c55e4d4767aa45cbec26e
@apasel422 apasel422 self-assigned this Apr 18, 2024
@apasel422 apasel422 added the enhancement New feature or request label Apr 18, 2024
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 30, 2024
For <img> and <script> the attributionsrc request's referrer policy now
matches the subresource's policy, rather than the document-level
default.

For <a> and window.open, the attribution src request's referrer policy
now matches that of the navigation, rather than the per-request default.

WICG/attribution-reporting-api#382
WICG/attribution-reporting-api#1254

Change-Id: I763c055aef45fc17d41a3ba29b4f6ebfe24646cf
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 1, 2024
For <img> and <script> the attributionsrc request's referrer policy now
matches the subresource's policy, rather than the document-level
default.

For <a> and window.open, the attribution src request's referrer policy
now matches that of the navigation, rather than the per-request default.

WICG/attribution-reporting-api#382
WICG/attribution-reporting-api#1254

Change-Id: I763c055aef45fc17d41a3ba29b4f6ebfe24646cf
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 1, 2024
For <img> and <script> the attributionsrc request's referrer policy now
matches the subresource's policy, rather than the document-level
default.

For <a> and window.open, the attribution src request's referrer policy
now matches that of the navigation, rather than the per-request default.

WICG/attribution-reporting-api#382
WICG/attribution-reporting-api#1254

Change-Id: I763c055aef45fc17d41a3ba29b4f6ebfe24646cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5463164
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Nan Lin <linnan@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1294868}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 1, 2024
For <img> and <script> the attributionsrc request's referrer policy now
matches the subresource's policy, rather than the document-level
default.

For <a> and window.open, the attribution src request's referrer policy
now matches that of the navigation, rather than the per-request default.

WICG/attribution-reporting-api#382
WICG/attribution-reporting-api#1254

Change-Id: I763c055aef45fc17d41a3ba29b4f6ebfe24646cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5463164
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Nan Lin <linnan@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1294868}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue May 6, 2024
…ttributionsrc requests, a=testonly

Automatic update from web-platform-tests
Use resource-level referrer policy for attributionsrc requests

For <img> and <script> the attributionsrc request's referrer policy now
matches the subresource's policy, rather than the document-level
default.

For <a> and window.open, the attribution src request's referrer policy
now matches that of the navigation, rather than the per-request default.

WICG/attribution-reporting-api#382
WICG/attribution-reporting-api#1254

Change-Id: I763c055aef45fc17d41a3ba29b4f6ebfe24646cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5463164
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Nan Lin <linnan@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1294868}

--

wpt-commits: c7171d1ffc8e167e649a7b66927528c6521d5bba
wpt-pr: 45970
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 10, 2024
This reverts commit 4c4802b8681c23f09e62c1fb82ed2c00a65d12a6.

Reason for revert: Getting approvals on the revert in case launch approvals are not received in time.

Original change's description:
> Use resource-level referrer policy for attributionsrc requests
>
> For <img> and <script> the attributionsrc request's referrer policy now
> matches the subresource's policy, rather than the document-level
> default.
>
> For <a> and window.open, the attribution src request's referrer policy
> now matches that of the navigation, rather than the per-request default.
>
> WICG/attribution-reporting-api#382
> WICG/attribution-reporting-api#1254
>
> Change-Id: I763c055aef45fc17d41a3ba29b4f6ebfe24646cf
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5463164
> Reviewed-by: Dominic Farolino <dom@chromium.org>
> Reviewed-by: Nan Lin <linnan@chromium.org>
> Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1294868}

Change-Id: I0b25937972ce74dc7519da5f2a6a2664d7ff6134
ErichDonGubler pushed a commit to ErichDonGubler/firefox that referenced this issue May 10, 2024
…ttributionsrc requests, a=testonly

Automatic update from web-platform-tests
Use resource-level referrer policy for attributionsrc requests

For <img> and <script> the attributionsrc request's referrer policy now
matches the subresource's policy, rather than the document-level
default.

For <a> and window.open, the attribution src request's referrer policy
now matches that of the navigation, rather than the per-request default.

WICG/attribution-reporting-api#382
WICG/attribution-reporting-api#1254

Change-Id: I763c055aef45fc17d41a3ba29b4f6ebfe24646cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5463164
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Nan Lin <linnan@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1294868}

--

wpt-commits: c7171d1ffc8e167e649a7b66927528c6521d5bba
wpt-pr: 45970
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants