Skip to content
Memory corruption Disclosed report Advanced CVE-2019-9793

Arbitrary range mis-inference due to loop phi range analysis disregarding overflows/truncation

A flaw in SpiderMonkey's loop phi range analysis ignores overflows and truncation, so the engine infers an incorrect, attacker-controlled range for a value in compiled JavaScript. An attacker could then produce an arbitrary value in compiled code, which the text says is exploitable but does not detail.

Niklas Baumstark Follow

Originally disclosed on Mozilla

  • Fixed in 3 days
  • Paid in 9 days
  • Disclosed after 3 days
Text
Created attachment 9044718
writeup.md

The bug exists in the current release and mozilla-central branches of the Spidermonkey engine included in Firefox. It exists on all platforms.

The issue lets an attacker produce an arbitrary value in compiled JavaScript code, for which the range analysis will infer a fully controlled, incorrect range. For a detailed analysis of the issue and its exploitability, along with reproducing code samples, please refer to the attached writeup.md file.

The original report as published on Mozilla's Bugzilla, by Niklas Baumstark. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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

An attacker could produce an arbitrary value in compiled JavaScript code with a fully controlled, incorrect inferred range, which the text says is exploitable but does not describe further.

What the attacker needed

Firefox with SpiderMonkey; attacker-supplied JavaScript runs in the engine

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.

Firefox runs JavaScript through an engine called SpiderMonkey, which compiles hot code and tries to guess the possible range of numbers to optimise it. This report says that guess can be wrong when a loop counter wraps around or gets cut down in size, so the optimiser trusts a range that is not true. The details are in an attachment that is not included here.

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 Niklas Baumstark

View all

8 more disclosed reports, best first.

More from Mozilla

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.