heap-use-after-free in mozilla::dom::WakeLock::Release
A heap-use-after-free occurs in Firefox's WakeLock code when a media element's wake lock is released while the document is being rewritten via document.write, causing the same object to be freed and then read again. The reporter saw this crash while fuzzing but could not reproduce it reliably, so no attacker impact is demonstrated.
- Fixed in 7 days
- Paid in 6 months
- Disclosed after 7 days
I have seen the following crash a few times while fuzzing Firefo 68.0a1, however currently am unable to reproduce reliably. I will continue to try to minimize a testcase.
=================================================================
==6682==ERROR: AddressSanitizer: heap-use-after-free on address 0x608000018378 at pc 0x7fb01ea64c44 bp 0x7fffce9e4e60 sp 0x7fffce9e4e58
READ of size 8 at 0x608000018378 thread T0 (Web Content)
#0 0x7fb01ea64c43 in ~nsCOMPtr_base /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr.h:330:9
#1 0x7fb01ea64c43 in mozilla::dom::WakeLock::~WakeLock() /builds/worker/workspace/build/src/dom/power/WakeLock.cpp:42
#2 0x7fb01ea656a8 in mozilla::dom::WakeLock::~WakeLock() /builds/worker/workspace/build/src/dom/power/WakeLock.cpp:39:23
#3 0x7fb01ea643fc in mozilla::dom::WakeLock::Release() /builds/worker/workspace/build/src/dom/power/WakeLock.cpp:32:1
#4 0x7fb01d6bb736 in UnlinkSelf /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/dom/CallbackObject.h:528:5
#5 0x7fb01d6bb736 in ~CallbackObjectHolder /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/dom/CallbackObject.h:406
#6 0x7fb01d6bb736 in ~Listener /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/EventListenerManager.h:233
#7 0x7fb01d6bb736 in Destruct /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:525
#8 0x7fb01d6bb736 in DestructRange /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:2183
#9 0x7fb01d6bb736 in nsTArray_Impl<mozilla::EventListenerManager::Listener, nsTArrayInfallibleAllocator>::RemoveElementsAtUnsafe(unsigned long, unsigned long) /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:2242
#10 0x7fb01d65d24e in RemoveElementsAt /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:2236:3
#11 0x7fb01d65d24e in RemoveElementAt /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:1698
#12 0x7fb01d65d24e in RemoveElementAt /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTObserverArray.h:208
#13 0x7fb01d65d24e in mozilla::EventListenerManager::RemoveAllListeners() /builds/worker/workspace/build/src/dom/events/EventListenerManager.cpp:1717
#14 0x7fb01db9c059 in nsHTMLDocument::Open(mozilla::dom::Optional<nsTSubstring<char16_t> > const&, nsTSubstring<char16_t> const&, mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/html/nsHTMLDocument.cpp:1269:12
#15 0x7fb01db9eef3 in nsHTMLDocument::WriteCommon(nsTSubstring<char16_t> const&, bool, mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/html/nsHTMLDocument.cpp:1530:5
#16 0x7fb01db9e11d in nsHTMLDocument::WriteCommon(mozilla::dom::Sequence<nsTString<char16_t> > const&, bool, mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/html/nsHTMLDocument.cpp:1456:5
#17 0x7fb01c8205e1 in mozilla::dom::HTMLDocument_Binding::write(JSContext*, JS::Handle<JSObject*>, nsHTMLDocument*, JSJitMethodCallArgs const&) /builds/worker/workspace/build/src/obj-firefox/dom/bindings/HTMLDocumentBinding.cpp:397:9
#18 0x7fb01cdd3ac1 in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) /builds/worker/workspace/build/src/dom/bindings/BindingUtils.cpp:3153:13
#19 0x7fb0245f5bf7 in CallJSNative /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:442:13
#20 0x7fb0245f5bf7 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:534
#21 0x7fb0245de3ef in CallFromStack /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:593:10
#22 0x7fb0245de3ef in Interpret(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:3072
#23 0x7fb0245c0368 in js::RunScript(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:422:10
#24 0x7fb0245fb449 in js::ExecuteKernel(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value const&, js::AbstractFramePtr, JS::Value*) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:781:13
#25 0x7fb0246f1a37 in EvalKernel(JSContext*, JS::Handle<JS::Value>, EvalType, js::AbstractFramePtr, JS::Handle<JSObject*>, unsigned char*, JS::MutableHandle<JS::Value>) /builds/worker/workspace/build/src/js/src/builtin/Eval.cpp:326:10
#26 0x7fb0246f3e04 in js::DirectEval(JSContext*, JS::Handle<JS::Value>, JS::MutableHandle<JS::Value>) /builds/worker/workspace/build/src/js/src/builtin/Eval.cpp:440:10
#27 0x7fb0257f51e4 in js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) /builds/worker/workspace/build/src/js/src/jit/BaselineIC.cpp:3866:10
#28 0x287384819887 (<unknown module>)
0x608000018378 is located 88 bytes inside of 96-byte region [0x608000018320,0x608000018380)
freed by thread T0 (Web Content) here:
#0 0x55acbf8359e2 in free /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:124:3
#1 0x7fb01ea643fc in mozilla::dom::WakeLock::Release() /builds/worker/workspace/build/src/dom/power/WakeLock.cpp:32:1
#2 0x7fb01d64c7d7 in UnlinkSelf /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/dom/CallbackObject.h:528:5
#3 0x7fb01d64c7d7 in ~CallbackObjectHolder /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/dom/CallbackObject.h:406
#4 0x7fb01d64c7d7 in mozilla::EventListenerManager::RemoveEventListenerByType(mozilla::dom::CallbackObjectHolder<mozilla::dom::EventListener, nsIDOMEventListener>, nsTSubstring<char16_t> const&, mozilla::EventListenerFlags const&) /builds/worker/workspace/build/src/dom/events/EventListenerManager.cpp:696
#5 0x7fb01d666eaf in RemoveEventListenerByType /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/EventListenerManager.h:300:5
#6 0x7fb01d666eaf in mozilla::dom::EventTarget::RemoveSystemEventListener(nsTSubstring<char16_t> const&, nsIDOMEventListener*, bool) /builds/worker/workspace/build/src/dom/events/EventTarget.cpp:133
#7 0x7fb01ea650af in mozilla::dom::WakeLock::DetachEventListener() /builds/worker/workspace/build/src/dom/power/WakeLock.cpp:174:12
#8 0x7fb01ea64b2b in mozilla::dom::WakeLock::~WakeLock() /builds/worker/workspace/build/src/dom/power/WakeLock.cpp:41:3
#9 0x7fb01ea656a8 in mozilla::dom::WakeLock::~WakeLock() /builds/worker/workspace/build/src/dom/power/WakeLock.cpp:39:23
#10 0x7fb01ea643fc in mozilla::dom::WakeLock::Release() /builds/worker/workspace/build/src/dom/power/WakeLock.cpp:32:1
#11 0x7fb01d6bb736 in UnlinkSelf /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/dom/CallbackObject.h:528:5
#12 0x7fb01d6bb736 in ~CallbackObjectHolder /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/dom/CallbackObject.h:406
#13 0x7fb01d6bb736 in ~Listener /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/EventListenerManager.h:233
#14 0x7fb01d6bb736 in Destruct /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:525
#15 0x7fb01d6bb736 in DestructRange /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:2183
#16 0x7fb01d6bb736 in nsTArray_Impl<mozilla::EventListenerManager::Listener, nsTArrayInfallibleAllocator>::RemoveElementsAtUnsafe(unsigned long, unsigned long) /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:2242
#17 0x7fb01d65d24e in RemoveElementsAt /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:2236:3
#18 0x7fb01d65d24e in RemoveElementAt /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:1698
#19 0x7fb01d65d24e in RemoveElementAt /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTObserverArray.h:208
#20 0x7fb01d65d24e in mozilla::EventListenerManager::RemoveAllListeners() /builds/worker/workspace/build/src/dom/events/EventListenerManager.cpp:1717
#21 0x7fb01db9c059 in nsHTMLDocument::Open(mozilla::dom::Optional<nsTSubstring<char16_t> > const&, nsTSubstring<char16_t> const&, mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/html/nsHTMLDocument.cpp:1269:12
#22 0x7fb01db9eef3 in nsHTMLDocument::WriteCommon(nsTSubstring<char16_t> const&, bool, mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/html/nsHTMLDocument.cpp:1530:5
#23 0x7fb01db9e11d in nsHTMLDocument::WriteCommon(mozilla::dom::Sequence<nsTString<char16_t> > const&, bool, mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/html/nsHTMLDocument.cpp:1456:5
#24 0x7fb01c8205e1 in mozilla::dom::HTMLDocument_Binding::write(JSContext*, JS::Handle<JSObject*>, nsHTMLDocument*, JSJitMethodCallArgs const&) /builds/worker/workspace/build/src/obj-firefox/dom/bindings/HTMLDocumentBinding.cpp:397:9
#25 0x7fb01cdd3ac1 in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) /builds/worker/workspace/build/src/dom/bindings/BindingUtils.cpp:3153:13
#26 0x7fb0245f5bf7 in CallJSNative /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:442:13
#27 0x7fb0245f5bf7 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:534
#28 0x7fb0245de3ef in CallFromStack /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:593:10
#29 0x7fb0245de3ef in Interpret(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:3072
#30 0x7fb0245c0368 in js::RunScript(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:422:10
#31 0x7fb0245fb449 in js::ExecuteKernel(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value const&, js::AbstractFramePtr, JS::Value*) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:781:13
#32 0x7fb0246f1a37 in EvalKernel(JSContext*, JS::Handle<JS::Value>, EvalType, js::AbstractFramePtr, JS::Handle<JSObject*>, unsigned char*, JS::MutableHandle<JS::Value>) /builds/worker/workspace/build/src/js/src/builtin/Eval.cpp:326:10
#33 0x7fb0246f3e04 in js::DirectEval(JSContext*, JS::Handle<JS::Value>, JS::MutableHandle<JS::Value>) /builds/worker/workspace/build/src/js/src/builtin/Eval.cpp:440:10
#34 0x7fb0257f51e4 in js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) /builds/worker/workspace/build/src/js/src/jit/BaselineIC.cpp:3866:10
#35 0x287384819887 (<unknown module>)
#36 0x621000538877 (<unknown module>)
#37 0x28738483e9d0 (<unknown module>)
#38 0x62100051b25f (<unknown module>)
#39 0x2873848174de (<unknown module>)
#40 0x7fb025d7d6ca in EnterJit /builds/worker/workspace/build/src/js/src/jit/Jit.cpp:103:5
#41 0x7fb025d7d6ca in js::jit::MaybeEnterJit(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/jit/Jit.cpp:168
#42 0x7fb0245c025e in js::RunScript(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:407:32
#43 0x7fb0245f6568 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:562:13
previously allocated by thread T0 (Web Content) here:
#0 0x55acbf835d63 in __interceptor_malloc /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:146:3
#1 0x55acbf86a5fd in moz_xmalloc /builds/worker/workspace/build/src/memory/mozalloc/mozalloc.cpp:68:15
#2 0x7fb01ea627bc in operator new /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc.h:131:10
#3 0x7fb01ea627bc in mozilla::dom::power::PowerManagerService::NewWakeLock(nsTSubstring<char16_t> const&, nsPIDOMWindowInner*, mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/power/PowerManagerService.cpp:118
#4 0x7fb01da34608 in mozilla::dom::HTMLMediaElement::CreateAudioWakeLockIfNeeded() /builds/worker/workspace/build/src/dom/html/HTMLMediaElement.cpp:3885:28
#5 0x7fb01da341ae in mozilla::dom::HTMLMediaElement::UpdateWakeLock() /builds/worker/workspace/build/src/dom/html/HTMLMediaElement.cpp:3872:5
#6 0x7fb01db1812c in mozilla::dom::HTMLVideoElement::UpdateWakeLock() /builds/worker/workspace/build/src/dom/html/HTMLVideoElement.cpp:350:21
#7 0x7fb01da32b94 in mozilla::dom::HTMLMediaElement::PlayInternal(bool) /builds/worker/workspace/build/src/dom/html/HTMLMediaElement.cpp:3793:3
#8 0x7fb01da31b14 in mozilla::dom::HTMLMediaElement::Play(mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/html/HTMLMediaElement.cpp:3721:5
#9 0x7fb01ca14bdd in play /builds/worker/workspace/build/src/obj-firefox/dom/bindings/HTMLMediaElementBinding.cpp:1236:45
#10 0x7fb01ca14bdd in mozilla::dom::HTMLMediaElement_Binding::play_promiseWrapper(JSContext*, JS::Handle<JSObject*>, mozilla::dom::HTMLMediaElement*, JSJitMethodCallArgs const&) /builds/worker/workspace/build/src/obj-firefox/dom/bindings/HTMLMediaElementBinding.cpp:1250
#11 0x7fb01cdd4aad in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ConvertExceptionsToPromises>(JSContext*, unsigned int, JS::Value*) /builds/worker/workspace/build/src/dom/bindings/BindingUtils.cpp:3153:13
#12 0x7fb0245f5bf7 in CallJSNative /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:442:13
#13 0x7fb0245f5bf7 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:534
#14 0x7fb0245f81b2 in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:605:8
#15 0x7fb0253433bf in js::ForwardingProxyHandler::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) const /builds/worker/workspace/build/src/js/src/proxy/Wrapper.cpp:162:10
#16 0x7fb0252fc601 in js::CrossCompartmentWrapper::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) const /builds/worker/workspace/build/src/js/src/proxy/CrossCompartmentWrapper.cpp:237:19
#17 0x7fb025322d00 in js::Proxy::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) /builds/worker/workspace/build/src/js/src/proxy/Proxy.cpp:504:19
#18 0x7fb0245f6c4b in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:508:14
#19 0x7fb0245de3ef in CallFromStack /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:593:10
#20 0x7fb0245de3ef in Interpret(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:3072
#21 0x7fb0245c0368 in js::RunScript(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:422:10
#22 0x7fb0245fb449 in js::ExecuteKernel(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value const&, js::AbstractFramePtr, JS::Value*) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:781:13
#23 0x7fb0246f1a37 in EvalKernel(JSContext*, JS::Handle<JS::Value>, EvalType, js::AbstractFramePtr, JS::Handle<JSObject*>, unsigned char*, JS::MutableHandle<JS::Value>) /builds/worker/workspace/build/src/js/src/builtin/Eval.cpp:326:10
#24 0x7fb0246f0ffb in js::IndirectEval(JSContext*, unsigned int, JS::Value*) /builds/worker/workspace/build/src/js/src/builtin/Eval.cpp:424:10
#25 0x7fb0245f5bf7 in CallJSNative /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:442:13
#26 0x7fb0245f5bf7 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:534
#27 0x7fb0245f81b2 in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:605:8
#28 0x7fb0253433bf in js::ForwardingProxyHandler::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) const /builds/worker/workspace/build/src/js/src/proxy/Wrapper.cpp:162:10
#29 0x7fb0252fc601 in js::CrossCompartmentWrapper::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) const /builds/worker/workspace/build/src/js/src/proxy/CrossCompartmentWrapper.cpp:237:19
#30 0x7fb025322d00 in js::Proxy::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) /builds/worker/workspace/build/src/js/src/proxy/Proxy.cpp:504:19
#31 0x7fb0245f6c4b in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:508:14
#32 0x7fb0245de3ef in CallFromStack /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:593:10
#33 0x7fb0245de3ef in Interpret(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:3072
#34 0x7fb0245c0368 in js::RunScript(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:422:10
#35 0x7fb0245fb449 in js::ExecuteKernel(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value const&, js::AbstractFramePtr, JS::Value*) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:781:13
SUMMARY: AddressSanitizer: heap-use-after-free /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr.h:330:9 in ~nsCOMPtr_base
Shadow bytes around the buggy address:
0x0c107fffb010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fffb020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fffb030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fffb040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fffb050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c107fffb060: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd[fd]
0x0c107fffb070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fffb080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fffb090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fffb0a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fffb0b0: 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
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==6682==ABORTING
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 the WakeLock object is released re-entrantly while its own event listener is being removed during document.write, so the destructor runs again on already-freed memory.
Impact
The crash is a memory-safety fault in the content process that could potentially be exploited, but the reporter could not reproduce it reliably and no exploitation is shown.
What the attacker needed
Firefox 68.0a1 build with ASan; media element played on the page; document.write called during playback
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.
When a web page plays audio or video, the browser creates a small internal object (a 'wake lock') to stop the screen or system sleeping. Here that object was destroyed twice in a row: the first destruction freed its memory, and the second one tried to use the freed memory, which is a use-after-free. The reporter only saw this in a fuzzing run and could not make it happen on demand, so it is unclear whether a real attacker could trigger it.
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.