Skip to content
Memory corruption Advisory Advanced CVE-2024-4558

Use after free in ANGLE (CVE-2024-4558)

gelatin dessert Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 9 days

Steps to reproduce the problem

/

Problem Description

Description

This vulnerability occurs in the GPU process and may lead to sandbox escape.

Root Cause

This vulnerability comes from the incomplete repair of CVE-2021-4058: https://issues.chromium.org/issues/40057837 We should set pixel unpack state for compressed textures. However, the fix here only fixes the compressedTexImage3D part, and the vulnerability can still be triggered through webgl's compressedTexSubImage3D function.

Test Environment

reproduce

1. Download the newest asan-mac-release chromium
2. ./Chromium.app/Contents/MacOS/Chromium --user-data-dir=./user --enable-logging=stderr --use-angle=gl http://127.0.0.1:8000/poc.html

Fix Patch

diff --git a/src/libANGLE/renderer/gl/TextureGL.cpp b/src/libANGLE/renderer/gl/TextureGL.cpp
index 2e3d4c852..485847b24 100644
--- a/src/libANGLE/renderer/gl/TextureGL.cpp
+++ b/src/libANGLE/renderer/gl/TextureGL.cpp
@@ -664,6 +664,7 @@ angle::Result TextureGL::setCompressedSubImage(const gl::Context *context,
         nativegl::GetCompressedSubTexImageFormat(functions, features, format);
 
     stateManager->bindTexture(getType(), mTextureID);
+    ANGLE_TRY(stateManager->setPixelUnpackState(context, unpack));
     if (nativegl::UseTexImage2D(getType()))
     {
         ASSERT(area.z == 0 && area.depth == 1);

Summary

Heap-Buffer-Overflow in glgCopyRowsWithMemCopy

Custom Questions

Type of crash:

gpu

Reporter credit:

gelatin dessert

Additional Data

Category: Security
Chrome Channel: Not sure
Regression: N/A

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

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 high-severity memory corruption bug in ANGLE (Google Chrome). Chrome VRP made it public on 7 May 2024 as CVE-2024-4558. Fixed in version 124.0.6367.155.

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.

More by gelatin dessert

View all

3 more disclosed reports, 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.