Skip to content
Memory corruption Disclosed report CVE-2014-1563

Heap-use-after-free in mozilla::DOMSVGLength::GetTearOff

Abhishek Arya Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 2 months
  • Paid in 3 months
  • Disclosed after 2 months

Created attachment 8432024 Testcase

Need fuzzPriv extension. https://www.squarefree.com/extensions/domFuzzLite3.xpi

==6521==ERROR: AddressSanitizer: heap-use-after-free on address 0x60700026a968 at pc 0x7f779d09e97a bp 0x7fff11d30870 sp 0x7fff11d30868 READ of size 8 at 0x60700026a968 thread T0 #0 0x7f779d09e979 in mozilla::DOMSVGLength::GetTearOff(nsSVGLength2*, nsSVGElement*, bool) objdir-ff-asan/content/svg/content/src/../../../../dist/include/nsISupportsImpl.h:51 #1 0x7f779d1e232f in nsSVGLength2::ToDOMAnimVal(mozilla::DOMSVGLength**, nsSVGElement*) content/svg/content/src/nsSVGLength2.cpp:336 #2 0x7f779d108850 in mozilla::dom::SVGAnimatedLength::AnimVal() content/svg/content/src/SVGAnimatedLength.cpp:37 #3 0x7f779b446989 in mozilla::dom::SVGAnimatedLengthBinding::get_animVal(JSContext*, JS::Handle<JSObject*>, mozilla::dom::SVGAnimatedLength*, JSJitGetterCallArgs) objdir-ff-asan/dom/bindings/./SVGAnimatedLengthBinding.cpp:48 #4 0x7f779b95bdfc in mozilla::dom::GenericBindingGetter(JSContext*, unsigned int, JS::Value*) dom/bindings/BindingUtils.cpp:2280 #5 0x7f77a06bd843 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jscntxtinlines.h:239 #6 0x7f77a0659b1e in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandleJS::Value) js/src/vm/Interpreter.cpp:531 #7 0x7f77a06bf5fd in js::InvokeGetterOrSetter(JSContext*, JSObject*, JS::Value, unsigned int, JS::Value*, JS::MutableHandleJS::Value) js/src/vm/Interpreter.cpp:603 #8 0x7f77a04799ff in js::baseops::GetProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::MutableHandleJS::Value) js/src/vm/Shape-inl.h:46 #9 0x7f77a06b0e19 in Interpret(JSContext*, js::RunState&) js/src/jsobj.h:984 #10 0x7f77a069615c in js::RunScript(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:422 #11 0x7f77a06bdd91 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/vm/Interpreter.cpp:494 #12 0x7f77a0659b1e in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandleJS::Value) js/src/vm/Interpreter.cpp:531 #13 0x7f77a034bdb5 in JS::Call(JSContext*, JS::HandleJS::Value, JS::HandleJS::Value, JS::HandleValueArray const&, JS::MutableHandleJS::Value) js/src/jsapi.cpp:5214 #14 0x7f779ad89131 in mozilla::dom::EventHandlerNonNull::Call(JSContext*, JS::HandleJS::Value, mozilla::dom::Event&, mozilla::ErrorResult&) objdir-ff-asan/dom/bindings/./EventHandlerBinding.cpp:35 #15 0x7f779c2a96ef in JS::Value mozilla::dom::EventHandlerNonNull::Call<nsISupports*>(nsISupports* const&, mozilla::dom::Event&, mozilla::ErrorResult&, mozilla::dom::CallbackObject::ExceptionHandling) objdir-ff-asan/dom/events/../../dist/include/mozilla/dom/EventHandlerBinding.h:62 #16 0x7f779c2a7c0f in mozilla::JSEventHandler::HandleEvent(nsIDOMEvent*) dom/events/JSEventHandler.cpp:214 #17 0x7f779c2767d0 in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, nsIDOMEvent*, mozilla::dom::EventTarget*) dom/events/EventListenerManager.cpp:950 #18 0x7f779c277b40 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent**, mozilla::dom::EventTarget*, nsEventStatus*) dom/events/EventListenerManager.cpp:1011 #19 0x7f779c268a01 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArraymozilla::EventTargetChainItem&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) dom/events/EventDispatcher.cpp:287 #20 0x7f779c26cb26 in mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsCOMArraymozilla::dom::EventTarget) dom/events/EventDispatcher.cpp:597 #21 0x7f779d7ad394 in nsDocumentViewer::LoadComplete(tag_nsresult) layout/base/nsDocumentViewer.cpp:1004 #22 0x7f779e42970b in nsDocShell::EndPageLoad(nsIWebProgress, nsIChannel*, tag_nsresult) docshell/base/nsDocShell.cpp:6963 #23 0x7f779e426899 in nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, tag_nsresult) docshell/base/nsDocShell.cpp:6762 #24 0x7f779e426cff in non-virtual thunk to nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, tag_nsresult) docshell/base/nsDocShell.cpp:6769 #25 0x7f779a2d0abb in nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, tag_nsresult) uriloader/base/nsDocLoader.cpp:1268 #26 0x7f779a2cfe02 in nsDocLoader::doStopDocumentLoad(nsIRequest*, tag_nsresult) uriloader/base/nsDocLoader.cpp:850 #27 0x7f779a2cd9a3 in nsDocLoader::DocLoaderIsEmpty(bool) uriloader/base/nsDocLoader.cpp:740 #28 0x7f779a2cf202 in nsDocLoader::OnStopRequest(nsIRequest*, nsISupports*, tag_nsresult) uriloader/base/nsDocLoader.cpp:624 #29 0x7f779a2cf8ac in non-virtual thunk to nsDocLoader::OnStopRequest(nsIRequest*, nsISupports*, tag_nsresult) objdir-ff-asan/uriloader/base/Unified_cpp_uriloader_base0.cpp:628 #30 0x7f77991dda38 in nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, tag_nsresult) netwerk/base/src/nsLoadGroup.cpp:689 #31 0x7f779c85397c in nsDocument::DoUnblockOnload() content/base/src/nsDocument.cpp:8706 #32 0x7f779c85362a in nsDocument::UnblockOnload(bool) content/base/src/nsDocument.cpp:8634 #33 0x7f779c8288c8 in nsDocument::DispatchContentLoadedEvents() content/base/src/nsDocument.cpp:4917 #34 0x7f779c878da0 in nsRunnableMethodImpl<void (nsDocument::)(), void, true>::Run() objdir-ff-asan/content/base/src/../../../dist/include/nsThreadUtils.h:387 #35 0x7f77990765b5 in nsThread::ProcessNextEvent(bool, bool) xpcom/threads/nsThread.cpp:766 #36 0x7f7798f3622a in NS_ProcessNextEvent(nsIThread*, bool) xpcom/glue/nsThreadUtils.cpp:263 #37 0x7f77998704a9 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) ipc/glue/MessagePump.cpp:95 #38 0x7f7799818920 in MessageLoop::Run() ipc/chromium/src/base/message_loop.cc:229 #39 0x7f779bb979d7 in nsBaseAppShell::Run() widget/xpwidgets/nsBaseAppShell.cpp:164 #40 0x7f779ea75628 in nsAppStartup::Run() toolkit/components/startup/nsAppStartup.cpp:278 #41 0x7f779e8ef0d3 in XREMain::XRE_mainRun() toolkit/xre/nsAppRunner.cpp:4012 #42 0x7f779e8effaf in XREMain::XRE_main(int, char**, nsXREAppData const*) toolkit/xre/nsAppRunner.cpp:4081 #43 0x7f779e8f0dfd in XRE_main toolkit/xre/nsAppRunner.cpp:4293 #44 0x48c757 in main browser/app/nsBrowserApp.cpp:282 #45 0x7f77a79d1de4 in __libc_start_main /build/buildd/eglibc-2.17/csu/libc-start.c:260 0x60700026a968 is located 40 bytes inside of 80-byte region [0x60700026a940,0x60700026a990) freed by thread T0 here: #0 0x473bf1 in __interceptor_free asan_rtl #1 0x7f7798f87d1a in SnowWhiteKiller::~SnowWhiteKiller() xpcom/base/nsCycleCollector.cpp:2611 #2 0x7f7798f87929 in nsCycleCollector::FreeSnowWhite(bool) xpcom/base/nsCycleCollector.cpp:2778 #3 0x7f7798f8d67f in nsCycleCollector::BeginCollection(ccType, nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:3705 #4 0x7f7798f8cdb6 in nsCycleCollector::Collect(ccType, js::SliceBudget&, nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:3546 #5 0x7f7798f90d0c in nsCycleCollector_collect(nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:4127 #6 0x7f779c049263 in nsJSContext::CycleCollectNow(nsICycleCollectorListener*, int) dom/base/nsJSEnvironment.cpp:1943 #7 0x7f779c04895f in nsJSEnvironmentObserver::Observe(nsISupports*, char const*, char16_t const*) dom/base/nsJSEnvironment.cpp:283 #8 0x7f7798fd7329 in nsObserverService::NotifyObservers(nsISupports*, char const*, char16_t const*) xpcom/ds/nsObserverList.cpp:96 #9 0x7f779908b331 in NS_InvokeByIndex xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:162 #10 0x7f779bd882c7 in XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) js/xpconnect/src/XPCWrappedNative.cpp:2395 #11 0x7f779bd8e0ae in XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1273 #12 0x7f77a06bd843 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jscntxtinlines.h:239 #13 0x7f77a06b1774 in Interpret(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:2581 #14 0x7f77a069615c in js::RunScript(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:422 #15 0x7f77a06bdd91 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/vm/Interpreter.cpp:494 #16 0x7f77a03ca040 in js::CallOrConstructBoundFunction(JSContext*, unsigned int, JS::Value*) js/src/jsfun.cpp:1401 #17 0x7f77a06bd843 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jscntxtinlines.h:239 #18 0x7f77a0659b1e in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandleJS::Value) js/src/vm/Interpreter.cpp:531 #19 0x7f77a05ba765 in js::CrossCompartmentWrapper::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) js/src/jsproxy.cpp:448 #20 0x7f77a0538195 in js::Proxy::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) js/src/jsproxy.cpp:2663 #21 0x7f77a053e354 in js::proxy_Call(JSContext*, unsigned int, JS::Value*) js/src/jsproxy.cpp:3066 #22 0x7f77a06bd843 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jscntxtinlines.h:239 #23 0x7f77a06b1774 in Interpret(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:2581 #24 0x7f77a069615c in js::RunScript(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:422 #25 0x7f77a06bdd91 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/vm/Interpreter.cpp:494 #26 0x7f77a0659b1e in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandleJS::Value) js/src/vm/Interpreter.cpp:531 #27 0x7f77a034bdb5 in JS::Call(JSContext*, JS::HandleJS::Value, JS::HandleJS::Value, JS::HandleValueArray const&, JS::MutableHandleJS::Value) js/src/jsapi.cpp:5214 #28 0x7f779ad89131 in mozilla::dom::EventHandlerNonNull::Call(JSContext*, JS::HandleJS::Value, mozilla::dom::Event&, mozilla::ErrorResult&) objdir-ff-asan/dom/bindings/./EventHandlerBinding.cpp:35 #29 0x7f779c2a96ef in JS::Value mozilla::dom::EventHandlerNonNull::Call<nsISupports*>(nsISupports* const&, mozilla::dom::Event&, mozilla::ErrorResult&, mozilla::dom::CallbackObject::ExceptionHandling) objdir-ff-asan/dom/events/../../dist/include/mozilla/dom/EventHandlerBinding.h:62

