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)
Tracking
()
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)
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:
- If you redirect the iframe to the correct URL the iframe was redirected to, no load event will be triggered.
- 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
- 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).
- Download "attack.html" (you don't need to host it on a server).
- 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".
- 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_)
Reporter | ||
Comment 1•3 years ago
|
||
Reporter | ||
Comment 2•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 3•3 years ago
|
||
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.
Annevk, isn't this a spec issue?
Comment 6•3 years ago
|
||
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?
Comment 7•3 years ago
|
||
(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)
Comment 8•3 years ago
|
||
FWIW, one of the similar Chrome bugs from the reporter is now public: https://bugs.chromium.org/p/chromium/issues/detail?id=1248444
Comment 9•2 years ago
|
||
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.
Updated•2 years ago
|
Comment 11•2 years ago
|
||
(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!
Comment 12•2 years ago
|
||
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.
Updated•2 years ago
|
Updated•1 year ago
|
Comment 14•1 year ago
|
||
Unhiding because the chrome bug is already public and we've picked up a couple of dupes
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 15•8 months ago
|
||
This worked out better than I expected. It still avoids solving the timing issue, but it aligns us with how Chromium and WebKit works.
Assignee | ||
Comment 16•8 months ago
|
||
Assignee | ||
Comment 17•8 months ago
|
||
Updated•8 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Description
•