Heap-use-after-free in mozilla::dom::HTMLMediaElement::LookupMediaElementURITable
Originally disclosed on Mozilla
- Fixed in 44 days
- Paid in 26 days
- Disclosed after 44 days
Created attachment 741645 Testcase
Needs fuzzPriv extension to force gc. Let the testcase reload a couple of times and you should see a crash.
==29697== ERROR: AddressSanitizer: heap-use-after-free on address 0x6048007cc018 at pc 0x7f37966c651e bp 0x7fff45e783b0 sp 0x7fff45e783a8 READ of size 8 at 0x6048007cc018 thread T0 #0 0x7f37966c651d in nsCOMPtr<nsINodeInfo>::get() const objdir-ff-asan-sym/media/webrtc/signaling/signaling_ecc/../../../../dist/include/nsCOMPtr.h:782 #1 0x7f37966c618e in nsCOMPtr<nsINodeInfo>::operator->() const objdir-ff-asan-sym/media/webrtc/signaling/signaling_ecc/../../../../dist/include/nsCOMPtr.h:802 #2 0x7f37966b2b78 in nsINode::NodePrincipal() const objdir-ff-asan-sym/media/webrtc/signaling/signaling_ecc/../../../../dist/include/nsINode.h:744 #3 0x7f379a06126c in mozilla::dom::HTMLMediaElement::LookupMediaElementURITable(nsIURI*) content/html/content/src/HTMLMediaElement.cpp:1863 #4 0x7f379a05a23e in mozilla::dom::HTMLMediaElement::LoadResource() content/html/content/src/HTMLMediaElement.cpp:1073 #5 0x7f379a054443 in mozilla::dom::HTMLMediaElement::LoadFromSourceChildren() content/html/content/src/HTMLMediaElement.cpp:926 #6 0x7f379a0add22 in mozilla::dom::nsSyncSection::Run() content/html/content/src/HTMLMediaElement.cpp:672 #7 0x7f379fd84000 in nsBaseAppShell::RunSyncSectionsInternal(bool, unsigned int) widget/xpwidgets/nsBaseAppShell.cpp:352 #8 0x7f379fd7feca in nsBaseAppShell::RunSyncSections(bool, unsigned int) widget/xpwidgets/nsBaseAppShell.h:89 #9 0x7f379fd8576d in nsBaseAppShell::AfterProcessNextEvent(nsIThreadInternal*, unsigned int) widget/xpwidgets/nsBaseAppShell.cpp:408 #10 0x7f379fd859f1 in non-virtual thunk to nsBaseAppShell::AfterProcessNextEvent(nsIThreadInternal*, unsigned int) widget/xpwidgets/nsBaseAppShell.cpp:410 #11 0x7f37a4062218 in nsThread::ProcessNextEvent(bool, bool*) xpcom/threads/nsThread.cpp:640 #12 0x7f37a3d0c532 in NS_ProcessNextEvent(nsIThread*, bool) objdir-ff-asan-sym/xpcom/build/nsThreadUtils.cpp:238 #13 0x7f37a096c8a9 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) ipc/glue/MessagePump.cpp:82 #14 0x7f37a4378d1b in MessageLoop::RunInternal() ipc/chromium/src/base/message_loop.cc:219 #15 0x7f37a4378b6e in MessageLoop::RunHandler() ipc/chromium/src/base/message_loop.cc:212 #16 0x7f37a4378a59 in MessageLoop::Run() ipc/chromium/src/base/message_loop.cc:186 #17 0x7f379fd801ae in nsBaseAppShell::Run() widget/xpwidgets/nsBaseAppShell.cpp:163 #18 0x7f379ea6da40 in nsAppStartup::Run() toolkit/components/startup/nsAppStartup.cpp:289 #19 0x7f3794aadaeb in XREMain::XRE_mainRun() toolkit/xre/nsAppRunner.cpp:3878 #20 0x7f3794ab31b0 in XREMain::XRE_main(int, char**, nsXREAppData const*) toolkit/xre/nsAppRunner.cpp:3945 #21 0x7f3794ab5e75 in XRE_main toolkit/xre/nsAppRunner.cpp:4146 #22 0x427c57 in do_main(int, char**, nsIFile*) browser/app/nsBrowserApp.cpp:271 #23 0x424e11 in main browser/app/nsBrowserApp.cpp:576 #24 0x7f37b6ac576c in #25 0x424584 in 0x6048007cc018 is located 24 bytes inside of 472-byte region [0x6048007cc000,0x6048007cc1d8) freed by thread T0 here: #0 0x4183f2 in __interceptor_free #1 0x7f37b483f6ce in moz_free memory/mozalloc/mozalloc.cpp:48 #2 0x7f379a6e7cc9 in operator delete(void*) ../../../../dist/include/mozilla/mozalloc.h:225 #3 0x7f379a6e7cc9 in mozilla::dom::HTMLVideoElement::~HTMLVideoElement() content/html/content/src/HTMLVideoElement.cpp:78 #4 0x7f3798cef9c5 in nsNodeUtils::LastRelease(nsINode*) content/base/src/nsNodeUtils.cpp:258 #5 0x7f3798f9a2fa in mozilla::dom::FragmentOrElement::Release() content/base/src/FragmentOrElement.cpp:1716 #6 0x7f379a044d75 in mozilla::dom::HTMLMediaElement::Release() content/html/content/src/HTMLMediaElement.cpp:402 #7 0x7f379a6e3c85 in mozilla::dom::HTMLVideoElement::Release() content/html/content/src/HTMLVideoElement.cpp:42 #8 0x7f379dd4e4a0 in _ZL17DoDeferredReleaseIP11nsISupportsEvR8nsTArrayIT_E js/xpconnect/src/XPCJSRuntime.cpp:614 #9 0x7f379dd4d971 in XPCJSRuntime::GCCallback(JSRuntime*, JSGCStatus) js/xpconnect/src/XPCJSRuntime.cpp:814 #10 0x7f37ab9e702c in Collect(JSRuntime*, bool, long, js::JSGCInvocationKind, JS::gcreason::Reason) js/src/jsgc.cpp:4611 #11 0x7f37ab9d7924 in js::GC(JSRuntime*, js::JSGCInvocationKind, JS::gcreason::Reason) js/src/jsgc.cpp:4628 #12 0x7f37ab94c4b9 in JS::GCForReason(JSRuntime*, JS::gcreason::Reason) js/src/jsfriendapi.cpp:180 #13 0x7f379dc5df7e in nsXPCComponents_Utils::ForceGC() js/xpconnect/src/XPCComponents.cpp:4106 #14 0x7f37a4182f7b in NS_InvokeByIndex xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:162 #15 0x7f379dea35af in CallMethodHelper::Invoke() js/xpconnect/src/XPCWrappedNative.cpp:2948 #16 0x7f379dea35af in CallMethodHelper::Call() js/xpconnect/src/XPCWrappedNative.cpp:2282 #17 0x7f379dea35af in XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) js/xpconnect/src/XPCWrappedNative.cpp:2248 #18 0x7f379defc7e1 in XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1486 #19 0x7f37abc38ccf in js::CallJSNative(JSContext*, int ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) js/src/jscntxtinlines.h:337 #20 0x7f37abc38ccf in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:407 #21 0x7f37abc121a0 in js::Interpret(JSContext*, js::StackFrame*, js::InterpMode, bool) js/src/jsinterp.cpp:2396 #22 0x7f37abbbd64d in js::RunScript(JSContext*, js::StackFrame*) js/src/jsinterp.cpp:364 #23 0x7f37abc39378 in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:421 #24 0x7f37ab65a836 in js::Invoke(JSContext*, js::InvokeArgsGuard&, js::MaybeConstruct) js/src/jsinterp.h:134 #25 0x7f37abc3cdd0 in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::Value*) js/src/jsinterp.cpp:454 #26 0x7f37abf6b52d in js::DirectProxyHandler::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) js/src/jsproxy.cpp:481 #27 0x7f37ac5ae772 in js::CrossCompartmentWrapper::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) js/src/jswrapper.cpp:453 #28 0x7f37abfd499e in js::Proxy::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) js/src/jsproxy.cpp:2613 #29 0x7f37abff1e9a in proxy_Call(JSContext*, unsigned int, JS::Value*) js/src/jsproxy.cpp:3177 #30 0x7f37abc385c2 in js::CallJSNative(JSContext*, int ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) js/src/jscntxtinlines.h:337 #31 0x7f37abc385c2 in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:400 #32 0x7f37abc121a0 in js::Interpret(JSContext*, js::StackFrame*, js::InterpMode, bool) js/src/jsinterp.cpp:2396 #33 0x7f37abbbd64d in js::RunScript(JSContext*, js::StackFrame*) js/src/jsinterp.cpp:364 #34 0x7f37abc4275b in js::ExecuteKernel(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value const&, js::ExecuteType, js::AbstractFramePtr, JS::Value*) js/src/jsinterp.cpp:552 previously allocated by thread T0 here: #0 0x4184d2 in malloc #1 0x7f37b483f815 in moz_xmalloc memory/mozalloc/mozalloc.cpp:54 #2 0x7f379a6e34ce in operator new(unsigned long) ../../../../dist/include/mozilla/mozalloc.h:201 #3 0x7f379a6e34ce in nsGenericHTMLElement* mozilla::dom::NewHTMLElementHelper::Create<nsHTMLVideoElement, mozilla::dom::HTMLVideoElement>(already_AddRefed<nsINodeInfo>, mozilla::dom::NewHTMLElementHelper::SFINAE<bool ()(nsIDocument), mozilla::dom::HTMLVideoElement::InNavQuirksMode>) content/html/content/src/nsGenericHTMLElement.h:1855 #4 0x7f379a6e32db in NS_NewHTMLVideoElement(already_AddRefed<nsINodeInfo>, mozilla::dom::FromParser) content/html/content/src/HTMLVideoElement.cpp:36 #5 0x7f379a7a8bb1 in CreateHTMLElement(unsigned int, already_AddRefed<nsINodeInfo>, mozilla::dom::FromParser) content/html/document/src/nsHTMLContentSink.cpp:498 #6 0x7f379a7a9375 in NS_NewHTMLElement(nsIContent**, already_AddRefed<nsINodeInfo>, mozilla::dom::FromParser) content/html/document/src/nsHTMLContentSink.cpp:481 #7 0x7f3798cbe79a in NS_NewElement(nsIContent**, already_AddRefed<nsINodeInfo>, mozilla::dom::FromParser) content/base/src/nsNameSpaceManager.cpp:192 #8 0x7f379c6d9ee0 in nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor, nsIContent**) parser/html/nsHtml5TreeOperation.cpp:349 #9 0x7f379c6f89a5 in nsHtml5TreeOpExecutor::RunFlushLoop() parser/html/nsHtml5TreeOpExecutor.cpp:557 #10 0x7f379c732fb2 in nsHtml5ExecutorFlusher::Run() parser/html/nsHtml5StreamParser.cpp:125 #11 0x7f37a4061da7 in nsThread::ProcessNextEvent(bool, bool*) xpcom/threads/nsThread.cpp:627 #12 0x7f37a3d0c532 in NS_ProcessNextEvent(nsIThread*, bool) objdir-ff-asan-sym/xpcom/build/nsThreadUtils.cpp:238 #13 0x7f37a096c8a9 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) ipc/glue/MessagePump.cpp:82 #14 0x7f37a4378d1b in MessageLoop::RunInternal() ipc/chromium/src/base/message_loop.cc:219 #15 0x7f37a4378b6e in MessageLoop::RunHandler() ipc/chromium/src/base/message_loop.cc:212 #16 0x7f37a4378a59 in MessageLoop::Run() ipc/chromium/src/base/message_loop.cc:186 #17 0x7f379fd801ae in nsBaseAppShell::Run() widget/xpwidgets/nsBaseAppShell.cpp:163 #18 0x7f379ea6da40 in nsAppStartup::Run() toolkit/components/startup/nsAppStartup.cpp:289 #19 0x7f3794aadaeb in XREMain::XRE_mainRun() toolkit/xre/nsAppRunner.cpp:3878 #20 0x7f3794ab31b0 in XREMain::XRE_main(int, char**, nsXREAppData const*) toolkit/xre/nsAppRunner.cpp:3945 #21 0x7f3794ab5e75 in XRE_main toolkit/xre/nsAppRunner.cpp:4146 #22 0x427c57 in do_main(int, char**, nsIFile*) browser/app/nsBrowserApp.cpp:271 #23 0x424e11 in main browser/app/nsBrowserApp.cpp:576 #24 0x7f37b6ac576c in Shadow bytes around the buggy address: 0x0c09800f17b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c09800f17c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c09800f17d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c09800f17e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c09800f17f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c09800f1800: fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd 0x0c09800f1810: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c09800f1820: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c09800f1830: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa 0x0c09800f1840: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c09800f1850: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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 righ 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 ASan internal: fe ==29697== ABORTING
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 critical-severity memory corruption bug in Audio/Video. Mozilla made it public on 7 June 2013 as CVE-2013-1684.
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.