Skip to content
Memory corruption Disclosed report Advanced

Check for unsigned overflow in inline array allocation

Nan Wang Follow

Originally disclosed on Mozilla

  • Fixed in 7 days
  • Paid in 12 days
  • Disclosed after 7 days

Created attachment 9388363 poc.js

Reproduce

  1. Clone the Firefox mirror from https://github.com/mozilla/gecko-dev
  2. Run build command mkdir fuzzbuild_OPT.OBJ && cd fuzzbuild_OPT.OBJ && ../configure --enable-address-sanitizer --disable-jemalloc --enable-debug --enable-optimize --disable-shared-js --enable-application=js --enable-gczeal && make -j64 in the js/src directory of the firefox checkout
  3. Run poc: js/src/fuzzbuild_OPT.OBJ/dist/bin/js --wasm-compiler=baseline poc.js
  • my test spidermonkey commit hash
commit da2c1e64cc7aa8718fb92eb602136da5d505d664 (HEAD -> master, origin/master, origin/HEAD)
Author: Robin Steuber <[address removed]>
Date:   Thu Feb 29 08:23:07 2024 +0000

    Bug 1882322 - Prevent macOS channel frameworks from being in precomplete file r=jcristau

    Differential Revision: https://phabricator.services.mozilla.com/D203054

Asan log

/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js --wasm-compiler=baseline poc.js
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2692978==ERROR: AddressSanitizer: SEGV on unknown address 0x7f101e600954 (pc 0x2b2979b666b9 bp 0x7ffd0dc9d730 sp 0x7ffd0dc9d6c0 T0)
==2692978==The signal is caused by a WRITE memory access.
    #0 0x2b2979b666b9  ([anon:js-executable-memory]+0x6b9)
    #1 0x2b2979b67cbe  ([anon:js-executable-memory]+0x1cbe)
    #2 0x558186a8444d  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x65c144d) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #3 0x558186abb230  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x65f8230) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #4 0x5581833bc01e  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2ef901e) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #5 0x55818334c8b8  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2e898b8) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #6 0x55818337970a  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2eb670a) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #7 0x55818334b6bc  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2e886bc) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #8 0x55818334a7d6  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2e877d6) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #9 0x558183353584  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2e90584) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #10 0x55818335429e  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2e9129e) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #11 0x5581837b2f9b  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x32eff9b) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #12 0x5581837b359d  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x32f059d) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #13 0x55818316c6a3  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2ca96a3) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #14 0x55818316a3d0  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2ca73d0) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #15 0x5581830b61af  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2bf31af) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #16 0x5581830a61f8  (/home/test/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js+0x2be31f8) (BuildId: d1d71326c86c49f03a89ce7878424135)
    #17 0x7f0e1ee29d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: c289da5071a3399de893d2af81d6a30c62646e1e)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ([anon:js-executable-memory]+0x6b9)
==2692978==ABORTING

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

What is known

A high-severity memory corruption bug in JavaScript: WebAssembly. Mozilla made it public on 7 March 2024.

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

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 Nan Wang

View all

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