previously allocated by thread T0 here: #0 0x473df1 in malloc asan_rtl #1 0x7f77a3bc6a4d in moz_xmalloc memory/mozalloc/mozalloc.cpp:52 #2 0x7f779d09e654 in mozilla::DOMSVGLength::GetTearOff(nsSVGLength2*, nsSVGElement*, bool) objdir-ff-asan/content/svg/content/src/../../../../dist/include/mozilla/mozalloc.h:201 #3 0x7f779d1e232f in nsSVGLength2::ToDOMAnimVal(mozilla::DOMSVGLength**, nsSVGElement*) content/svg/content/src/nsSVGLength2.cpp:336 #4 0x7f779d108850 in mozilla::dom::SVGAnimatedLength::AnimVal() content/svg/content/src/SVGAnimatedLength.cpp:37 #5 0x7f779b446989 in mozilla::dom::SVGAnimatedLengthBinding::get_animVal(JSContext*, JS::Handle<JSObject*>, mozilla::dom::SVGAnimatedLength*, JSJitGetterCallArgs) objdir-ff-asan/dom/bindings/./SVGAnimatedLengthBinding.cpp:48 #6 0x7f779b95bdfc in mozilla::dom::GenericBindingGetter(JSContext*, unsigned int, JS::Value*) dom/bindings/BindingUtils.cpp:2280 #7 0x7f77a06bd843 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jscntxtinlines.h:239 #8 0x7f77a0659b1e in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandleJS::Value) js/src/vm/Interpreter.cpp:531 #9 0x7f77a06bf5fd in js::InvokeGetterOrSetter(JSContext*, JSObject*, JS::Value, unsigned int, JS::Value*, JS::MutableHandleJS::Value) js/src/vm/Interpreter.cpp:603 #10 0x7f77a04799ff in js::baseops::GetProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::MutableHandleJS::Value) js/src/vm/Shape-inl.h:46 #11 0x7f77a06b0e19 in Interpret(JSContext*, js::RunState&) js/src/jsobj.h:984 #12 0x7f77a069615c in js::RunScript(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:422 #13 0x7f77a06bdd91 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/vm/Interpreter.cpp:494 #14 0x7f77a0659b1e in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandleJS::Value) js/src/vm/Interpreter.cpp:531 #15 0x7f77a034bdb5 in JS::Call(JSContext*, JS::HandleJS::Value, JS::HandleJS::Value, JS::HandleValueArray const&, JS::MutableHandleJS::Value) js/src/jsapi.cpp:5214 #16 0x7f779ad89131 in mozilla::dom::EventHandlerNonNull::Call(JSContext*, JS::HandleJS::Value, mozilla::dom::Event&, mozilla::ErrorResult&) objdir-ff-asan/dom/bindings/./EventHandlerBinding.cpp:35 #17 0x7f779c2a96ef in JS::Value mozilla::dom::EventHandlerNonNull::Call<nsISupports*>(nsISupports* const&, mozilla::dom::Event&, mozilla::ErrorResult&, mozilla::dom::CallbackObject::ExceptionHandling) objdir-ff-asan/dom/events/../../dist/include/mozilla/dom/EventHandlerBinding.h:62 #18 0x7f779c2a7c0f in mozilla::JSEventHandler::HandleEvent(nsIDOMEvent*) dom/events/JSEventHandler.cpp:214 #19 0x7f779c2767d0 in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, nsIDOMEvent*, mozilla::dom::EventTarget*) dom/events/EventListenerManager.cpp:950 #20 0x7f779c277b40 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent**, mozilla::dom::EventTarget*, nsEventStatus*) dom/events/EventListenerManager.cpp:1011 #21 0x7f779c268a01 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArraymozilla::EventTargetChainItem&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) dom/events/EventDispatcher.cpp:287 #22 0x7f779c26cb26 in mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsCOMArraymozilla::dom::EventTarget) dom/events/EventDispatcher.cpp:597 #23 0x7f779d7ad394 in nsDocumentViewer::LoadComplete(tag_nsresult) layout/base/nsDocumentViewer.cpp:1004 #24 0x7f779e42970b in nsDocShell::EndPageLoad(nsIWebProgress, nsIChannel*, tag_nsresult) docshell/base/nsDocShell.cpp:6963 #25 0x7f779e426899 in nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, tag_nsresult) docshell/base/nsDocShell.cpp:6762 #26 0x7f779e426cff in non-virtual thunk to nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, tag_nsresult) docshell/base/nsDocShell.cpp:6769 #27 0x7f779a2d0abb in nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, tag_nsresult) uriloader/base/nsDocLoader.cpp:1268 #28 0x7f779a2cfe02 in nsDocLoader::doStopDocumentLoad(nsIRequest*, tag_nsresult) uriloader/base/nsDocLoader.cpp:850 #29 0x7f779a2cd9a3 in nsDocLoader::DocLoaderIsEmpty(bool) uriloader/base/nsDocLoader.cpp:740

