Skip to content
Memory corruption Advisory Advanced CVE-2026-106284

Out of bounds read in Printing (CVE-2026-106284)

A bounds check in the Windows printing code compared two attacker-controlled size fields against each other instead of against the real record size, so a crafted EMF comment record could make the browser read past the end of a heap buffer. A compromised utility process could use this to crash the privileged browser process or leak memory contents.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 4 months

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: A potential heap out-of-bounds read exists in PostScriptMetaFile::SafePlayback when parsing malformed GDI comment records from an EMF stream. By manipulating the record's physical size (nSize) relative to its claimed comment data size (cbData), a compromised utility process could trigger an out-of-bounds read of up to 1022 bytes. This could lead to a crash of the privileged browser process (Denial of Service) or an information leak on Windows.

Affected files:

  • printing/emf_win.cc

Estimated timestamp from git blame: 2026-03-25

Summary

There is a potential Out-of-Bounds (OOB) heap read vulnerability in PostScriptMetaFile::SafePlayback inside printing/emf_win.cc. The function processes EMR_GDICOMMENT records from an EMF blob returned by the sandboxed PDF conversion utility process (kPdfConversion). However, it fails to perform proper bounds checking on the size of the record payload relative to the actual physical record boundary (emf_record->nSize). A compromised utility process could return a crafted EMF record that triggers a heap out-of-bounds read of up to 1022 bytes in the privileged browser process during print operations on Windows.

Vulnerability Analysis

In PostScriptMetaFile::SafePlayback (printing/emf_win.cc):

C++
bool PostScriptMetaFile::SafePlayback(HDC hdc) const {
  Emf::Enumerator emf_enum(*this, nullptr, nullptr);
  for (const Emf::Record& record : emf_enum) {
    const ENHMETARECORD* emf_record = record.record();
    if (emf_record->iType != EMR_GDICOMMENT) {
      continue;
    }

    const auto* comment = reinterpret_cast<const EMRGDICOMMENT*>(emf_record);
    const char* data = reinterpret_cast<const char*>(comment->Data);
    const uint16_t ps_payload_size = *reinterpret_cast<const uint16_t*>(data);
    const uint32_t data_size = 2 + ps_payload_size;
    static constexpr uint16_t kExpectedPdfiumMax = 1024 + 2;
    if (data_size != comment->cbData || data_size > kExpectedPdfiumMax) {
      continue;
    }

    int ret = ExtEscape(hdc, PASSTHROUGH, data_size, data, 0, nullptr);
    DCHECK_EQ(ps_payload_size, ret);
  }
  return true;
}

The function reads ps_payload_size from comment->Data and compares data_size = 2 + ps_payload_size to comment->cbData and kExpectedPdfiumMax (1026). This is a consistency check on attacker-controlled values, not a physical bounds validation. Specifically, it never verifies that data_size (or comment->cbData) is less than or equal to emf_record->nSize - 12 (the actual space allocated for the payload inside the EMF record).

By default on Windows, out-of-process (OOP) printing is disabled because kEnableOopPrintDrivers is defined as FEATURE_DISABLED_BY_DEFAULT (see printing/printing_features.cc). Consequently, SafePlayback executes inside the privileged browser process.

A compromised utility process can return a crafted EMF blob with an EMR_GDICOMMENT record where nSize is small (e.g., 16 bytes, meaning comment->Data only has 4 bytes of valid allocation), but cbData is 1026 and ps_payload_size is 1024. All conditions in the validation check will be satisfied:

  • data_size == comment->cbData (1026 == 1026) -> True
  • data_size <= 1026 -> True

Subsequently, ExtEscape(hdc, PASSTHROUGH, 1026, data, 0, nullptr) is called, which instructs GDI to read 1026 bytes starting from data. Since the allocated record has nSize = 16, only the first 4 bytes are valid, leading to a heap out-of-bounds read of up to 1022 bytes beyond the record boundaries.

Potential Steps to Trigger

Note: The following are potential steps that an attacker could follow to trigger this vulnerability, as our automated analysis tooling cannot execute code dynamically.

  1. Compromise the kPdfConversion utility process (for example, through a separate parser exploit in PDFium).
  2. Lure the victim to trigger a print operation on a page to a PostScript-compatible printer (or a 'Generic / Text Only' driver) to ensure the printer mode is set to PostScript.
  3. Intercept the Mojo ConvertPage reply from the utility process to the browser, returning a crafted EMF blob inside the ReadOnlySharedMemoryRegion containing:
    • A valid ENHMETAHEADER
    • An EMR_GDICOMMENT record with iType = 70 (EMR_GDICOMMENT), nSize = 16, cbData = 1026, and the first 2 bytes of Data set to 0x0400 (little-endian uint16_t representing 1024).
    • A valid EMR_EOF record.
  4. When the browser process receives this EMF blob, it will invoke PostScriptMetaFile::SafePlayback. GDI parses the record using EnumEnhMetaFile and passes it to the safe playback loop.
  5. The browser process executes the consistent check, passes it, and calls ExtEscape with a size of 1026, triggering an out-of-bounds heap read of up to 1022 bytes in the browser process.

Suggested Fix

Ensure that the size of the comment data does not exceed the boundaries defined by the record size (nSize). Specifically, verify that emf_record->nSize is large enough to contain the EMRGDICOMMENT struct header and the claimed comment->cbData payload before accessing the structure's fields:

C++
if (emf_record->nSize < sizeof(EMRGDICOMMENT) ||
    comment->cbData > emf_record->nSize - offsetof(EMRGDICOMMENT, Data)) {
  continue;
}

Evaluated with Chrome root at commit: 5133b93d189b383c37805b1cf3a9d2dbfe8d7379


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.

The original report as published on the Chromium issue tracker. 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.

How it worked

Root cause

The validation compared the claimed comment size with a derived payload size but never confirmed that this size fits within the physical EMF record boundary given by nSize.

Impact

This could crash the privileged browser process (denial of service) or leak information on Windows; the text notes out-of-process printing is disabled by default, so the code runs in the browser process.

What the attacker needed

Compromised utility process; victim prints to a PostScript driver; ability to intercept the conversion reply

The fix

The record size should be checked so that the claimed comment data cannot exceed the space actually available inside the record before any fields are read.

How it was found

  1. Compromise the PDF conversion utility process, for example via a separate parser bug.
  2. Get the victim to print a page using a PostScript-compatible printer driver.
  3. Intercept the conversion reply and return a crafted EMF blob with a small record size but a large claimed comment size.
  4. The browser parses the blob and passes the record to the safe playback loop.
  5. The size check passes and the escape call reads beyond the allocated record.

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 a program reads a chunk of data, it should first check that the chunk really fits inside the memory it was given. Here the code checked that two numbers inside the data agreed with each other, but never checked them against the actual size of the record, so it could read up to about a kilobyte past the end of the buffer. That can crash the browser or expose leftover memory.

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 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.