Skip to content
Memory corruption Advisory Advanced CVE-2026-7363

Use after free in Canvas (CVE-2026-7363)

A heap-use-after-free exists in Chromium's OffscreenCanvas code, where a canvas resource dispatcher is freed during a frame push and then read again in the same begin-frame callback. An attacker could trigger a renderer crash, and the report frames it as a memory-safety bug with possible further exploitation.

heapracer Follow

Originally disclosed on Chrome VRP

Bounty$7,000 Critical View original
  • Fix shipped in 41 days

VULNERABILITY DETAILS

A heap-use-after-free vulnerability exists in Chromium's Blink engine, specifically within the OffscreenCanvas component (core and modules). The crash triggers at mojo::Handle::is_valid() via blink::CanvasResourceDispatcher::OnBeginFrame.

=================================================================
==2029962==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c80e0d45ef0 at pc 0x7f3104ff0f42 bp 0x7ffec54ac8a0 sp 0x7ffec54ac898
READ of size 8 at 0x7c80e0d45ef0 thread T0 (chrome)
    #0 0x7f3104ff0f41 in std::__Cr::unique_ptr<viz::mojom::blink::CompositorFrameSinkProxy, std::__Cr::default_delete<viz::mojom::blink::CompositorFrameSinkProxy>>::operator bool() const gen/third_party/libc++/src/include/__memory/unique_ptr.h:275:12
    #1 0x7f3104ff0f41 in mojo::internal::InterfacePtrState<viz::mojom::blink::CompositorFrameSink>::ConfigureProxyIfNecessary() mojo/public/cpp/bindings/lib/interface_ptr_state.h:261:9
    #2 0x7f310501bc44 in mojo::internal::InterfacePtrState<viz::mojom::blink::CompositorFrameSink>::instance() mojo/public/cpp/bindings/lib/interface_ptr_state.h:145:5
    #3 0x7f310501bc44 in mojo::Remote<viz::mojom::blink::CompositorFrameSink>::get() const mojo/public/cpp/bindings/remote.h:100:28
    #4 0x7f310501bc44 in mojo::Remote<viz::mojom::blink::CompositorFrameSink>::operator->() const mojo/public/cpp/bindings/remote.h:104:59
    #5 0x7f310501bc44 in blink::CanvasResourceDispatcher::OnBeginFrame(viz::BeginFrameArgs const&, blink::HashMap<unsigned int, viz::FrameTimingDetails, blink::HashTraits<unsigned int>, blink::HashTraits<viz::FrameTimingDetails>, blink::PartitionAllocator> const&, blink::Vector<viz::ReturnedResource, 0u, blink::PartitionAllocator>) third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.cc:416:5
    #6 0x7f310730b8d1 in viz::mojom::blink::CompositorFrameSinkClientStubDispatch::Accept(viz::mojom::blink::CompositorFrameSinkClient*, mojo::Message*) gen/services/viz/public/mojom/compositing/compositor_frame_sink.mojom-blink.cc:1677:13
    #7 0x7f315fd743e2 in mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message*) mojo/public/cpp/bindings/lib/interface_endpoint_client.cc:1085:54
    #8 0x7f315fd8b78b in mojo::MessageDispatcher::Accept(mojo::Message*) mojo/public/cpp/bindings/lib/message_dispatcher.cc:44:19
    #9 0x7f315fd79c94 in mojo::InterfaceEndpointClient::HandleIncomingMessage(mojo::Message*) mojo/public/cpp/bindings/lib/interface_endpoint_client.cc:747:20
    #10 0x7f315fd9ad6e in mojo::internal::MultiplexRouter::ProcessIncomingMessage(mojo::internal::MultiplexRouter::MessageWrapper*, mojo::internal::MultiplexRouter::ClientCallBehavior, base::SequencedTaskRunner*) mojo/public/cpp/bindings/lib/multiplex_router.cc:1204:42
    #11 0x7f315fd9959d in mojo::internal::MultiplexRouter::Accept(mojo::Message*) mojo/public/cpp/bindings/lib/multiplex_router.cc:790:7
    #12 0x7f315fd8b78b in mojo::MessageDispatcher::Accept(mojo::Message*) mojo/public/cpp/bindings/lib/message_dispatcher.cc:44:19
    #13 0x7f315fd6002f in mojo::Connector::DispatchMessage(mojo::ScopedHandleBase<mojo::MessageHandle>) mojo/public/cpp/bindings/lib/connector.cc:568:49
    #14 0x7f315fd6187e in mojo::Connector::ReadAllAvailableMessages() mojo/public/cpp/bindings/lib/connector.cc:629:14
    #15 0x7f315fd627a4 in void base::internal::DecayedFunctorTraits<void (mojo::Connector::*)(), base::WeakPtr<mojo::Connector>&&>::Invoke<void (mojo::Connector::*)(), base::WeakPtr<mojo::Connector> const&>(void (mojo::Connector::*)(), base::WeakPtr<mojo::Connector> const&) base/functional/bind_internal.h:740:12
    #16 0x7f315fd627a4 in void base::internal::InvokeHelper<true, base::internal::FunctorTraits<void (mojo::Connector::*&&)(), base::WeakPtr<mojo::Connector>&&>, void, 0ul>::MakeItSo<void (mojo::Connector::*)(), std::__Cr::tuple<base::WeakPtr<mojo::Connector>>>(void (mojo::Connector::*&&)(), std::__Cr::tuple<base::WeakPtr<mojo::Connector>>&&) base/functional/bind_internal.h:956:5
    #17 0x7f315fd627a4 in void base::internal::Invoker<base::internal::FunctorTraits<void (mojo::Connector::*&&)(), base::WeakPtr<mojo::Connector>&&>, base::internal::BindState<true, true, false, void (mojo::Connector::*)(), base::WeakPtr<mojo::Connector>>, void ()>::RunImpl<void (mojo::Connector::*)(), std::__Cr::tuple<base::WeakPtr<mojo::Connector>>, 0ul>(void (mojo::Connector::*&&)(), std::__Cr::tuple<base::WeakPtr<mojo::Connector>>&&, std::__Cr::integer_sequence<unsigned long, 0ul>) base/functional/bind_internal.h:1069:14
    #18 0x7f315fd627a4 in base::internal::Invoker<base::internal::FunctorTraits<void (mojo::Connector::*&&)(), base::WeakPtr<mojo::Connector>&&>, base::internal::BindState<true, true, false, void (mojo::Connector::*)(), base::WeakPtr<mojo::Connector>>, void ()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:982:12
    #19 0x7f315f5cbed2 in base::OnceCallback<void ()>::Run() && base/functional/callback.h:155:12
    #20 0x7f315f5cbed2 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) base/task/common/task_annotator.cc:229:34
    #21 0x7f315f64d3ce in void base::TaskAnnotator::RunTask<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*)::$_3>(perfetto::StaticString, base::PendingTask&, base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*)::$_3&&) base/task/common/task_annotator.h:112:5
    #22 0x7f315f64d3ce in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:475:23
    #23 0x7f315f64c3a6 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:346:40
    #24 0x7f315f46dea1 in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_default.cc:42:55
    #25 0x7f315f64ea48 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:650:12
    #26 0x7f315f536512 in base::RunLoop::Run(base::Location const&) base/run_loop.cc:135:14
    #27 0x7f3155215bfe in content::RendererMain(content::MainFunctionParams) content/renderer/renderer_main.cc:364:16
    #28 0x7f31556480b7 in content::RunZygote(content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:664:14
    #29 0x7f315564921f in content::RunOtherNamedProcessTypeMain(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, content::MainFunctionParams, content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:771:12
    #30 0x7f315564b80a in content::ContentMainRunnerImpl::Run() content/app/content_main_runner_impl.cc:1152:10
    #31 0x7f3155645f53 in content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) content/app/content_main.cc:358:36
    #32 0x7f31556462ea in content::ContentMain(content::ContentMainParams) content/app/content_main.cc:371:10
    #33 0x556bdcd8f345 in ChromeMain chrome/app/chrome_main.cc:191:12
    #34 0x7f30ef8e7d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

0x7c80e0d45ef0 is located 112 bytes inside of 472-byte region [0x7c80e0d45e80,0x7c80e0d46058)
freed by thread T0 (chrome) here:
    #0 0x556bdcd8e502 in operator delete(void*, unsigned long) (/mnt/lvm_data/chromium/src/out/asan_nodcheck/chrome+0x686f502) (BuildId: f667536c8ff65a4b)
    #1 0x7f30f6fc3e03 in blink::OffscreenCanvasRenderingContext2D::LoseContext(blink::CanvasRenderingContext::LostContextMode) third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.cc:445:11
    #2 0x7f30f6fc2e9b in blink::OffscreenCanvasRenderingContext2D::GetOrCreateResourceProvider() third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.cc:197:5
    #3 0x7f30f6fc2a03 in blink::OffscreenCanvasRenderingContext2D::FinalizeFrame(blink::FlushReason) third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.cc:136:8
    #4 0x7f30f6fc4d46 in blink::OffscreenCanvasRenderingContext2D::PushFrame() third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.cc:322:3
    #5 0x7f310501bc36 in blink::CanvasResourceDispatcher::OnBeginFrame(viz::BeginFrameArgs const&, blink::HashMap<unsigned int, viz::FrameTimingDetails, blink::HashTraits<unsigned int>, blink::HashTraits<viz::FrameTimingDetails>, blink::PartitionAllocator> const&, blink::Vector<viz::ReturnedResource, 0u, blink::PartitionAllocator>) third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.cc:413:54
    #6 0x7f310730b8d1 in viz::mojom::blink::CompositorFrameSinkClientStubDispatch::Accept(viz::mojom::blink::CompositorFrameSinkClient*, mojo::Message*) gen/services/viz/public/mojom/compositing/compositor_frame_sink.mojom-blink.cc:1677:13
    #7 0x7f315fd743e2 in mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message*) mojo/public/cpp/bindings/lib/interface_endpoint_client.cc:1085:54
    #8 0x7f315fd8b78b in mojo::MessageDispatcher::Accept(mojo::Message*) mojo/public/cpp/bindings/lib/message_dispatcher.cc:44:19
    #9 0x7f315fd79c94 in mojo::InterfaceEndpointClient::HandleIncomingMessage(mojo::Message*) mojo/public/cpp/bindings/lib/interface_endpoint_client.cc:747:20
    #10 0x7f315fd9ad6e in mojo::internal::MultiplexRouter::ProcessIncomingMessage(mojo::internal::MultiplexRouter::MessageWrapper*, mojo::internal::MultiplexRouter::ClientCallBehavior, base::SequencedTaskRunner*) mojo/public/cpp/bindings/lib/multiplex_router.cc:1204:42
    #11 0x7f315fd9959d in mojo::internal::MultiplexRouter::Accept(mojo::Message*) mojo/public/cpp/bindings/lib/multiplex_router.cc:790:7
    #12 0x7f315fd8b78b in mojo::MessageDispatcher::Accept(mojo::Message*) mojo/public/cpp/bindings/lib/message_dispatcher.cc:44:19
    #13 0x7f315fd6002f in mojo::Connector::DispatchMessage(mojo::ScopedHandleBase<mojo::MessageHandle>) mojo/public/cpp/bindings/lib/connector.cc:568:49
    #14 0x7f315fd6187e in mojo::Connector::ReadAllAvailableMessages() mojo/public/cpp/bindings/lib/connector.cc:629:14
    #15 0x7f315fd627a4 in void base::internal::DecayedFunctorTraits<void (mojo::Connector::*)(), base::WeakPtr<mojo::Connector>&&>::Invoke<void (mojo::Connector::*)(), base::WeakPtr<mojo::Connector> const&>(void (mojo::Connector::*)(), base::WeakPtr<mojo::Connector> const&) base/functional/bind_internal.h:740:12
    #16 0x7f315fd627a4 in void base::internal::InvokeHelper<true, base::internal::FunctorTraits<void (mojo::Connector::*&&)(), base::WeakPtr<mojo::Connector>&&>, void, 0ul>::MakeItSo<void (mojo::Connector::*)(), std::__Cr::tuple<base::WeakPtr<mojo::Connector>>>(void (mojo::Connector::*&&)(), std::__Cr::tuple<base::WeakPtr<mojo::Connector>>&&) base/functional/bind_internal.h:956:5
    #17 0x7f315fd627a4 in void base::internal::Invoker<base::internal::FunctorTraits<void (mojo::Connector::*&&)(), base::WeakPtr<mojo::Connector>&&>, base::internal::BindState<true, true, false, void (mojo::Connector::*)(), base::WeakPtr<mojo::Connector>>, void ()>::RunImpl<void (mojo::Connector::*)(), std::__Cr::tuple<base::WeakPtr<mojo::Connector>>, 0ul>(void (mojo::Connector::*&&)(), std::__Cr::tuple<base::WeakPtr<mojo::Connector>>&&, std::__Cr::integer_sequence<unsigned long, 0ul>) base/functional/bind_internal.h:1069:14
    #18 0x7f315fd627a4 in base::internal::Invoker<base::internal::FunctorTraits<void (mojo::Connector::*&&)(), base::WeakPtr<mojo::Connector>&&>, base::internal::BindState<true, true, false, void (mojo::Connector::*)(), base::WeakPtr<mojo::Connector>>, void ()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:982:12
    #19 0x7f315f5cbed2 in base::OnceCallback<void ()>::Run() && base/functional/callback.h:155:12
    #20 0x7f315f5cbed2 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) base/task/common/task_annotator.cc:229:34
    #21 0x7f315f64d3ce in void base::TaskAnnotator::RunTask<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*)::$_3>(perfetto::StaticString, base::PendingTask&, base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*)::$_3&&) base/task/common/task_annotator.h:112:5
    #22 0x7f315f64d3ce in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:475:23
    #23 0x7f315f64c3a6 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:346:40
    #24 0x7f315f46dea1 in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_default.cc:42:55
    #25 0x7f315f64ea48 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:650:12
    #26 0x7f315f536512 in base::RunLoop::Run(base::Location const&) base/run_loop.cc:135:14
    #27 0x7f3155215bfe in content::RendererMain(content::MainFunctionParams) content/renderer/renderer_main.cc:364:16
    #28 0x7f31556480b7 in content::RunZygote(content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:664:14
    #29 0x7f315564921f in content::RunOtherNamedProcessTypeMain(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, content::MainFunctionParams, content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:771:12
    #30 0x7f315564b80a in content::ContentMainRunnerImpl::Run() content/app/content_main_runner_impl.cc:1152:10
    #31 0x7f3155645f53 in content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) content/app/content_main.cc:358:36
    #32 0x7f31556462ea in content::ContentMain(content::ContentMainParams) content/app/content_main.cc:371:10
    #33 0x556bdcd8f345 in ChromeMain chrome/app/chrome_main.cc:191:12
    #34 0x7f30ef8e7d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

previously allocated by thread T0 (chrome) here:
    #0 0x556bdcd8d8fd in operator new(unsigned long) (/mnt/lvm_data/chromium/src/out/asan_nodcheck/chrome+0x686e8fd) (BuildId: f667536c8ff65a4b)
    #1 0x7f310f6f0ce2 in std::__Cr::unique_ptr<blink::CanvasResourceDispatcher, std::__Cr::default_delete<blink::CanvasResourceDispatcher>> std::__Cr::make_unique<blink::CanvasResourceDispatcher, blink::OffscreenCanvas*, scoped_refptr<base::SingleThreadTaskRunner>, scoped_refptr<base::SingleThreadTaskRunner>, unsigned int&, unsigned int&, int&, gfx::Size, 0>(blink::OffscreenCanvas*&&, scoped_refptr<base::SingleThreadTaskRunner>&&, scoped_refptr<base::SingleThreadTaskRunner>&&, unsigned int&, unsigned int&, int&, gfx::Size&&) gen/third_party/libc++/src/include/__memory/unique_ptr.h:756:26
    #2 0x7f310f6f0ce2 in blink::OffscreenCanvas::GetOrCreateResourceDispatcher() third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc:466:25
    #3 0x7f310f6f14a4 in blink::OffscreenCanvas::DidDraw(SkIRect const&) third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc:484:7
    #4 0x7f310f6f14a4 in non-virtual thunk to blink::OffscreenCanvas::DidDraw(SkIRect const&) third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
    #5 0x7f310dfb28e3 in blink::CanvasRenderingContext::DidDraw(SkIRect const&, blink::CanvasPerformanceMonitor::DrawType) third_party/blink/renderer/core/html/canvas/canvas_rendering_context.cc:314:9
    #6 0x7f310f6eccf8 in blink::CanvasRenderingContext::DidDraw(blink::CanvasPerformanceMonitor::DrawType) third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h:195:12
    #7 0x7f310f6eccf8 in blink::OffscreenCanvas::SetSize(gfx::Size) third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc:177:15
    #8 0x7f30f62aea08 in blink::(anonymous namespace)::v8_offscreen_canvas::WidthAttributeSetCallback(v8::FunctionCallbackInfo<v8::Value> const&) gen/third_party/blink/renderer/bindings/modules/v8/v8_offscreen_canvas.cc:96:17
    #9 0x7b30afdd06a3  (<unknown module>)
    #10 0x7b30afe2b528  (<unknown module>)
    #11 0x7b3090000843  (<unknown module>)
    #12 0x7b30afe1356d  (<unknown module>)
    #13 0x7b30aff01a29  (<unknown module>)
    #14 0x7b30afe01392  (<unknown module>)
    #15 0x7b30afdcb52a  (<unknown module>)
    #16 0x7f30fdf2748d in v8::internal::GeneratedCode<unsigned long, unsigned long, v8::internal::MicrotaskQueue*>::Call(unsigned long, v8::internal::MicrotaskQueue*) v8/src/execution/simulator.h:216:12
    #17 0x7f30fdf2748d in v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) v8/src/execution/execution.cc:492:41
    #18 0x7f30fdf29689 in v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) v8/src/execution/execution.cc:534:18
    #19 0x7f30fdf29a8f in v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*) v8/src/execution/execution.cc:638:10
    #20 0x7f30fdfd21fc in v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) v8/src/execution/microtask-queue.cc:185:22
    #21 0x7f30fdfd1c54 in v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) v8/src/execution/microtask-queue.cc:129:3
    #22 0x7f310c693c83 in blink::V8ScriptRunner::CallFunction(v8::Local<v8::Function>, blink::ExecutionContext*, v8::Local<v8::Value>, int, v8::Local<v8::Value>*, v8::Isolate*) third_party/blink/renderer/bindings/core/v8/v8_script_runner.cc:863:1
    #23 0x7f310c4e1b1b in blink::bindings::CallbackInvokeHelper<blink::CallbackFunctionBase, (blink::bindings::CallbackInvokeHelperMode)0, (blink::bindings::CallbackReturnTypeIsPromise)0>::CallInternal(int, v8::Local<v8::Value>*) third_party/blink/renderer/bindings/core/v8/callback_invoke_helper.cc:126:12
    #24 0x7f310c4e1b1b in blink::bindings::CallbackInvokeHelper<blink::CallbackFunctionBase, (blink::bindings::CallbackInvokeHelperMode)0, (blink::bindings::CallbackReturnTypeIsPromise)0>::Call(int, v8::Local<v8::Value>*) third_party/blink/renderer/bindings/core/v8/callback_invoke_helper.cc:150:10
    #25 0x7f3110c9262b in blink::V8Function::Invoke(blink::bindings::V8ValueOrScriptWrappableAdapter, blink::BasicHeapVector<(blink::internal::HeapCollectionType)1, blink::ScriptValue, 0u> const&) gen/third_party/blink/renderer/bindings/core/v8/v8_function.cc:73:13
    #26 0x7f3110c93a03 in blink::V8Function::InvokeAndReportException(blink::bindings::V8ValueOrScriptWrappableAdapter, blink::BasicHeapVector<(blink::internal::HeapCollectionType)1, blink::ScriptValue, 0u> const&) gen/third_party/blink/renderer/bindings/core/v8/v8_function.cc:133:15
    #27 0x7f310fbc0669 in blink::ScheduledAction::Execute(blink::ExecutionContext*) third_party/blink/renderer/core/scheduler/scheduled_action.cc:145:18
    #28 0x7f310fbb8e57 in blink::DOMTimer::Fired() third_party/blink/renderer/core/scheduler/dom_timer.cc:446:11
    #29 0x7f3105590855 in blink::TimerBase::RunInternal() third_party/blink/renderer/platform/timer.cc:166:3
    #30 0x7f310ead069c in void base::internal::DecayedFunctorTraits<void (blink::TimerBase::*)(), blink::TimerBase*>::Invoke<void (blink::TimerBase::*)(), blink::TimerBase*>(void (blink::TimerBase::*)(), blink::TimerBase*&&) base/functional/bind_internal.h:740:12
    #31 0x7f310ead069c in void base::internal::InvokeHelper<false, base::internal::FunctorTraits<void (blink::TimerBase::*&&)(), blink::TimerBase*>, void, 0ul>::MakeItSo<void (blink::TimerBase::*)(), std::__Cr::tuple<blink::UnretainedWrapper<blink::TimerBase>>>(void (blink::TimerBase::*&&)(), std::__Cr::tuple<blink::UnretainedWrapper<blink::TimerBase>>&&) base/functional/bind_internal.h:932:12
    #32 0x7f310ead069c in void base::internal::Invoker<base::internal::FunctorTraits<void (blink::TimerBase::*&&)(), blink::TimerBase*>, base::internal::BindState<true, true, false, void (blink::TimerBase::*)(), blink::UnretainedWrapper<blink::TimerBase>>, void ()>::RunImpl<void (blink::TimerBase::*)(), std::__Cr::tuple<blink::UnretainedWrapper<blink::TimerBase>>, 0ul>(void (blink::TimerBase::*&&)(), std::__Cr::tuple<blink::UnretainedWrapper<blink::TimerBase>>&&, std::__Cr::integer_sequence<unsigned long, 0ul>) base/functional/bind_internal.h:1069:14
    #33 0x7f310ead069c in base::internal::Invoker<base::internal::FunctorTraits<void (blink::TimerBase::*&&)(), blink::TimerBase*>, base::internal::BindState<true, true, false, void (blink::TimerBase::*)(), blink::UnretainedWrapper<blink::TimerBase>>, void ()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:982:12
    #34 0x7f315f5cbed2 in base::OnceCallback<void ()>::Run() && base/functional/callback.h:155:12
    #35 0x7f315f5cbed2 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) base/task/common/task_annotator.cc:229:34
    #36 0x7f315f64d3ce in void base::TaskAnnotator::RunTask<base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*)::$_3>(perfetto::StaticString, base::PendingTask&, base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*)::$_3&&) base/task/common/task_annotator.h:112:5
    #37 0x7f315f64d3ce in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:475:23
    #38 0x7f315f64c3a6 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:346:40
    #39 0x7f315f46dea1 in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_default.cc:42:55

