Speculation-rules prefetch follows redirects to non-trustworthy or cross-site URLs
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: smayya, Assigned: smayya)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(1 external file)
PrefetchRecordParent::Init checks that the prefetch URL is potentially trustworthy and same-site, but PrefetchRecordParent::AsyncOnChannelRedirect doesn't repeat either check. A prefetch of an https URL that redirects to an http URL, or to another site, is followed and can later be used for the navigation.
Per "create navigation params by fetching" (https://wicg.github.io/nav-speculation/prefetch.html#create-navigation-params-by-fetching), the step "If request's current URL is not potentially trustworthy, then set response to a network error" runs inside the redirect loop, so it applies to every hop, not only the first.
Cross-site prefetches aren't supported yet: the isolated, uncredentialed partition that a cross-site hop needs isn't implemented. So while dom.speculation_rules.same_site_only is set, a redirect off the document's site has to be rejected as well, the same way the initial URL is.
Proposed fix: in PrefetchRecordParent::AsyncOnChannelRedirect, abort the redirect when the new URL isn't potentially trustworthy, or when it is cross-site and dom.speculation_rules.same_site_only is set.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
The spec rejects a prefetch whose current URL is not potentially trustworthy
on every redirect hop, not only the first one. Cross-site prefetches are also
not supported yet (the isolated, uncredentialed partition isn't implemented),
so while dom.speculation_rules.same_site_only is set, don't follow a redirect
off the document's site either.
Updated•1 month ago
|
Comment 4•23 days ago
|
||
| bugherder | ||
Updated•4 days ago
|
Description
•