Out of bounds write in GPU (CVE-2026-19148)
A mismatch between the tightly packed shared memory allocation and the padded row stride in XShmImagePool can cause an out-of-bounds write when a narrow, tall window is created on a 16-bit X server. An attacker could potentially trigger this via a web page that opens a 1-pixel wide popup, writing controlled pixels beyond the allocated buffer in the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 52 days
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: XShmImagePool uses Skia's tightly-packed computeMinByteSize() for shared memory allocation but an X11-derived padding for stride. A narrow window on a 16bpp X server may cause the stride to overcome the 1.5x allocation margin, leading to an OOB write. This can also be triggered by a malicious X server sending an inflated scanline_pad.
Affected files:
ui/base/x/x11_shm_image_pool.ccui/base/x/x11_util.cc
Estimated timestamp from git blame: Unknown (Google3 checkout)
1. Summary of the Issue (Meant for Human Triage)
An out-of-bounds (OOB) memory write exists in the X11 graphics pipeline within Chromium's GPU process. The vulnerability stems from an architectural discrepancy in XShmImagePool::Resize, which uses two inconsistent calculations for buffer size and row stride. Specifically, the shared memory (SHM) segment is tightly allocated using Skia's computeMinByteSize(), but the row stride passed to SkBitmap::installPixels is calculated via RowBytesForVisualWidth(), which relies on X11 scanline padding.
This divergence can be exploited in two ways:
- Benign X Server (Potential S1): On a standard 16-bit color X server (
bpp=16, scanline_pad=32), a 1-pixel wide window causes a padded stride of 4 bytes against a minimum row size of 2 bytes. This divergence overcomes the 1.5x allocation margin used byXShmImagePool. If a web adversary can coerce the browser into creating a 1-pixel wide, highly tall (e.g.,1x4096) surface (such as an override-redirect popup), they can reliably trigger an OOB write of web-controlled pixels in the sandboxed GPU process. - Malicious X Server (Hardening/S4): A compromised X server can supply an inflated, unvalidated
scanline_pad(e.g., 255), forcing an arbitrary stride discrepancy and leading to a massive OOB write during rendering. While X11 is generally within the TCB, hardening this boundary provides defense-in-depth and prevents lateral escalation into the GPU process.
2. Proof-of-Concept & Detailed Execution Flow
The divergence occurs during window resizing/reallocation in software compositing mode. The execution flow for a potential web-triggered OOB write is as follows:
-
Window Creation & Setup: A 1-pixel wide, 4096-pixel tall window or popup is requested. Chromium's X11 platform window code (
SanitizeBoundsandAdjustSizeForDisplayinui/ozone/platform/x11/x11_window.cc) explicitly permits 1x1 minimum bounds. The area is 4096, bypassing thekMinImageAreaForShmem = 256exclusion inXShmImagePool::Resize. -
Tight Allocation:
XShmImagePool::Resize(gfx::Size(1, 4096))calculates the needed memory footprint tightly using Skia:C++ // ui/base/x/x11_shm_image_pool.cc:157 SkImageInfo image_info = SkImageInfo::Make( 1, 4096, kRGB_565_SkColorType, kPremul_SkAlphaType); std::size_t needed_frame_bytes = image_info.computeMinByteSize();For
1x4096at 16bpp (minRowBytes=2),computeMinByteSize()returns(4096 - 1) * 2 + 2 = 8192bytes. -
Allocation with Threshold: The code multiplies this by
kShmResizeThreshold(1.5x) and maps the SHM segment:C++ frame_bytes_ = needed_frame_bytes * kShmResizeThreshold; // 8192 * 1.5 = 12288 bytes state.shmid = shmget(IPC_PRIVATE, frame_bytes_, IPC_CREAT | SHM_R | SHM_W | ...); state.shmaddr = reinterpret_cast<char*>(shmat(state.shmid, nullptr, 0));The kernel allocates and maps exactly 12288 bytes (perfectly aligning to three 4096-byte pages).
-
Inflated Stride Calculation: The stride is calculated using the X server's standard padding requirements:
C++ // ui/base/x/x11_util.cc:85 size_t RowBytesForVisualWidth(const x11::Connection::VisualInfo& visual_info, int width) { auto bpp = visual_info.format->bits_per_pixel; // 16 auto align = visual_info.format->scanline_pad; // 32 size_t row_bits = bpp * width; // 16 row_bits += (align - (row_bits % align)) % align; // 16 + 16 = 32 bits return (row_bits + 7) / 8; // 4 bytes } -
Pixel Binding:
installPixelsbinds the12288-byte buffer with a4-byte stride:C++ // ui/base/x/x11_shm_image_pool.cc:219 if (!state.bitmap.installPixels(image_info, state.shmaddr, row_bytes))Skia's
validRowBytes()allows this because4 >= minRowBytes(2). -
OOB Write: The compositor rasterizes into the canvas. For the final row (
y = 4095), Skia computes the memory address:shmaddr + (4095 * 4) = shmaddr + 16380. The pixel write extends to16381. Because the mapped segment ends at12287, this results in an out-of-bounds write of >4,000 bytes into adjacent GPU process memory.
Suggested Fix:
Ensure that the allocation size in XShmImagePool::Resize() explicitly accommodates the padded stride rather than relying on Skia's unpadded computeMinByteSize(). Additionally, add validation for scanline_pad to ensure it is within reasonable bounds.
3. Technical Verification Details (Automated Audit Logs - Reviewers may skip this section)
Prior Critic Verdict: "Severity: Bug (S4 / Hardening). The technical analysis of the vulnerability is 100% accurate: there is an architectural discrepancy in XShmImagePool::Resize() between the shared memory allocation size (which uses Skia's tightly bound computeMinByteSize()) and the row stride used by installPixels()... However, under Chromium's threat model, this is not a security vulnerability [because it assumes a malicious X server]."
Double-Check / Synthesizer Notes: The prior Critic's technical validation of the code divergence remains 100% accurate. However, the assumption that this ONLY triggers via a compromised X server (TCB) was re-evaluated.
- Under standard benign X11 configurations (16bpp color,
scanline_pad=32), the math proves that a 1-pixel wide window yields a stride of 4 bytes versus aminRowBytesof 2 bytes. - At a height of 4096 pixels, the
computeMinByteSizeis 8192 bytes. The 1.5x allocation threshold (kShmResizeThreshold) setsframe_bytes_to 12288 bytes. - Skia's write offset for the last row is
4095 * 4 = 16380. - Because 16380 > 12288 (and effectively bypasses page-rounding since 12288 is exactly 3 pages), an OOB write is mathematically proven.
ui/ozone/platform/x11/x11_window.ccSanitizeBoundsbounds checking allows 1x1 windows (std::max(bounds.width(), 1)).- Web capabilities to spawn 1px-wide surfaces (e.g. override-redirect popups) elevate this from an S4 TCB-hardening issue to a potential S1 GPU sandbox escape. The technical mechanics of the divergence are unequivocally confirmed.
Evaluated with Chrome root at commit: 8c517fbcbb533e59ec9cedac868c8a9bdc30beb2
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
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 allocation size uses Skia's unpadded minimum byte size while the row stride includes X11 scanline padding, and the 1.5x allocation margin is insufficient to cover the padding for very narrow windows.
Impact
A web adversary could potentially trigger an out-of-bounds write of web-controlled pixels in the sandboxed GPU process, and a malicious X server could cause a massive out-of-bounds write, though the latter is considered defense-in-depth.
What the attacker needed
16-bit colour X server; ability to create a 1-pixel wide window; software compositing mode
The fix
The allocation size in XShmImagePool::Resize() should explicitly accommodate the padded stride, and scanline_pad should be validated to be within reasonable bounds.
How it was found
- Create a 1-pixel wide, 4096-pixel tall window or popup.
- The window size bypasses the minimum area exclusion for shared memory.
- The shared memory is allocated with a size based on Skia's minimum byte size multiplied by 1.5.
- The row stride is calculated using X11 scanline padding, resulting in a larger stride than the minimum.
- The bitmap is installed with the larger stride, and drawing the last row writes beyond the allocated buffer.
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 the browser draws a window, it reserves a block of memory for the pixels. The amount reserved is calculated one way, but the step size between rows is calculated another way, and they don't match. If the window is very narrow and tall, the step size can be larger than expected, so drawing the last row writes past the end of the reserved memory, corrupting other data.
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.