SUMMARY: AddressSanitizer: heap-use-after-free gen/third_party/libc++/src/include/__memory/unique_ptr.h:275:12 in std::__Cr::unique_ptr<viz::mojom::blink::CompositorFrameSinkProxy, std::__Cr::default_delete<viz::mojom::blink::CompositorFrameSinkProxy>>::operator bool() const
Shadow bytes around the buggy address:
  0x7c80e0d45c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7c80e0d45c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7c80e0d45d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7c80e0d45d80: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
  0x7c80e0d45e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa f7 fa
=>0x7c80e0d45e80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd[fd]fd
  0x7c80e0d45f00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x7c80e0d45f80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x7c80e0d46000: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa
  0x7c80e0d46080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa f7 fa
  0x7c80e0d46100: 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
  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

==2029962==ADDITIONAL INFO

==2029962==Note: Please include this section with the ASan report.
Task trace:
    #0 0x7f315fd62336 in mojo::Connector::PostDispatchNextMessageFromPipe() mojo/public/cpp/bindings/lib/connector.cc:589:7
    #1 0x7f315fd62336 in mojo::Connector::ScheduleDispatchOfPendingMessagesOrWaitForMore(unsigned long) mojo/public/cpp/bindings/lib/connector.cc:612:5
    #2 0x7f315e08b9ea in mojo::SimpleWatcher::Context::Notify(unsigned int, MojoHandleSignalsState, unsigned int) mojo/public/cpp/system/simple_watcher.cc:103:13


