[FIX] Heap-use-after-free in mozilla::dom::ValidityStateBinding::get_valueMissing
Originally disclosed on Mozilla
- Fixed in 21 days
- Paid in 32 days
- Disclosed after 21 days
Created attachment 744990 Testcase
Need to install fuzzPriv extension
==21059== ERROR: AddressSanitizer: heap-use-after-free on address 0x603c00256e38 at pc 0x7f99226c67d6 bp 0x7fff09764f50 sp 0x7fff09764f48 READ of size 1 at 0x603c00256e38 thread T0 #0 0x7f99226c67d5 in nsIConstraintValidation::GetValidityState(nsIConstraintValidation::ValidityStateType) const ../../dist/include/nsIConstraintValidation.h:84 #1 0x7f9922f3d26d in mozilla::dom::ValidityState::GetValidityState(nsIConstraintValidation::ValidityStateType) const ../../dist/include/mozilla/dom/ValidityState.h:93 #2 0x7f9922f3aa23 in mozilla::dom::ValidityState::ValueMissing() const ../../dist/include/mozilla/dom/ValidityState.h:39 #3 0x7f992beb783e in mozilla::dom::ValidityStateBinding::get_valueMissing(JSContext*, JS::Handle<JSObject*>, mozilla::dom::ValidityState*, JS::Value*) objdir-ff-asan-sym/dom/bindings/ValidityStateBinding.cpp:27 #4 0x7f992beb45e0 in mozilla::dom::ValidityStateBinding::genericGetter(JSContext*, unsigned int, JS::Value*) objdir-ff-asan-sym/dom/bindings/ValidityStateBinding.cpp:230 #5 0x7f993469f24f in js::CallJSNative(JSContext*, int ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) js/src/jscntxtinlines.h:337 #6 0x7f993469f24f in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:428 #7 0x7f99340c9756 in js::Invoke(JSContext*, js::InvokeArgsGuard&, js::MaybeConstruct) js/src/jsinterp.h:134 #8 0x7f99346a3350 in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::Value*) js/src/jsinterp.cpp:475 #9 0x7f99346a7c9c in js::InvokeGetterOrSetter(JSContext*, JSObject*, JS::Value const&, unsigned int, JS::Value*, JS::Value*) js/src/jsinterp.cpp:546 #10 0x7f9934912176 in js::Shape::get(JSContext*, JS::Handle<JSObject*>, JSObject*, JSObject*, JS::MutableHandleJS::Value) js/src/vm/Shape-inl.h:300 #11 0x7f99348bb02a in _ZL15NativeGetInlineILN2js7AllowGCE1EEiP9JSContextNS0_11MaybeRootedIP8JSObjectXT_EE10HandleTypeES8_S8_NS4_IPNS0_5ShapeEXT_EE10HandleTypeEjNS4_IN2JS5ValueEXT_EE17MutableHandleTypeE js/src/jsobj.cpp:3767 #12 0x7f99348bb02a in _ZL23GetPropertyHelperInlineILN2js7AllowGCE1EEiP9JSContextNS0_11MaybeRootedIP8JSObjectXT_EE10HandleTypeES8_NS4_IlXT_EE10HandleTypeEjNS4_IN2JS5ValueEXT_EE17MutableHandleTypeE js/src/jsobj.cpp:3941 #13 0x7f99348bb02a in js::GetPropertyHelper(JSContext*, JS::Handle<JSObject*>, JS::Handle<long>, unsigned int, JS::MutableHandleJS::Value) js/src/jsobj.cpp:3950 #14 0x7f99346c7be4 in js::GetPropertyOperation(JSContext*, JSScript*, unsigned char*, JS::MutableHandleJS::Value, JS::MutableHandleJS::Value) js/src/jsinterpinlines.h:294 #15 0x7f993466b4b7 in js::Interpret(JSContext*, js::StackFrame*, js::InterpMode, bool) js/src/jsinterp.cpp:2254 #16 0x7f993462843d in js::RunScript(JSContext*, js::StackFrame*) js/src/jsinterp.cpp:385 #17 0x7f99346a8cdb in js::ExecuteKernel(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value const&, js::ExecuteType, js::AbstractFramePtr, JS::Value*) js/src/jsinterp.cpp:573 #18 0x7f99346aa871 in js::Execute(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value*) js/src/jsinterp.cpp:612 #19 0x7f9933fc9354 in JS::Evaluate(JSContext*, JS::Handle<JSObject*>, JS::CompileOptions, unsigned short const*, unsigned long, JS::Value*) js/src/jsapi.cpp:5646 #20 0x7f9923b8ec13 in nsJSContext::EvaluateString(nsAString_internal const&, JSObject&, JS::CompileOptions&, bool, JS::Value*) dom/base/nsJSEnvironment.cpp:1306 #21 0x7f9923d5a1cc in nsGlobalWindow::RunTimeoutHandler(nsTimeout*, nsIScriptContext*) dom/base/nsGlobalWindow.cpp:10185 #22 0x7f9923d0ea52 in nsGlobalWindow::RunTimeout(nsTimeout*) dom/base/nsGlobalWindow.cpp:10433 #23 0x7f9923d58011 in nsGlobalWindow::TimerCallback(nsITimer*, void*) dom/base/nsGlobalWindow.cpp:10702 #24 0x7f992cafe9a2 in nsTimerImpl::Fire() xpcom/threads/nsTimerImpl.cpp:547 #25 0x7f992caffdfd in nsTimerEvent::Run() xpcom/threads/nsTimerImpl.cpp:634 #26 0x7f992cac5aa7 in nsThread::ProcessNextEvent(bool, bool*) xpcom/threads/nsThread.cpp:627 #27 0x7f992c764c12 in NS_ProcessNextEvent(nsIThread*, bool) objdir-ff-asan-sym/xpcom/build/nsThreadUtils.cpp:238 #28 0x7f992719365b in nsXULWindow::ShowModal() xpfe/appshell/src/nsXULWindow.cpp:362 #29 0x7f9927172a47 in nsContentTreeOwner::ShowAsModal() xpfe/appshell/src/nsContentTreeOwner.cpp:522 #30 0x7f9927172bf8 in non-virtual thunk to nsContentTreeOwner::ShowAsModal() xpfe/appshell/src/nsContentTreeOwner.cpp:523 #31 0x7f9926f8fbc0 in nsWindowWatcher::OpenWindowInternal(nsIDOMWindow*, char const*, char const*, char const*, bool, bool, bool, nsIArray*, nsIDOMWindow**) embedding/components/windowwatcher/src/nsWindowWatcher.cpp:1007 #32 0x7f9926f83484 in nsWindowWatcher::OpenWindow(nsIDOMWindow*, char const*, char const*, char const*, nsISupports*, nsIDOMWindow**) embedding/components/windowwatcher/src/nsWindowWatcher.cpp:343 #33 0x7f992cbe69db in NS_InvokeByIndex xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:162 #34 0x7f99266d231f in CallMethodHelper::Invoke() js/xpconnect/src/XPCWrappedNative.cpp:2945 #35 0x7f99266d231f in CallMethodHelper::Call() js/xpconnect/src/XPCWrappedNative.cpp:2280 #36 0x7f99266d231f in XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) js/xpconnect/src/XPCWrappedNative.cpp:2246 #37 0x7f992672bd11 in XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1485 #38 0x7f993469f24f in js::CallJSNative(JSContext*, int ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) js/src/jscntxtinlines.h:337 #39 0x7f993469f24f in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:428 #40 0x7f9934678abc in js::Interpret(JSContext*, js::StackFrame*, js::InterpMode, bool) js/src/jsinterp.cpp:2404 #41 0x7f993462843d in js::RunScript(JSContext*, js::StackFrame*) js/src/jsinterp.cpp:385 #42 0x7f993469f8f8 in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:442 #43 0x7f99340c9756 in js::Invoke(JSContext*, js::InvokeArgsGuard&, js::MaybeConstruct) js/src/jsinterp.h:134 #44 0x7f99346a3350 in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::Value*) js/src/jsinterp.cpp:475 #45 0x7f9933fd31f0 in JS_CallFunctionValue(JSContext*, JSObject*, JS::Value, unsigned int, JS::Value*, JS::Value*) js/src/jsapi.cpp:5842 #46 0x7f99266900f9 in nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS*, unsigned short, XPTMethodDescriptor const*, nsXPTCMiniVariant*) js/xpconnect/src/XPCWrappedJSClass.cpp:1435 #47 0x7f9926643aec in nsXPCWrappedJS::CallMethod(unsigned short, XPTMethodDescriptor const*, nsXPTCMiniVariant*) js/xpconnect/src/XPCWrappedJS.cpp:578 #48 0x7f992cbec084 in PrepareAndDispatch xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp:122 #49 0x7f992cbe913a in SharedStub 0x603c00256e38 is located 184 bytes inside of 368-byte region [0x603c00256d80,0x603c00256ef0) freed by thread T0 here: #0 0x4186d2 in __interceptor_free #1 0x7f993f38877e in moz_free memory/mozalloc/mozalloc.cpp:48 #2 0x7f9922e59879 in operator delete(void*) ../../../../dist/include/mozilla/mozalloc.h:225 #3 0x7f9922e59879 in mozilla::dom::HTMLTextAreaElement::~HTMLTextAreaElement() ../../../../dist/include/mozilla/dom/HTMLTextAreaElement.h:32 #4 0x7f99214a46e5 in nsNodeUtils::LastRelease(nsINode*) content/base/src/nsNodeUtils.cpp:258 #5 0x7f99217509ca in mozilla::dom::FragmentOrElement::Release() content/base/src/FragmentOrElement.cpp:1713 #6 0x7f9922e33e75 in mozilla::dom::HTMLTextAreaElement::Release() content/html/content/src/HTMLTextAreaElement.cpp:93 #7 0x7f992c767bb0 in nsXPCOMCycleCollectionParticipant::UnrootImpl(void*) objdir-ff-asan-sym/xpcom/build/nsCycleCollectionParticipant.cpp:37 #8 0x7f992cb7696f in nsCycleCollector::CollectWhite(nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:2388 #9 0x7f992cb66e53 in nsCycleCollector::FinishCollection(nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:2819 #10 0x7f992cb656da in nsCycleCollectorRunner::Collect(bool, nsCycleCollectorResults*, nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:1172 #11 0x7f992cb7c6f3 in nsCycleCollector::Collect(bool, nsCycleCollectorResults*, nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:2755 #12 0x7f992cb817e7 in nsCycleCollector_collect(bool, nsCycleCollectorResults*, nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:3049 #13 0x7f9923b7a615 in nsJSContext::CycleCollectNow(nsICycleCollectorListener*, int, bool) dom/base/nsJSEnvironment.cpp:2687 #14 0x7f9923b77ec1 in nsJSEnvironmentObserver::Observe(nsISupports*, char const*, unsigned short const*) dom/base/nsJSEnvironment.cpp:252 #15 0x7f992c86aae2 in nsObserverList::NotifyObservers(nsISupports*, char const*, unsigned short const*) xpcom/ds/nsObserverList.cpp:99 #16 0x7f992c878986 in nsObserverService::NotifyObservers(nsISupports*, char const*, unsigned short const*) xpcom/ds/nsObserverService.cpp:161 #17 0x7f992cbe69db in NS_InvokeByIndex xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:162 #18 0x7f99266d231f in CallMethodHelper::Invoke() js/xpconnect/src/XPCWrappedNative.cpp:2945 #19 0x7f99266d231f in CallMethodHelper::Call() js/xpconnect/src/XPCWrappedNative.cpp:2280 #20 0x7f99266d231f in XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) js/xpconnect/src/XPCWrappedNative.cpp:2246 #21 0x7f992672bd11 in XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1485 #22 0x7f993469f24f in js::CallJSNative(JSContext*, int ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) js/src/jscntxtinlines.h:337 #23 0x7f993469f24f in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:428 #24 0x7f9934678abc in js::Interpret(JSContext*, js::StackFrame*, js::InterpMode, bool) js/src/jsinterp.cpp:2404 #25 0x7f993462843d in js::RunScript(JSContext*, js::StackFrame*) js/src/jsinterp.cpp:385 #26 0x7f993469f8f8 in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:442 #27 0x7f99340c9756 in js::Invoke(JSContext*, js::InvokeArgsGuard&, js::MaybeConstruct) js/src/jsinterp.h:134 #28 0x7f99343f6e5e in js::CallOrConstructBoundFunction(JSContext*, unsigned int, JS::Value*) js/src/jsfun.cpp:1148 #29 0x7f993469f24f in js::CallJSNative(JSContext*, int ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) js/src/jscntxtinlines.h:337 #30 0x7f993469f24f in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:428 #31 0x7f99340c9756 in js::Invoke(JSContext*, js::InvokeArgsGuard&, js::MaybeConstruct) js/src/jsinterp.h:134 #32 0x7f99346a3350 in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::Value*) js/src/jsinterp.cpp:475 #33 0x7f99349d60dd in js::DirectProxyHandler::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) js/src/jsproxy.cpp:481 #34 0x7f99350187e2 in js::CrossCompartmentWrapper::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) js/src/jswrapper.cpp:445 previously allocated by thread T0 here: #0 0x4187b2 in __interceptor_malloc #1 0x7f993f3888c5 in moz_xmalloc memory/mozalloc/mozalloc.cpp:54 #2 0x7f9922e31b73 in operator new(unsigned long) ../../../../dist/include/mozilla/mozalloc.h:201 #3 0x7f9922e31b73 in nsGenericHTMLElement* mozilla::dom::NewHTMLElementHelper::Create<nsHTMLTextAreaElement, mozilla::dom::HTMLTextAreaElement>(already_AddRefed<nsINodeInfo>, mozilla::dom::FromParser, mozilla::dom::NewHTMLElementHelper::SFINAE<bool ()(nsIDocument), mozilla::dom::HTMLTextAreaElement::InNavQuirksMode>) content/html/content/src/nsGenericHTMLElement.h:1864 #4 0x7f9922e318f2 in NS_NewHTMLTextAreaElement(already_AddRefed<nsINodeInfo>, mozilla::dom::FromParser) content/html/content/src/HTMLTextAreaElement.cpp:47 #5 0x7f9922f92cfe in CreateHTMLElement(unsigned int, already_AddRefed<nsINodeInfo>, mozilla::dom::FromParser) content/html/document/src/nsHTMLContentSink.cpp:498 #6 0x7f9922f93525 in NS_NewHTMLElement(nsIContent**, already_AddRefed<nsINodeInfo>, mozilla::dom::FromParser) content/html/document/src/nsHTMLContentSink.cpp:481 #7 0x7f9921472a5a in NS_NewElement(nsIContent**, already_AddRefed<nsINodeInfo>, mozilla::dom::FromParser) content/base/src/nsNameSpaceManager.cpp:192 #8 0x7f99211038d6 in nsIDocument::CreateElementNS(nsAString_internal const&, nsAString_internal const&, mozilla::ErrorResult&) content/base/src/nsDocument.cpp:4775 #9 0x7f992a6ce904 in mozilla::dom::DocumentBinding::createElementNS(JSContext, JS::Handle<JSObject*>, nsIDocument*, unsigned int, JS::Value*) objdir-ff-asan-sym/dom/bindings/DocumentBinding.cpp:524 #10 0x7f992a6290fa in mozilla::dom::DocumentBinding::genericMethod(JSContext*, unsigned int, JS::Value*) objdir-ff-asan-sym/dom/bindings/DocumentBinding.cpp:7355 #11 0x7f993469f24f in js::CallJSNative(JSContext*, int ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) js/src/jscntxtinlines.h:337 #12 0x7f993469f24f in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:428 #13 0x7f9934678abc in js::Interpret(JSContext*, js::StackFrame*, js::InterpMode, bool) js/src/jsinterp.cpp:2404 #14 0x7f993462843d in js::RunScript(JSContext*, js::StackFrame*) js/src/jsinterp.cpp:385 #15 0x7f993469f8f8 in js::InvokeKernel(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jsinterp.cpp:442 #16 0x7f99340c9756 in js::Invoke(JSContext*, js::InvokeArgsGuard&, js::MaybeConstruct) js/src/jsinterp.h:134 #17 0x7f99346a3350 in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::Value*) js/src/jsinterp.cpp:475 #18 0x7f9933fd31f0 in JS_CallFunctionValue(JSContext*, JSObject*, JS::Value, unsigned int, JS::Value*, JS::Value*) js/src/jsapi.cpp:5842 #19 0x7f99266900f9 in nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS*, unsigned short, XPTMethodDescriptor const*, nsXPTCMiniVariant*) js/xpconnect/src/XPCWrappedJSClass.cpp:1435 #20 0x7f9926643aec in nsXPCWrappedJS::CallMethod(unsigned short, XPTMethodDescriptor const*, nsXPTCMiniVariant*) js/xpconnect/src/XPCWrappedJS.cpp:578 #21 0x7f992cbec084 in PrepareAndDispatch xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp:122 #22 0x7f992cbe913a in SharedStub #23 0x7f9921dd0a0c in nsEventListenerManager::HandleEventSubType(nsListenerStruct*, mozilla::dom::CallbackObjectHolder<mozilla::dom::EventListener, nsIDOMEventListener> const&, nsIDOMEvent*, mozilla::dom::EventTarget*, nsCxPusher*) content/events/src/nsEventListenerManager.cpp:922 #24 0x7f9921dd309f in nsEventListenerManager::HandleEventInternal(nsPresContext*, nsEvent*, nsIDOMEvent**, mozilla::dom::EventTarget*, nsEventStatus*, nsCxPusher*) content/events/src/nsEventListenerManager.cpp:993 #25 0x7f9921fd95ab in nsEventListenerManager::HandleEvent(nsPresContext*, nsEvent*, nsIDOMEvent**, mozilla::dom::EventTarget*, nsEventStatus*, nsCxPusher*) content/events/src/nsEventListenerManager.h:326 #26 0x7f9921fc93f7 in nsEventTargetChainItem::HandleEvent(nsEventChainPostVisitor&, bool, nsCxPusher*) content/events/src/nsEventDispatcher.cpp:200 #27 0x7f9921fc6dbc in nsEventTargetChainItem::HandleEventTargetChain(nsEventChainPostVisitor&, nsDispatchingCallback*, bool, nsCxPusher*) content/events/src/nsEventDispatcher.cpp:325 #28 0x7f9921fce9eb in nsEventDispatcher::Dispatch(nsISupports*, nsPresContext*, nsEvent*, nsIDOMEvent*, nsEventStatus*, nsDispatchingCallback*, nsCOMArraymozilla::dom::EventTarget) content/events/src/nsEventDispatcher.cpp:631 #29 0x7f9921fd0f9d in nsEventDispatcher::DispatchDOMEvent(nsISupports, nsEvent*, nsIDOMEvent*, nsPresContext*, nsEventStatus*) content/events/src/nsEventDispatcher.cpp:691 #30 0x7f99213e68c4 in nsINode::DispatchEvent(nsIDOMEvent*, bool*) content/base/src/nsINode.cpp:1135 #31 0x7f9920eeac2b in nsContentUtils::DispatchEvent(nsIDocument*, nsISupports*, nsAString_internal const&, bool, bool, bool, bool*) content/base/src/nsContentUtils.cpp:3580 Shadow bytes around the buggy address: 0x0c0800042d70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0800042d80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0800042d90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0800042da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0800042db0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c0800042dc0: fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd 0x0c0800042dd0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa 0x0c0800042de0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0800042df0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0800042e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0800042e10: 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 ==21059== 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 DOM: Core & HTML. Mozilla made it public on 24 May 2013.
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.