SUMMARY: AddressSanitizer: heap-use-after-free ??:0 ?? Shadow bytes around the buggy address: 0x0c0e800454d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0e800454e0: fa fa 00 00 00 00 00 00 00 00 00 00 fa fa fa fa 0x0c0e800454f0: fd fd fd fd fd fd fd fd fd fd fa fa fa fa 00 00 0x0c0e80045500: 00 00 00 00 00 00 00 00 fa fa fa fa fd fd fd fd 0x0c0e80045510: fd fd fd fd fd fd fa fa fa fa fd fd fd fd fd fd =>0x0c0e80045520: fd fd fd fd fa fa fa fa fd fd fd fd fd[fd]fd fd 0x0c0e80045530: fd fd fa fa fa fa 00 00 00 00 00 00 00 00 00 fa 0x0c0e80045540: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 fa fa 0x0c0e80045550: fa fa 00 00 00 00 00 00 00 00 00 00 fa fa fa fa 0x0c0e80045560: fd fd fd fd fd fd fd fd fd fd fa fa fa fa 00 00 0x0c0e80045570: 00 00 00 00 00 00 00 00 fa fa fa fa 00 00 00 00 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 Contiguous container OOB:fc ASan internal: fe ==6521==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 critical-severity memory corruption bug in SVG. Mozilla made it public on 6 August 2014 as CVE-2014-1563.

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.