Command line: `/proc/self/exe --type=renderer --crashpad-handler-pid=2029916 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.8w1ili --change-stack-guard-on-fork=enable --no-sandbox --ozone-platform=headless --lang=en-US --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --time-ticks-at-unix-epoch=-1772947841576980 --launch-time-ticks=1025574931179 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,7742491733228300046,8070823627392218987,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,2791269340090131867,8337486435613622678,4 --trace-process-track-uuid=3190708990997080739`


MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.
Refer to https://chromium.googlesource.com/chromium/src/+/main/base/memory/raw_ptr.md for details.

==2029962==END OF ADDITIONAL INFO

VERSION

Chrome Version: Chromium 147.0.7703.0 and Chromium 148.0.7729.0 dev ASAN builds
Operating System: Linux x86_64 on the two provided repro hosts (Ubuntu 22.04.3 LTS class and Ubuntu 25.04 class)

REPRODUCTION CASE

Primary HTML artifact: poc_standalone.html

Required flags (for PoC, not related to the vulnerability): --no-first-run --no-default-browser-check --disable-background-networking

chrome file:///path/to/poc_standalone.html --no-first-run --no-default-browser-check --disable-background-networking

Note: due to requiring race condition to reach this vulnerability, the PoC is a bit flaky and can take longer time (~1min) to crash on a slower machine. Also, please retry if it doesn't crash.

FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION

Type of crash: Renderer process crash

CREDIT INFORMATION

Reporter credit: heapracer

The original report as published on the Chromium issue tracker, by heapracer. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

This is a heap-use-after-free in Chromium's Blink engine, inside the OffscreenCanvas code paths in core and modules. The crash lands in mojo::Handle::is_valid(), reached through blink::CanvasResourceDispatcher::OnBeginFrame.

OffscreenCanvas lets script draw into a canvas that is not attached to the DOM, and the rendering can be handed to a compositor through a CanvasResourceDispatcher. That dispatcher owns a Mojo remote to a viz::mojom::blink::CompositorFrameSink and receives OnBeginFrame callbacks from the compositor. The bug is that one of those callbacks can run against a dispatcher that has already been freed.

Setup

The crash was reproduced on two ASAN builds:

  • Chromium 147.0.7703.0
  • Chromium 148.0.7729.0 dev

Both on Linux x86_64, on two repro hosts described as Ubuntu 22.04.3 LTS class and Ubuntu 25.04 class.

The primary artifact is an HTML file, poc_standalone.html. The report lists three flags as required for the PoC, explicitly noting they are not related to the vulnerability:

Text
--no-first-run --no-default-browser-check --disable-background-networking

The PoC is launched directly against the file:

Bash
chrome file:///path/to/poc_standalone.html --no-first-run --no-default-browser-check --disable-background-networking

The report warns that reaching the bug requires a race condition, so the PoC is somewhat flaky and can take around a minute to crash on a slower machine, and that it should be retried if it does not crash.

Finding it

The crash is a renderer process crash. AddressSanitizer reports a heap-use-after-free, a READ of size 8, on thread T0 (chrome). The faulting read happens in std::__Cr::unique_ptr<viz::mojom::blink::CompositorFrameSinkProxy, ...>::operator bool() const, reached through mojo::internal::InterfacePtrState<viz::mojom::blink::CompositorFrameSink>::ConfigureProxyIfNecessary(), instance(), and then mojo::Remote<viz::mojom::blink::CompositorFrameSink>::get() and operator->(). The frame that matters is:

So the dispatcher is dereferencing its Mojo remote inside OnBeginFrame at line 416, and the memory behind it has already been released.

The freed region is 472 bytes, and the faulting address sits 112 bytes inside it. The free stack shows who released it:

This is the key observation: the free happens re-entrantly, from inside CanvasResourceDispatcher::OnBeginFrame itself. At line 413 the dispatcher calls into PushFrame(), which reaches FinalizeFrame(), then GetOrCreateResourceProvider(), and that calls LoseContext(), which deletes the object. Control then returns to OnBeginFrame, which continues to line 416 and touches the now-freed dispatcher. The use is the same callback that caused the free.

The allocation stack shows where the dispatcher came from:

The dispatcher is created lazily when the canvas draws, and the draw that triggers creation here comes from setting the width attribute on an OffscreenCanvas from script, which calls SetSize, then DidDraw, then GetOrCreateResourceDispatcher. The allocation stack also shows the script was running from a timer: blink::DOMTimer::Fired() and blink::ScheduledAction::Execute() appear further down, with V8 microtask execution in between.

The report also records the MiraclePtr status of the crash:

Text
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.

That is, the freed region was not protected by a raw_ptr<T>, and the crash remains exploitable even with MiraclePtr enabled.

Exploitation

Step 1: create and size an OffscreenCanvas from script

The allocation stack shows the dispatcher being created from the width setter on an OffscreenCanvas, invoked from a timer callback. Setting the size calls OffscreenCanvas::SetSize, which calls DidDraw, which calls GetOrCreateResourceDispatcher, which allocates the CanvasResourceDispatcher with make_unique.

Step 2: let the compositor deliver a BeginFrame

The dispatcher registers a CompositorFrameSinkClient. When the compositor sends a BeginFrame, the message is dispatched through Mojo (mojo::Connector::ReadAllAvailableMessages, MultiplexRouter::ProcessIncomingMessage, InterfaceEndpointClient::HandleValidatedMessage) into viz::mojom::blink::CompositorFrameSinkClientStubDispatch::Accept, and then into blink::CanvasResourceDispatcher::OnBeginFrame.

Step 3: trigger the re-entrant free inside the callback

Inside OnBeginFrame, at canvas_resource_dispatcher.cc:413, the dispatcher calls PushFrame(). That reaches [redacted]::FinalizeFrame, then GetOrCreateResourceProvider, which calls LoseContext. LoseContext frees the dispatcher (the 472-byte region).

Step 4: return to the callback and read freed memory

After PushFrame() returns, OnBeginFrame continues to line 416 and dereferences its Mojo remote to the CompositorFrameSink. The remote's internal unique_ptr to the proxy is read, and ASan reports the heap-use-after-free. The read is 8 bytes at an address 112 bytes inside the freed region.

Step 5: repeat until the race lands

Because the free and the use depend on the ordering of the compositor callback and the canvas frame push, the PoC is racy. The report notes it can take around a minute on a slower machine and may need retries.

Root cause

CanvasResourceDispatcher::OnBeginFrame calls PushFrame() and then keeps using its own members. PushFrame() can synchronously reach [redacted]::LoseContext, which destroys the dispatcher. The callback therefore continues executing on a this pointer that has been deleted. The use at line 416 is a plain member access through the Mojo remote, so nothing intercepts it.

The existing defence that would normally catch this class of bug, MiraclePtr, did not help: the report states the region was NOT PROTECTED, no raw_ptr<T> access was detected before the crash, and the crash is still exploitable with MiraclePtr. In other words, the pointer used to reach the freed object was not one of the checked pointer types.

Impact

The report classifies the crash as a renderer process crash. It does not describe a sandbox escape, an information leak, or a path to code execution, and it does not state what an attacker could achieve beyond triggering the crash. The severity recorded for the issue is critical, and the report notes the crash remains exploitable with MiraclePtr, but the concrete consequences beyond a renderer crash are not spelled out in the text.

Fix

The report does not describe a fix or a code change. What it establishes is the exact re-entrancy: OnBeginFrame must not assume the dispatcher survives the PushFrame() call, and the use at canvas_resource_dispatcher.cc:416 needs to be guarded against the object having been destroyed during that call.

Variants to test

  • Other callbacks that call into canvas frame pushing and then touch dispatcher state afterwards. A positive result is an ASan use-after-free whose free stack passes through LoseContext and whose use stack returns to the same callback.
  • Other paths that reach [redacted]::LoseContext synchronously from inside a compositor or Mojo callback. A positive result is the same free-then-use pattern with the free nested inside the callback.
  • Other lazy allocations created from DidDraw or SetSize, such as the resource dispatcher here. A positive result is an object freed by a re-entrant call made from a callback that still holds a pointer to it.
  • Other OffscreenCanvas entry points driven from timers and microtasks, since the allocation stack here runs through DOMTimer::Fired and V8 microtask execution. A positive result is a crash that only appears when the canvas work is scheduled asynchronously.

Hunting notes

This kind of bug hides where a callback both drives user-controlled canvas work and then continues to use its own state. The signal in this report is the free stack being nested inside the use stack: the same function that later reads the object is the one whose call caused the free. When triaging an ASan report, compare the free stack and the use stack; if they share frames, look for a re-entrant destruction path.

The report also shows the value of checking the MiraclePtr status block: a crash marked NOT PROTECTED with no raw_ptr<T> access is a candidate for real exploitation rather than a hardening-only crash. The researcher provided a standalone HTML artifact, exact build versions, the required launch flags, and a note that the race makes the PoC flaky.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

What happened, in plain words

A security researcher found a bug in Google Chrome. The bug is in a part of Chrome called Blink, which is the engine that turns web pages into what you see on screen. More precisely, it is in a feature called OffscreenCanvas, which lets a web page draw pictures in the background, without showing them directly on the page.

The bug is a type called a use-after-free. Imagine you borrow a library book, return it, and then later try to read a page from it. The book is gone, and reading it makes no sense. In a computer, a program can free a chunk of memory (give it back), and then still try to read from it. That is a use-after-free, and it can crash the program or, in the worst case, let an attacker take control.

In this case, Chrome's drawing code frees an object and then immediately reads from it again in the same function. The result is a crash of the tab's renderer process, the part of Chrome that runs a web page.

Context

Chrome is built from a large open-source project called Chromium. Inside Chromium there is Blink, the rendering engine. Blink contains code in folders called core and modules. The bug lives in the OffscreenCanvas code paths in those folders.

OffscreenCanvas is a JavaScript feature. JavaScript is the programming language web pages use to make things happen. A normal canvas is a drawing area on the page. An offscreen canvas is a drawing area that is not attached to the page at all. A web page can draw into it and later copy the result onto the visible page, or use it for other work. This is useful for games and image processing.

When an offscreen canvas draws, Chrome can hand the drawing work to a separate part of the browser called the compositor. The compositor is the component that combines layers into the final picture. The bridge between the canvas and the compositor is an object called CanvasResourceDispatcher. This dispatcher holds a connection, called a Mojo remote, to a compositor service called viz::mojom::blink::CompositorFrameSink. Mojo is Chrome's internal messaging system: it lets different parts of the browser talk to each other safely. The compositor sends messages called OnBeginFrame callbacks back to the dispatcher, roughly meaning "a new frame is about to be drawn, do your work now".

The bug is that one of those callbacks can run against a dispatcher that has already been freed. The callback is still holding a pointer to an object that no longer exists.

Setup

The researcher reproduced the crash on two builds of Chromium:

  • Chromium 147.0.7703.0
  • Chromium 148.0.7729.0 dev

Both were ASAN builds. ASAN stands for AddressSanitizer, a tool built into the browser that watches memory and shouts loudly when a program reads or writes memory it should not. Both builds ran on Linux x86_64, on two machines described as Ubuntu 22.04.3 LTS class and Ubuntu 25.04 class.

The main file used to trigger the bug is an HTML file called poc_standalone.html. PoC stands for proof of concept: a small demonstration that proves the bug is real. The report lists three command-line flags as required for the PoC, and explicitly says they are not related to the vulnerability itself:

Text
--no-first-run --no-default-browser-check --disable-background-networking

Line by line:

  • --no-first-run tells Chrome to skip its first-run setup screens, so it starts straight into the test.
  • --no-default-browser-check stops Chrome from asking whether it should become the default browser.
  • --disable-background-networking stops Chrome from making background network requests, which keeps the test quiet and repeatable.

The PoC is launched directly against the file:

Bash
chrome file:///path/to/poc_standalone.html --no-first-run --no-default-browser-check --disable-background-networking

