Skip to content
Misconfiguration Disclosed report Advanced CVE-2024-5687

Incorrect triggeringPrincipal used in new windows to load manually entered URLs

When a user manually types or pastes a URL into a tab that was opened from another page, the browser keeps the parent page's triggering principal, so the new navigation inherits the wrong referrer and Sec-Fetch headers. An attacker could use this to make requests appear to originate from a trusted site rather than from manual entry.

Daniel Veditz Follow

Originally disclosed on Mozilla

  • Fixed in 36 days
  • Paid in 42 days
  • Disclosed after 36 days
Text
Created from bug 1863662 comment 16 by jackyzy823 (see also bug 1863662 comment 10)
> This is not only related to ReaderView.
> 
> This is quite a deep security bug. It is related to security design.
> 
> If a url is manually typed and opened in a already loaded tab (this tab has a parent tab, so it has parentId and referrerSessionId ) , should the triggerPrinciple, csp, referrerInfo of the parent tab be inherited?
> 
> For example
> 
> 1. Open "https://example.com"
> 2. Long click on "More Information" and click open link in new tab
> 3. Switch to the new created tab which url is https://www.iana.org/help/example-domains
> 4. Manually input a url "https://httpbin.org/headers" in the addressbar
> 5. Observe the "Referer : example.com" is in the page. (this should not happens)

This is not limited to windows where the user long-clicks to open a new window: it also seems to be the same if a site opens a new window on a link press. I'm not sure yet if target=_blank has this effect, but window.open() sure does.

Example 1:
* open https://twitter.com/firefox/status/1774831670795129122. in the second tweet click the mzl.la/firefoxsauce link which opens a new window
* type (or paste) https://httpbin.org/headers into the URL bar

result: referrer will be twitter.com rather than m.youtube.com

Example 2:
* go to any story on https://www.cnn.com
* click in an ad, which opens a new window
* type (or paste) https://httpbin.org/headers into the URL bar

result: referrer will be cnn.com rather than the site that's showing the ad.

Notice also that the `Sec-Fetch-`  headers are wrong. `Sec-Fetch-Site:` should say "none", but it says "cross-site", and the `Sec-Fetch-User: ?1` is missing entirely. I get the same incorrect results if I use a bookmark rather than typing it.

Even from the home page in a brand new tab the Sec-Fetch- headers show something is wrong with the triggering principal: there's no -User header to show manual entry and the -Site says "cross-site" instead of "none". It looks like in this case we're using the Home page itself as the originator or something.

A "wrong referrer" may not be the end of the world, but it shows a scary confusion and is probably just the tip of the iceberg of potential problems. We have a ton of security policy checks in Gecko that critically depend on using the correct principals. And getting into this bad state doesn't depend on convincing a user to long-press; a malicious site could do it themselves if they're interesting enough to get the user to click on something (like a big panel covering 3/4 of the screen saying "This is not a paywall, but journalism isn't free. Please subscribe and support the information you rely on [sign up] [log in] [continue to article]"

The original report as published on Mozilla's Bugzilla, by Daniel Veditz. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the browser reuses the parent tab's triggering principal, CSP and referrer information for navigations in a child tab even when the user manually enters a new URL.

Impact

Requests made after manual entry could carry a misleading referrer and incorrect Sec-Fetch headers, which may undermine security checks that rely on the correct principal; the text notes this is likely just the tip of the iceberg.

What the attacker needed

Victim opens a link in a new tab; victim types or pastes a URL

How it was found

  1. Open a page that contains a link.
  2. Open the link in a new tab or window.
  3. Switch to the new tab.
  4. Type or paste a different URL into the address bar.
  5. Observe that the request carries the original page as referrer and wrong Sec-Fetch headers.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you open a link in a new tab, the browser remembers which page opened it. If you then type a different address into that tab, the browser should forget the old page, but here it does not, so the new site is told the wrong page sent you. That wrong information can be abused to make a request look like it came from a trusted site.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by Daniel Veditz

View all

13 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.