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

Missing array size check in FilterNodeD2D1

The FilterNodeD2D1 graphics component accesses its mInputSurfaces array in SetInput() without properly validating the array index, causing an out-of-bounds write. An attacker who can reach this code path could corrupt memory, potentially leading to a crash or code execution.

LEE YESEOP Follow

Originally disclosed on Mozilla

  • Fixed in 32 days
  • Paid in 34 days
  • Disclosed after 32 days
Text
Created attachment 9346859
result.txt

|FilterNodeD2D1| is used by graphics rendering. In certain situations, |mInputSurfaces| array is accessed in |SetInput()|[1]. However, the array index, |mIndex| is not verified properly. This is a typical out-of-bounds write scenario and there is an out-of-bounds write in another |SetInput()|[2].  I tried to make an ASAN report but I found it not easy. Instead, the callstack when crashed is attached.

[1]: https://searchfox.org/mozilla-central/source/gfx/2d/FilterNodeD2D1.cpp#690 
[2]: https://searchfox.org/mozilla-central/source/gfx/2d/FilterNodeD2D1.cpp#725 


REPRODUCE
Operating System: Windows
1.apply *patch.diff
2.visit index.html

*: Patch to emulate a compromised content process.


Crash State: see result.txt

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 SetInput() method uses an attacker-influenced index to write into the mInputSurfaces array without first checking that the index is within the array's bounds.

Impact

An out-of-bounds write in the graphics rendering code could crash the browser and may allow memory corruption that an attacker could exploit, though the report only demonstrates a crash.

What the attacker needed

Windows operating system; compromised content process

How it was found

  1. Apply the provided patch to emulate a compromised content process
  2. Visit the index.html page

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.

A program stores a list of items in a fixed-size array and uses a number (the index) to pick one. If that number is not checked, the program can write past the end of the array into neighbouring memory. That memory corruption can crash the browser or, in the worst case, 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.