Skip to content
Memory corruption Disclosed report Advanced CVE-2023-4578

Access Violation on IsPatternMatching -> JS_GetProperty -> JS_ForwardGetPropertyTo

A crafted HTML page that exhausts virtual memory and then calls an invalid JavaScript function inside a try/catch with a pattern causes Firefox to crash in JS_GetProperty. On 64-bit builds the crash address is dynamic, suggesting a memory corruption issue.

Irvan Kurniawan Follow

Originally disclosed on Mozilla

  • Fixed in 35 days
  • Paid in 38 days
  • Disclosed after 35 days

Created attachment 9339698 testcase.html

After allocate memory to exhaust the process virtual memory and execute invalid JS function inside try {} catch() {} and input pattern. On Firefox 32-bit it able to crash on JS_GetProperty on address 0x000083d8, more interestingly on Firefox 64-bit it able to crash on dynamic (changing) address including 0x00050512fab2b080, 0x000514975972b080, 0x000526aa3e72b080, and more..

Currently the testcase.html is fine-tuned to make it very reliably to reproduce on Firefox 114.0.1 (32-bit) on Windows 11, I tested this very reliably crash on JS_GetProperty on both my machine Intel i9-13900k and AMD Ryzen 7 5700G, it still able to crash on Firefox Nightly 116.0a1 (2023-06-16) (32-bit), but reduced success rate and have to adjust fillMemory code to make it very reliably on Nightly. For now I decided to submit this report and adjust that later.

Tested on:

  • Firefox 114.0.1 (32-bit)
  • Firefox 114.0.1 (64-bit)
  • Firefox Nightly 116.0a1 (2023-06-16) (32-bit)
  • Firefox Nightly 116.0a1 (2023-06-16) (64-bit)

Steps to reproduce:

  1. Open Firefox 114.0.1 (32-bit)
  2. Visit attached testcase.html
  3. Wait ~20 seconds
  4. Firefox tab crashed
  5. Analyze the minidump using WinDbg
  6. Firefox crash on JS_GetProperty -> JS_ForwardGetPropertyTo

The original report as published on Mozilla's Bugzilla, by Irvan Kurniawan. 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

Root cause

Likely a memory corruption bug in the JavaScript engine's property access path (JS_GetProperty) that is triggered when the process is under memory pressure and an invalid function is called with a pattern.

Impact

An attacker could cause a denial of service (browser tab crash) and potentially achieve memory corruption, as indicated by dynamic crash addresses on 64-bit builds.

What the attacker needed

Victim visits a malicious HTML page; Firefox 32-bit or 64-bit; Sufficient memory to exhaust

How it was found

  1. Open Firefox 114.0.1 (32-bit)
  2. Visit the attached testcase.html
  3. Wait about 20 seconds
  4. The Firefox tab crashes
  5. Analyse the minidump using WinDbg
  6. Observe the crash in JS_GetProperty -> JS_ForwardGetPropertyTo

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.

This report describes a way to make the Firefox browser crash by using a lot of memory and then running some JavaScript code that triggers a bug. The crash happens deep inside the browser's engine when it tries to read a property of an object, and on 64-bit systems the crash address changes each time, which often means the program is using memory it shouldn't. The reporter provides a test file and steps to reproduce the crash.

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 Irvan Kurniawan

View all

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