History navigation error with late location.hash changes
Originally disclosed on Mozilla
- Fixed in 15 days
- Paid in 14 months
- Disclosed after 15 days
This is basically another flavor of bug 687745, the impact is identical.
It is possible to confuse the URL navigation in the browser, such that the user input on a victim site is redirected to a location on the attacker's server. The bug exists in the history navigation, which incorrectly handles calls to history.forward and history.back that are immediately followed by a write to location.hash. Suppose the history object is in the following state:
[0]: 'http://attacker/' (active)
[1]: 'http://victim/'
Calling history.forward on the attacker's website will redirect a user to the victim website. If location.hash is set before the attacker's script is terminated, the history object will be in the following state after opening http://victim/:
[0]: 'http://attacker/'
[1]: 'http://attacker/#hash' (active)
There's a discrepancy between the displayed page/URL bar and the address stored in history. Calling history.back() will set baseURI back to http://attacker/ (thus all user input will be posted there), but since that's only a hash change in the "confused" history object, the page will not be reloaded and will still display the content of the victim's website. The Larry badge for HTTPS websites will also continue to show the victim's domain name.
Although, as Daniel noted in bug 687745 comment 21, as a spoof it's on par with a typical phishing attack (though with a convincing Larry badge), the attacker may delay the call to history.back until the user is busy filling out the forms. The URL shift is completely seamless and will not reset any input. I've implemented this in the PoC as a 7 second delay between the loading of Mozilla Sync login page and navigating back to change the baseURI.
Verified to work with the latest Nightly (15.0a1 2012-05-21) and the release build (12.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A high-severity security bug in DOM: Navigation. Mozilla made it public on 6 June 2012 as CVE-2012-1955.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.