Open Bug 1741034 Opened 3 years ago Updated 6 months ago

Guessing the URL a cross-origin iframe was redirected to by listening and counting the number of load events

Categories

(Core :: DOM: Navigation, defect, P2)

defect

Tracking

()

ASSIGNED

People

(Reporter: luan.herrera, Assigned: farre)

References

(Blocks 1 open bug)

Details

(Keywords: csectype-disclosure, reporter-external, sec-moderate, Whiteboard: [xs-leaks][reporter-external] [client-bounty-form] [verif?])

Attachments

(5 files)

Attached file attack.html

It is possible to try to guess the URL that a cross-origin iframe was redirected to by listening to the load event of the iframe and then redirecting it to the URL you are trying to guess appended by a random hash.

After that, there are two possible outcomes:

  1. If you redirect the iframe to the correct URL the iframe was redirected to, no load event will be triggered.
  2. If you redirect the iframe to a different URL the iframe was redirected to, the load event will be triggered.

An attacker then would be able to infer the current URL of the cross-origin iframe and thus leak sensitive information that shouldn't be available to them.

This issue is similar to two Chrome bugs (https://bugs.chromium.org/p/chromium/issues/detail?id=1208614 and https://bugs.chromium.org/p/chromium/issues/detail?id=1248444) that were fixed recently but unfortunately are still private.

VERSION
Version: 94.0.1 (64-bit)
Version: 95.0b6 (64-bit)
Operating System: Windows 10

REPRODUCTION CASE

  1. Download both "me.php" and "victimName.php" and host the files in a PHP server (this is needed to simulate the targeted redirect you want to leak information from).
  2. Download "attack.html" (you don't need to host it on a server).
  3. In the "attack.html" file you will need to change the domains of the URLs located in the "tryToGuessURL" function calls so that they match the correct domain of your server. By default, the attack is assuming the files can be found on "http://localhost/victimName.php" and "http://localhost/me.php".
  4. Open the "index.html" file and after a few seconds two alert dialogs will show up saying whether you correctly guessed the URL that the iframe was redirected or not.

CREDIT INFORMATION
Reporter credit: Luan Herrera (@lbherrera_)

Flags: sec-bounty?
Attached file me.php
Attached file victimName.php
Group: firefox-core-security → dom-core-security
Component: Security → DOM: Core & HTML
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Type: task → defect
Ever confirmed: true
Keywords: sec-moderate
Whiteboard: [reporter-external] [client-bounty-form] [verif?] → [xs-leaks][reporter-external] [client-bounty-form] [verif?]
Severity: -- → S3

b/w S2 and S3 - S3 because a prerequisite may be a infinite number of url guesses in advance that to some extent eases the level of how critical this is. However, given chrome fixed this, we should fix this rather than letting it sitting in our backlog.

Severity: S3 → S2

Annevk, isn't this a spec issue?

Flags: needinfo?(annevk)

Yeah it is, there's a variety of leaks due to the cross-origin load event. I hadn't seen this particular variant before though. Nice work Luan!

The mitigation Chrome added seems pretty susceptible to timing attacks? However, I don't have anything better.

As for fixing the specification, I suspect we want to wait until all browsers have fixed this. Has this also been reported against WebKit?

Component: DOM: Core & HTML → DOM: Navigation
Flags: needinfo?(annevk)

(In reply to Anne (:annevk) from comment #6)

As for fixing the specification, I suspect we want to wait until all browsers have fixed this. Has this also been reported against WebKit?

(needinfo for this question)

Flags: needinfo?(luan.herrera)

FWIW, one of the similar Chrome bugs from the reporter is now public: https://bugs.chromium.org/p/chromium/issues/detail?id=1248444

Redirect a needinfo that is pending on an inactive user to the triage owner.
:hsinyi, since the bug has high severity and recent activity, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(luan.herrera) → needinfo?(htsai)
Flags: needinfo?(htsai)
See Also: → 1774951

(In reply to Andrew McCreight [:mccr8] from comment #8)

FWIW, one of the similar Chrome bugs from the reporter is now public: https://bugs.chromium.org/p/chromium/issues/detail?id=1248444

I am thinking that we should give it a higher priority now that Chrome bug is public. Per comment 6, Chrome's fix is a hack but there's probably nothing else that can be done.

Kris, can you please take this? Thanks!

Flags: needinfo?(kmaglione+bmo)

I'm not so much worried that Chrome's fix is a hack, but I am worried that Anna is right about timing attacks. The fake load event for same-document navigations would be fired almost immediately, while even in the best caching circumstances, it would take at least tens if not hundreds of milliseconds in the fake load event case.

I'm tempted to record how long it took from when the request was initiated to the time the load event fired, and wait approximately that long before firing the fake load event. It may be a bit tricky, though.

Flags: needinfo?(kmaglione+bmo)
Assignee: nobody → kmaglione+bmo
Blocks: xs-leaks
Group: dom-core-security
Flags: sec-bounty? → sec-bounty+

Unhiding because the chrome bug is already public and we've picked up a couple of dupes

Attachment #9250579 - Attachment mime type: application/octet-stream → text/plain
Attachment #9250580 - Attachment mime type: application/octet-stream → text/plain
Assignee: kmaglione+bmo → nobody
Assignee: nobody → afarre
Status: NEW → ASSIGNED
Blocks: 1883878
No longer blocks: 1883878
See Also: → 1883878

This worked out better than I expected. It still avoids solving the timing issue, but it aligns us with how Chromium and WebKit works.

Severity: S2 → S3
Priority: -- → P2
Duplicate of this bug: 1895237
See Also: → 1895237
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: