Leaking cross-origin iframe URLs using history.length
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
People
(Reporter: sivaneshashok, Unassigned)
References
Details
(Keywords: reporter-external, Whiteboard: [reporter-external] [client-bounty-form] [verif?])
When an iframe is navigated to its current URL, the value of history.length does not increase. However, when it's replaced with any other URL, the value of history.length increases by 1.
This behavior could be used to find the exact URL of an iframe, even if it is cross-origin.
Tested on - Firefox Browser 95.0.2 (64-bit)
STEPS TO REPRODUCE:
- Host an HTML file with the following contents
<html><body><iframe src="http://example.com/secret"></body></html> - Open browser's console and check history.length
- Run the following in console - window.frames[0].location = "http://example.com/secret"
- Now, check history.length, and it should be the same as before.
- Run the following in console - window.frames[0].location = "http://example.com/abc"
- Now history.length would have increased.
This behavior could be automated to find the exact URL of the cross-origin iframe.
ATTACK SCENARIO:
A cross-origin page could potentially exploit this to find out the exact URL of the cross-origin iframe, which could leak sensitive information.
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Various history.length related issues are discussed in the spec issue https://github.com/whatwg/html/issues/2018
(and IIRC there are also other related HTML spec issues open)
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•11 months ago
|
Description
•