Closed Bug 1815039 Opened 3 years ago Closed 7 months ago

The <meta name="referrer" content="no-referrer"> not inherited by javascript: URL documents

Categories

(Core :: DOM: Security, defect, P3)

Firefox 109
defect

Tracking

()

RESOLVED DUPLICATE of bug 1794216

People

(Reporter: duckhiem, Unassigned)

References

Details

(Keywords: reporter-external, sec-low, Whiteboard: [domsecurity-backlog])

Attachments

(1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Steps to reproduce:

I re-tested a demo and found out this behavior still can be reproduced:

On Firefox desktop on macOS, load:

https://test.shhnjk.com/stop_url.html

Click go.

The website can get the referrer information.

Actual results:

The website can get the referrer information.

Expected results:

The website should not get the referrer information, because of the <meta name="referrer" content="no-referrer"> tag.

Jun, I assume this is one of your testcases given it's on your domain. Can you link to where it was published? I found bug 1383729 which got resolved WFM by you because data: URIs don't inherit anymore - but javascript URLs still do, and I cannot find a link to this test anywhere on bugzilla. It's still not clear to me if/how where this would be exploitable.

Group: firefox-core-security → dom-core-security
Component: Untriaged → DOM: Security
Flags: needinfo?(s.h.h.n.j.k)
Product: Firefox → Core

(In reply to Jun from comment #2)

I think it's from here.
https://bugs.chromium.org/p/chromium/issues/detail?id=823241

Thanks a lot Jun!

That shows that chromium added wpt tests for this, which indeed are failing on Firefox - https://searchfox.org/mozilla-central/source/testing/web-platform/tests/referrer-policy/generic/inheritance/iframe-inheritance-javascript.html .

I'm told Freddy knows more about the state of things here.

Flags: needinfo?(fbraun)

If we were to fix this, looking at Document::InitReferrerInfo and the call to ReferrerInfo::ShouldResponseInheritReferrerInfo(aChannel) therein could be a good start.

Rating: I think that's sec-low..

Severity: -- → S3
Flags: needinfo?(fbraun)
Keywords: sec-low
Priority: -- → P3
Summary: The <meta name="referrer" content="no-referrer"> tag can be bypassed → The <meta name="referrer" content="no-referrer"> not inherited by javascript: URL documents

The spec reference is now step 10 of https://html.spec.whatwg.org/#the-javascript:-url-special-case in the current version of the HTML spec

Unhiding since the Chrome bug is public and there's a known-failing WPT test for it

Group: dom-core-security
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [domsecurity-backlog]
Duplicate of this bug: 1831776

(In reply to Frederik Braun [:freddy] from comment #4)

If we were to fix this, looking at Document::InitReferrerInfo and the call to ReferrerInfo::ShouldResponseInheritReferrerInfo(aChannel) therein could be a good start.

Looking again, I think we want ReferrerInfo::ShouldResponseInheritReferrerInfo to return true for javascript schemes, just like we already do for about: schemes.
Not sure about the testing situation and if we have tests for this in our mochitests or if a wpt will flip to PASS when we fix this.

Malte, would you be interested in trying to fix this?

Flags: needinfo?(mjurgens)

Sure, I'll take a look next week.

Assignee: nobody → mjurgens
Status: NEW → ASSIGNED
Flags: needinfo?(mjurgens)
Attachment #9335406 - Attachment is obsolete: true
Assignee: mjurgens → nobody
Status: ASSIGNED → NEW

Sorry for the burst of bugspam: filter on tinkling-glitter-filtrate
Adding reporter-external keyword to security bugs found by non-employees for accounting reasons

Duplicate of this bug: 1906027
Depends on: policy-container
Status: NEW → RESOLVED
Closed: 7 months ago
Duplicate of bug: 1794216
Resolution: --- → DUPLICATE
No longer depends on: policy-container
No longer duplicate of this bug: 1831776
No longer duplicate of this bug: 1906027
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: