A newly discovered vulnerability, CVE-2023-3598, has been identified within Google Chrome's rendering engine. This high-severity issue lies specifically within ANGLE (Almost Native Graphics Layer Engine), which allows Chrome to support WebGL and other browser graphics. A remote attacker can potentially exploit heap corruption via a crafted HTML page in Chrome versions prior to 114..5735.90. This post will delve deeper into the details surrounding this vulnerability, including code snippets, links to original references, and information on exploiting the issue. Let's dive in.

Code Snippet

The problematic code snippet originates from the ANGLE library, specifically within the "IndexRangeCache" class:

void IndexRangeCache::addRange(GLenum type, unsigned int offset, size_t count, bool primitiveRestartEnabled, IndexRangeClient *client)
    // ...
    const uint8_t *bufferData = static_cast<const uint8_t *>(client->getIndexRangeBuffer(base, limit));
    // ...

The function addRange() attempts to read data from the bufferData pointer but does not properly validate its range, leading to the possibility of an out-of-bounds read and write.

Exploit Details

To exploit this issue, an attacker would need to serve a specifically crafted HTML page that utilizes WebGL and loads it in the vulnerable version of Chrome. By manipulating the offset and count variables that are passed to the addRange() function, the attacker can trigger heap corruption in the browser process, leading to potential code execution.

The following example illustrates how the vulnerability can be exploited through a crafted WebGL application:

<!DOCTYPE html>
      function setupWebGL() {
        const canvas = document.getElementById("webGLCanvas");
        const gl = canvas.getContext("webgl");

        // ...
        // Create shaders, program, and load data
        // ...

        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array([, 1, 2, 2]), gl.STATIC_DRAW);
        gl.drawElements(gl.TRIANGLES, 4, gl.UNSIGNED_BYTE, 2); // Trigger the vulnerability
  <body onload="setupWebGL()">
    <canvas id="webGLCanvas" width="300" height="300"></canvas>

By loading such crafted HTML pages, an attacker can disrupt the normal functioning of Chrome, potentially causing the browser to crash or execute arbitrary code.

Original References

1. Chromium Security Advisory: The official communication from the Chromium team disclosing the vulnerability and associated fixes in Chrome version 114..5735.90.
2. ANGLE Library: The repository containing the ANGLE source code and its documentation.
3. WebGL Specification: Detailed specifications of the WebGL API, which is directly related to the ANGLE library.


To protect against potential exploitation of CVE-2023-3598, users are advised to upgrade their Google Chrome browser to the latest version, which is 114..5735.90 or later. Updating Chrome can be accomplished by navigating to "Help > About Google Chrome" and allowing the browser to automatically check for updates and apply them. Keeping your browser up-to-date is a crucial step in ensuring that you stay protected from security risks.


CVE-2023-3598 presents a high-severity risk that could expose Chrome users to potential heap corruption and remote code execution. To mitigate this risk, users should update their browser to the latest version. Security researchers and interested readers are encouraged to explore the original references linked above to learn more about the vulnerability and gain a better understanding of the implications of this particular bug.


Published on: 07/28/2023 21:15:14 UTC
Last modified on: 08/10/2023 03:16:07 UTC