Skip to content
Memory corruption Disclosed report

Global-buffer-overflow in MessageChannel

Abhishek Arya Follow

Originally disclosed on Mozilla

  • Fixed in 22 days
  • Paid in 6 months
  • Disclosed after 22 days
Text
Created attachment 8630259
test.html

=================================================================
==36990==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fb88c372488 at pc 0x7fb8840de736 bp 0x7fff92b6b900 sp 0x7fff92b6b8f8
READ of size 8 at 0x7fb88c372488 thread T0 (Web Content)
    #0 0x7fb8840de735 in operator[] /build/firefox/src/objdir-ff-asan/dom/messagechannel/../../dist/include/nsTArray.h:488
    #1 0x7fb887f9a277 in DiscardTransferables /build/firefox/src/js/src/vm/StructuredClone.cpp:428
    #2 0x7fb887fac7c1 in JS_ClearStructuredClone /build/firefox/src/js/src/vm/StructuredClone.cpp:1913
    #3 0x7fb8840d9954 in FreeStructuredClone /build/firefox/src/dom/messagechannel/MessagePortUtils.cpp:285
    #4 0x7fb8840d1d0e in Release /build/firefox/src/dom/messagechannel/SharedMessagePortMessage.h:21 (discriminator 20)
    #5 0x7fb8840cce6f in ~nsTArray_Impl /build/firefox/src/objdir-ff-asan/dom/messagechannel/../../dist/include/nsTArray.h:827
    #6 0x7fb8840cd4ad in ~MessagePort /build/firefox/src/dom/messagechannel/MessagePort.cpp:311
    #7 0x7fb87ea494ef in ~SnowWhiteKiller /build/firefox/src/xpcom/base/nsCycleCollector.cpp:2638
    #8 0x7fb87ea4901e in FreeSnowWhite /build/firefox/src/xpcom/base/nsCycleCollector.cpp:2806 (discriminator 1)
    #9 0x7fb87fed8304 in Run /build/firefox/src/js/xpconnect/src/XPCJSRuntime.cpp:139
    #10 0x7fb87eb527d6 in ProcessNextEvent /build/firefox/src/xpcom/threads/nsThread.cpp:848
    #11 0x7fb87ebcb41c in NS_ProcessNextEvent /build/firefox/src/xpcom/glue/nsThreadUtils.cpp:265
    #12 0x7fb87f47e38e in Run /build/firefox/src/ipc/glue/MessagePump.cpp:95
    #13 0x7fb87f408fb1 in RunInternal /build/firefox/src/ipc/chromium/src/base/message_loop.cc:234
    #14 0x7fb8844d677f in _ZN14nsBaseAppShell3RunEv /build/firefox/src/widget/nsBaseAppShell.cpp:165
    #15 0x7fb88642ae03 in XRE_RunAppShell /build/firefox/src/toolkit/xre/nsEmbedFunctions.cpp:778
    #16 0x7fb87f408fb1 in RunInternal /build/firefox/src/ipc/chromium/src/base/message_loop.cc:234
    #17 0x7fb88642a327 in XRE_InitChildProcess /build/firefox/src/toolkit/xre/nsEmbedFunctions.cpp:614
    #18 0x4dbbb2 in content_process_main /build/firefox/src/ipc/app/../contentproc/plugin-container.cpp:236
    #19 0x7fb87bf27ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287
    #20 0x41d403 in _start ??:?

0x7fb88c372488 is located 0 bytes to the right of global variable 'nsTArrayHeader::sEmptyHdr' defined in '/build/firefox/src/xpcom/glue/nsTArray.cpp:13:32' (0x7fb88c372480) of size 8
Shadow bytes around the buggy address:
  0x0ff791866440: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0ff791866450: 01 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0ff791866460: 01 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0ff791866470: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0ff791866480: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
=>0x0ff791866490: 00[f9]f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x0ff7918664a0: 00 00 00 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0ff7918664b0: 01 f9 f9 f9 f9 f9 f9 f9 01 f9 f9 f9 f9 f9 f9 f9
  0x0ff7918664c0: 01 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0ff7918664d0: 01 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0ff7918664e0: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==36990==ABORTING

The original report as published on Mozilla's Bugzilla, by Abhishek Arya. 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 DOM: Service Workers. Mozilla made it public on 28 July 2015.

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 Abhishek Arya

View all

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