Line by line:

  • chrome is the browser program being started.
  • file:///path/to/poc_standalone.html is the address of the local HTML file. The file:// prefix means "open a file from this computer" rather than a website.
  • The three flags after it are the same ones listed above.

The report warns that reaching the bug requires a race condition. A race condition is when two things happen at the same time and the result depends on which one finishes first. Here, the compositor callback and the canvas frame push have to line up in a particular order. Because of that, the PoC is somewhat flaky: it can take around a minute to crash on a slower machine, and it should be retried if it does not crash.

Finding it

The crash is a renderer process crash. The renderer is the sandboxed process that runs a single web page. When it crashes, the tab goes down, but the rest of the browser usually survives.

AddressSanitizer reports a heap-use-after-free, a READ of size 8, on thread T0 (chrome). The heap is the area of memory where programs store objects they create while running. A READ of size 8 means the program tried to read 8 bytes, which is the size of a typical pointer on a 64-bit machine. Thread T0 is the main thread of that process.

The faulting read happens in std::__Cr::unique_ptr<viz::mojom::blink::CompositorFrameSinkProxy, ...>::operator bool() const. A unique_ptr is a C++ object that owns a pointer and automatically frees it when it goes out of scope. operator bool() is the check that asks "is this pointer non-empty?". That check is reached through mojo::internal::InterfacePtrState<viz::mojom::blink::CompositorFrameSink>::ConfigureProxyIfNecessary(), then instance(), then mojo::Remote<viz::mojom::blink::CompositorFrameSink>::get() and operator->(). In plain words: the code is walking through its Mojo connection object to reach the compositor, and the memory holding that connection has already been freed.

The frame that matters is:

Line by line:

  • #5 is the frame number in the stack trace. A stack trace is the list of function calls that led to the crash, like a receipt of where the program has been.
  • blink::CanvasResourceDispatcher::OnBeginFrame is the function that was running. It belongs to the CanvasResourceDispatcher class and is called when the compositor says a new frame is beginning.
  • The arguments in brackets are the data the compositor passed in: frame timing information and a list of returned resources.
  • third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.cc:416:5 is the exact file, line 416, column 5, where the read happened.

So the dispatcher is dereferencing its Mojo remote inside OnBeginFrame at line 416, and the memory behind it has already been released.

The freed region is 472 bytes, and the faulting address sits 112 bytes inside it. The free stack shows who released it:

Line by line:

  • #1 LoseContext is the function that actually freed the memory. It is the "return the book" moment.
  • #2 GetOrCreateResourceProvider is the function that called LoseContext.
  • #3 FinalizeFrame is the function that called GetOrCreateResourceProvider.
  • #4 PushFrame is the function that called FinalizeFrame.
  • #5 OnBeginFrame is the function that called PushFrame, at line 413.

This is the key observation: the free happens re-entrantly, from inside CanvasResourceDispatcher::OnBeginFrame itself. Re-entrant means a function calls something that ends up calling back into the same code path before the first call has finished. At line 413 the dispatcher calls into PushFrame(), which reaches FinalizeFrame(), then GetOrCreateResourceProvider(), and that calls LoseContext(), which deletes the object. Control then returns to OnBeginFrame, which continues to line 416 and touches the now-freed dispatcher. The use is the same callback that caused the free.

The allocation stack shows where the dispatcher came from:

Line by line:

  • #1 make_unique is the C++ helper that creates a new object and wraps it in a unique_ptr. This is where the 472-byte dispatcher was born.
  • #2 GetOrCreateResourceDispatcher is the function that decided to create the dispatcher.
  • #3 DidDraw is the notification that a draw happened.
  • #4 non-virtual thunk to DidDraw is a compiler-generated trampoline that forwards the call to the right version of DidDraw.
  • #5 and #6 are the canvas rendering context's own DidDraw functions, which pass the notification along.
  • #7 SetSize is the function that changed the canvas size.
  • #8 WidthAttributeSetCallback is the JavaScript binding: the code that runs when a script sets the width property on an OffscreenCanvas.

The dispatcher is created lazily when the canvas draws, and the draw that triggers creation here comes from setting the width attribute on an OffscreenCanvas from script, which calls SetSize, then DidDraw, then GetOrCreateResourceDispatcher. The allocation stack also shows the script was running from a timer: blink::DOMTimer::Fired() and blink::ScheduledAction::Execute() appear further down, with V8 microtask execution in between. A timer is JavaScript's setTimeout-style scheduling. V8 is Chrome's JavaScript engine. A microtask is a small piece of work that runs right after the current script finishes.

The report also records the MiraclePtr status of the crash:

Text
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.

Line by line:

  • MiraclePtr Status: NOT PROTECTED means the freed memory was not covered by MiraclePtr, a Chrome defence that makes certain pointer types refuse to touch freed memory.
  • No raw_ptr<T> access to this region was detected prior to this crash means the code did not reach the object through one of those checked pointer types.
  • This crash is still exploitable with MiraclePtr means turning that defence on would not stop this particular bug.

Exploitation

Step 1: create and size an OffscreenCanvas from script

The allocation stack shows the dispatcher being created from the width setter on an OffscreenCanvas, invoked from a timer callback. Setting the size calls OffscreenCanvas::SetSize, which calls DidDraw, which calls GetOrCreateResourceDispatcher, which allocates the CanvasResourceDispatcher with make_unique. In everyday terms: the page asks for a bigger canvas, and Chrome builds the plumbing to draw it.

Step 2: let the compositor deliver a BeginFrame

The dispatcher registers a CompositorFrameSinkClient. When the compositor sends a BeginFrame, the message is dispatched through Mojo (mojo::Connector::ReadAllAvailableMessages, MultiplexRouter::ProcessIncomingMessage, InterfaceEndpointClient::HandleValidatedMessage) into viz::mojom::blink::CompositorFrameSinkClientStubDispatch::Accept, and then into blink::CanvasResourceDispatcher::OnBeginFrame. In everyday terms: the compositor taps the dispatcher on the shoulder and says "draw now", and the message travels through Chrome's internal post office to get there.

Step 3: trigger the re-entrant free inside the callback

