Skip to content
Memory corruption Disclosed report Advanced CVE-2023-4574

use-after-free in ColorPickerShownCallback

A colour picker callback object could be destroyed while other callbacks for the same picker were still pending, so a second completion call touched freed memory. An attacker with a compromised content process could trigger a use-after-free crash, and potentially worse, in the browser process.

LEE YESEOP Follow

Originally disclosed on Mozilla

  • Fixed in 13 days
  • Paid in 13 days
  • Disclosed after 13 days
Text
Created attachment 9346872
ASAN.txt

|ColorPickerShownCallback| is requested when a Color Picker window open[1]. It isn’t considered several |ColorPickerShownCallbacks| are requested at a time. And |Done()| will destroy |mColorPickerParent|[2]. This leads to use-after-free when another |Done()| is called after a |Done()|

[1]: https://searchfox.org/mozilla-central/source/dom/ipc/ColorPickerParent.cpp#66
[2]: https://searchfox.org/mozilla-central/source/dom/ipc/ColorPickerParent.cpp#30


REPRODUCE
1. apply *patch.diff
2. visit index.html

*: Patch to emulate a compromised content process.


Crash State: see asan file

The original report as published on Mozilla's Bugzilla, by LEE YESEOP. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the code assumed only one ColorPickerShownCallback existed per picker, so Done() destroyed the shared parent while other callbacks still referenced it.

Impact

A compromised content process could cause a use-after-free in the browser process, leading to a crash and potentially memory corruption.

What the attacker needed

Compromised content process; attacker-supplied patch to emulate it

How it was found

  1. Apply the provided patch that emulates a compromised content process
  2. Visit the test page that opens the colour picker

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 you open a colour picker, the browser keeps a small helper object to know when the picker is finished. The code assumed only one helper existed at a time, but several could be created, and finishing one threw the shared object away while others still pointed at it. Using something after it has been thrown away is called a use-after-free and can crash the browser or let an attacker run their own code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by LEE YESEOP

View all

8 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.