Use after free in ANGLE (CVE-2024-4558)
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
- OS: macOS Ventura 13.5.2(22G91)
- iMac GPU : AMD Radeon Pro Vega 48
- mac-release_asan-mac-release-1293464
- download link: https://commondatastorage.googleapis.com/chromium-browser-asan/index.html?prefix=mac-release/asan-mac-release-129
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
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.