Skip to content
Memory corruption Disclosed report Advanced CVE-2024-9396

Assertion failure: data == JS::SCTAG_TMO_ALLOC_DATA || data == JS::SCTAG_TMO_MAPPED_DATA, at js/src/vm/StructuredClone.cpp:3457

A debug assertion in the JavaScript engine's structured clone code fails when processing a crafted test case, indicating an internal invariant about transferable object data tags is violated. The text does not describe any attacker impact beyond crashing the debug build.

Nils Bars Follow

Originally disclosed on Mozilla

  • Fixed in 26 days
  • Paid in 32 days
  • Disclosed after 26 days
Text
Created attachment 9418558
bug.js

Steps to reproduce:

Checkout commit ef4ef8198add3192d1e49157fb3f377ea7e60009 and invoke the js shell as follows:
'''
js --fuzzing-safe <test-case>
'''


Actual results:

'''
Assertion failure: data == JS::SCTAG_TMO_ALLOC_DATA || data == JS::SCTAG_TMO_MAPPED_DATA, at js/src/vm/StructuredClone.cpp:3457
'''

The original report as published on Mozilla's Bugzilla, by Nils Bars. 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 the structured clone implementation mishandles the data tag of a transferred object, so the expected alloc/mapped tag invariant does not hold.

Impact

The crafted input triggers an assertion failure that aborts the debug build; the text does not show any effect on release builds or any security consequence.

What the attacker needed

Debug build of the js shell; fuzzing-safe mode; crafted test case

How it was found

  1. Check out the specified commit of the engine source.
  2. Run the js shell with fuzzing-safe mode on the provided test case.
  3. Observe the assertion failure in StructuredClone.cpp.

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.

A JavaScript engine has a debug-only check that stops the program if an internal assumption turns out to be wrong. Here a specially crafted script made that check fail, which means the engine's own bookkeeping about moved memory was inconsistent. The report only shows a crash in a debug build, not what a real attacker could do.

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 Nils Bars

View all

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