Inside OnBeginFrame, at canvas_resource_dispatcher.cc:413, the dispatcher calls PushFrame(). That reaches [redacted]::FinalizeFrame, then GetOrCreateResourceProvider, which calls LoseContext. LoseContext frees the dispatcher (the 472-byte region). In everyday terms: while answering the shoulder tap, the dispatcher does some drawing work that ends up destroying itself.

Step 4: return to the callback and read freed memory

After PushFrame() returns, OnBeginFrame continues to line 416 and dereferences its Mojo remote to the CompositorFrameSink. The remote's internal unique_ptr to the proxy is read, and ASan reports the heap-use-after-free. The read is 8 bytes at an address 112 bytes inside the freed region. In everyday terms: the dispatcher, now destroyed, carries on as if nothing happened and reads its own connection, which is no longer there.

Step 5: repeat until the race lands

Because the free and the use depend on the ordering of the compositor callback and the canvas frame push, the PoC is racy. The report notes it can take around a minute on a slower machine and may need retries. In everyday terms: the two events have to collide in the right order, so the test is run again and again until it does.

Root cause

CanvasResourceDispatcher::OnBeginFrame calls PushFrame() and then keeps using its own members. PushFrame() can synchronously reach [redacted]::LoseContext, which destroys the dispatcher. The callback therefore continues executing on a this pointer that has been deleted. In C++, this is the hidden pointer to the object a method is running on. The use at line 416 is a plain member access through the Mojo remote, so nothing intercepts it.

The existing defence that would normally catch this class of bug, MiraclePtr, did not help: the report states the region was NOT PROTECTED, no raw_ptr<T> access was detected before the crash, and the crash is still exploitable with MiraclePtr. In other words, the pointer used to reach the freed object was not one of the checked pointer types.

Impact

The report classifies the crash as a renderer process crash. It does not describe a sandbox escape, an information leak, or a path to code execution, and it does not state what an attacker could achieve beyond triggering the crash. The severity recorded for the issue is critical, and the report notes the crash remains exploitable with MiraclePtr, but the concrete consequences beyond a renderer crash are not spelled out in the text.

Fix

The report does not describe a fix or a code change. What it establishes is the exact re-entrancy: OnBeginFrame must not assume the dispatcher survives the PushFrame() call, and the use at canvas_resource_dispatcher.cc:416 needs to be guarded against the object having been destroyed during that call.

Variants to test

  • Other callbacks that call into canvas frame pushing and then touch dispatcher state afterwards. A positive result is an ASan use-after-free whose free stack passes through LoseContext and whose use stack returns to the same callback.
  • Other paths that reach [redacted]::LoseContext synchronously from inside a compositor or Mojo callback. A positive result is the same free-then-use pattern with the free nested inside the callback.
  • Other lazy allocations created from DidDraw or SetSize, such as the resource dispatcher here. A positive result is an object freed by a re-entrant call made from a callback that still holds a pointer to it.
  • Other OffscreenCanvas entry points driven from timers and microtasks, since the allocation stack here runs through DOMTimer::Fired and V8 microtask execution. A positive result is a crash that only appears when the canvas work is scheduled asynchronously.

Hunting notes

This kind of bug hides where a callback both drives user-controlled canvas work and then continues to use its own state. The signal in this report is the free stack being nested inside the use stack: the same function that later reads the object is the one whose call caused the free. When triaging an ASan report, compare the free stack and the use stack; if they share frames, look for a re-entrant destruction path.

The report also shows the value of checking the MiraclePtr status block: a crash marked NOT PROTECTED with no raw_ptr<T> access is a candidate for real exploitation rather than a hardening-only crash. The researcher provided a standalone HTML artifact, exact build versions, the required launch flags, and a note that the race makes the PoC flaky.

Glossary

  • AddressSanitizer (ASAN): a tool built into a program that detects memory errors such as reading memory that has already been freed.
  • Blink: the rendering engine inside Chrome that turns HTML, CSS and JavaScript into a visible page.
  • Bounty: a payment made by a company to a researcher who reports a valid security bug.
  • Callback: a function that is passed somewhere and called later, often when an event happens.
  • Canvas: a drawing area in a web page that JavaScript can paint on.
  • Compositor: the part of the browser that combines layers into the final image on screen.
  • CVE: a public identifier for a known security vulnerability.
  • Dereference: to follow a pointer and read or write the memory it points to.
  • DOM: the tree of elements that makes up a web page.
  • Flag (command-line flag): an option typed after a program's name that changes how it starts.
  • Heap: the area of memory where a program stores objects it creates while running.
  • HTML: the language used to structure web pages.
  • JavaScript: the programming language web pages use to add behaviour.
  • Linux x86_64: a common operating system running on 64-bit Intel-style processors.
  • Microtask: a small piece of JavaScript work that runs immediately after the current script finishes.
  • MiraclePtr: a Chrome defence that makes certain pointer types refuse to access freed memory.
  • Mojo: Chrome's internal messaging system that lets different parts of the browser talk to each other.
  • OffscreenCanvas: a canvas that is not attached to the page, used for drawing in the background.
  • Pointer: a value that holds the memory address of an object.
  • PoC (proof of concept): a small demonstration that proves a bug is real.
  • Race condition: a situation where the result depends on which of two things happening at the same time finishes first.
  • raw_ptr<T>: a Chrome pointer type that can be checked by MiraclePtr.
  • Re-entrant: when a function call ends up calling back into the same code before the first call has finished.
  • Renderer process: the sandboxed process that runs a single web page in Chrome.
  • Sandbox: a restricted environment that limits what a process can do if it is compromised.
  • Stack trace: the list of function calls that led to a crash.
  • Thread: a sequence of instructions running inside a process.
  • Timer: a JavaScript mechanism that runs a function after a delay.
  • unique_ptr: a C++ object that owns a pointer and frees it automatically when it goes out of scope.
  • Use-after-free: a bug where a program frees memory and then still tries to read or write it.
  • V8: Chrome's JavaScript engine.
  • VRP (Vulnerability Reward Program): a programme that pays researchers for reporting security bugs.

More by heapracer

View all

1 more disclosed report, best first.

More from Google Chrome

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.