Closed Bug 1621424 Opened 5 years ago Closed 3 years ago

Bypass PopUp Blocking via simulate click

Categories

(Firefox :: Security, defect, P1)

74 Branch
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox-esr68 --- affected
firefox73 --- wontfix
firefox74 --- wontfix
firefox75 --- wontfix
firefox76 --- affected

People

(Reporter: guilhermeassmannn, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: csectype-dos, reporter-external, sec-low)

Attachments

(2 files, 2 obsolete files)

Attached file simulate.html

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

Steps to reproduce:

  1. Go to https://jsfiddle.net/keer0k/bvyd2xfo/3/
  2. Run it
  3. Click in "click me"
  4. A new window will be open and, after a few seconds, more 2 windows will be opened too

Actual results:

3 windows are opening

Expected results:

only one window needs to open

Ok, yeah, this is pretty bad. Modifying your test case I can spawn an unlimited amount of popups with arbitrary delay and rhythm, DOSing the browser and heavily affecting the OS as well.

Baku, this should be fixed as of bug 675574, but apparently this presents a loophole. Do you have time to look into the bug or should we ask someone else?

Blocks: eviltraps
Status: UNCONFIRMED → NEW
Component: Untriaged → Security
Ever confirmed: true
Flags: needinfo?(amarchesini)
Keywords: csectype-dos
Priority: -- → P1

Perhaps related to bug 1185052?

Huh, thought we had fixed this one. Interesting bypass.

Keywords: sec-low

This is not related to the simulated click. The problem is this:

  1. the user clicks on the button. This button runs X times a function which (directly or indirectly) creates a timer.
  2. Now we have X timers, each one of them created by user-interaction.
  3. When those timers run, they are all allowed to open a window.

A simple version of that test is:

for (let i = 0; i < 3; i++) {
  document.getElementById("button").addEventListener('click', () => {
    setTimeout(() => window.open(location.href,"_blank","toolbar=yes,scrollbars=yes,resizable=yes,top=500,left=500,width=400,height=400"));
  });
}
Flags: needinfo?(amarchesini)

(In reply to Andrea Marchesini [:baku] from comment #5)

This is not related to the simulated click. The problem is this:

  1. the user clicks on the button. This button runs X times a function which (directly or indirectly) creates a timer.
  2. Now we have X timers, each one of them created by user-interaction.
  3. When those timers run, they are all allowed to open a window.

So in bug 675574 when you patched things to only allow 1 popup per event - is the event tracked on something other than the timer? Can we somehow refer back to this "original" event where we will have switched the blocked state to blocked?

Flags: needinfo?(amarchesini)
Flags: needinfo?(amarchesini)
Assignee: nobody → amarchesini

Edgar, you may have an opinion on the approach here.
See the patch and my comment there.

Flags: needinfo?(echen)

Commented on the Phabricator.

Flags: needinfo?(echen)

What can we do to make progress here?

Flags: needinfo?(jhofmann)
Flags: needinfo?(amarchesini)

Baku isn't currently working on Gecko stuff AFAIK and I'm just recovering from leave. I'd be interested in following up to this but realistically I'll have to leave the needinfo open for a bit.

I'll also bring this up with Paul to see if he has any cycles to look at it.

is this report eligible for the bug bounty program in the category "Persistent-DOS of browser across restarts or a DOS requiring reboot of user’s computer"?

also, because this open other possibilities to exploit xss in SOME Attack scenarios

Flags: sec-bounty?
Flags: sec-bounty? → sec-bounty-

I think this is fixed now, maybe through the user activation changes in popup blocker?

Guilherme, in case you're still around, can you confirm whether this is still reproducible for you?

Flags: needinfo?(jhofmann)
Flags: needinfo?(guilhermeassmannn)
Flags: needinfo?(amarchesini)
Assignee: amarchesini → nobody

Oops, PEBKAC - looks like I had allowed popups for jsfiddle on my main profile. 😅

Guilherme, in case you're still around, can you confirm whether this is still reproducible for you?

So this question stands, then.

(In reply to Johann Hofmann [:johannh] from comment #16)

I think this is fixed now, maybe through the user activation changes in popup blocker?

Yeah, I think this might be fixed after the popup blocker partly adopt the user activation changes, I will double check again.

Flags: needinfo?(echen)

I think this is fixed after the popup blocker starts consuming the user activation while opening a popup.
Lets close this. Guilherme, feel free to reopen it or file a new bug if you still reproduce this.

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(guilhermeassmannn)
Flags: needinfo?(echen)
Resolution: --- → WORKSFORME
Group: firefox-core-security
Attachment #9136378 - Attachment is obsolete: true
Attachment #9136377 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: