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

Double free in PDFium (CVE-2026-87585)

A double-free exists in the OpenJPEG copy bundled with Chrome, reachable when a PDF containing a JPX image is rendered and one allocation returns nullptr. An attacker could crash the renderer and potentially corrupt the heap by supplying a crafted image that induces memory pressure.

Jeongkihyun Follow

Originally disclosed on Chrome VRP

Bounty$500 High View original
  • Fix shipped in 41 days

Report description

Double-free in Chrome's bundled OpenJPEG (opj_j2k_copy_default_tcp_and_create_tcd) reachable from PDF rendering when PartitionAlloc returns nullptr


Bug location

Where do you want to report your vulnerability?

Chrome VRP – Report security issues affecting the Chrome browser. See program rules

Which URL (or repository) have you found the vulnerability in?

https://pdfium.googlesource.com/pdfium/+/refs/heads/main/third_party/libopenjpeg/j2k.c


The problem

Please describe the technical details of the vulnerability

Summary

The OpenJPEG copy Chrome bundles (third_party/libopenjpeg, 2.5.4 rev 6c4a29b0) contains a double-free reachable from a single JPX image inside a PDF. The trigger is one opj_malloc() returning nullptr — which PDFium deliberately allows, so this is a designed code path rather than an anomaly.

The defect is also unfixed upstream (OpenJPEG master 402ef586, 2026-07-07).

All j2k.c line numbers below refer to the file Chrome ships, third_party/libopenjpeg/j2k.c at bundle 2.5.4 rev 6c4a29b0. The corresponding upstream lines are 9 lower in opj_j2k_copy_default_tcp_and_create_tcd() and 10 lower in the teardown functions.

Root cause

opj_j2k_copy_default_tcp_and_create_tcd() clones the default TCP once per tile. It memcpys the whole struct, then clears "memory not owned by this tile" — but it clears only the pointer and capacity fields and misses the count fields:

C
/* j2k.c:9236-9251 */
for (i = 0; i < l_nb_tiles; ++i) {
    l_current_tccp = l_tcp->tccps;
    memcpy(l_tcp, l_default_tcp, sizeof(opj_tcp_t));   /* copies m_nb_mct_records = N too */
    ...
    /* Remove memory not owned by this tile in case of early error return. */
    l_tcp->m_mct_decoding_matrix = 00;
    l_tcp->m_nb_max_mct_records  = 0;      /* capacity IS cleared */
    l_tcp->m_mct_records         = 00;
    l_tcp->m_nb_max_mcc_records  = 0;
    l_tcp->m_mcc_records         = 00;
    /* m_nb_mct_records is NOT cleared -> stays at N */

The record array is then shallow-copied, so every entry's m_data aliases the default TCP's buffer:

C
/* j2k.c:9266-9272 */
l_mct_records_size = l_default_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t);
l_tcp->m_mct_records = (opj_mct_data_t*)opj_malloc(l_mct_records_size);
if (! l_tcp->m_mct_records) { return OPJ_FALSE; }
memcpy(l_tcp->m_mct_records, l_default_tcp->m_mct_records, l_mct_records_size);

A loop then gives each entry its own buffer, clearing the alias one entry at a time. If that allocation fails at index j, entries j..N-1 are left aliasing the default TCP:

C
/* j2k.c:9278-9294 */
for (j = 0; j < l_default_tcp->m_nb_mct_records; ++j) {
    if (l_src_mct_rec->m_data) {
        l_dest_mct_rec->m_data = (OPJ_BYTE*) opj_malloc(l_src_mct_rec->m_data_size);
        if (! l_dest_mct_rec->m_data) {
            return OPJ_FALSE;              /* <-- entries j..N-1 remain aliases */
        }
        memcpy(l_dest_mct_rec->m_data, l_src_mct_rec->m_data, l_src_mct_rec->m_data_size);
    }
    ++l_src_mct_rec;
    ++l_dest_mct_rec;
    /* Update with each pass to free exactly what has been allocated on early return. */
    l_tcp->m_nb_max_mct_records += 1;      /* <-- bumps CAPACITY, not COUNT */
}

This is the crux. The author did implement per-pass rollback tracking, and wrote the intent in the comment — "Update with each pass to free exactly what has been allocated on early return." — but incremented m_nb_max_mct_records (capacity), while the destructor iterates m_nb_mct_records (count):

C
/* j2k.c:9525-9536  opj_j2k_tcp_destroy() */
if (p_tcp->m_mct_records) {
    opj_mct_data_t * l_mct_data = p_tcp->m_mct_records;
    for (i = 0; i < p_tcp->m_nb_mct_records; ++i) {     /* iterates N times */
        if (l_mct_data->m_data) {
            opj_free(l_mct_data->m_data);                /* frees the aliases too */
            l_mct_data->m_data = 00;
        }
        ++l_mct_data;
    }

So the default TCP's m_data is freed twice. opj_j2k_destroy() runs the two teardowns in this order:

  1. j2k.c:9374 — the default TCP. First free.
  2. j2k.c:9417 → opj_j2k_cp_destroy() → j2k.c:9574 — the per-tile TCP array, which is what still holds the aliases. Second free.

The intended guard does nothing because of one wrong field name. This is not intended behaviour — the comment states the intent that the code fails to implement.

Why only the MCT records

Every field opj_j2k_tcp_destroy() frees was cross-checked. Only m_mct_records has all three properties at once and is reachable:

FIELD                         COUNT   PER-ELEMENT   DTOR ITERATES
                              STALE   OWNED PTR     THE COUNT       RESULT
--------------------------------------------------------------------------
m_mct_records                 yes     yes           yes  (:9529)    DOUBLE-FREE
m_mcc_records                 yes     no            -                safe
  array freed whole (:9519); members are offsets into m_mct_records (:9316)
m_mct_decoding_matrix         no      -             -                safe
  cleared at :9247
m_mct_coding_matrix (:8242)   yes     -             -                safe
mct_norms           (:8270)   yes     -             -                safe
  both encoder-only allocations, NULL when decoding
tccps                         no      -             -                safe
  reattached at :9253
m_data / m_data_size          -       -             -                safe
  inlined opj_j2k_tcp_data_destroy; tile payload, only set during tile
  decoding, so default_tcp never holds one
ppt_buffer                    YES     yes           -                LATENT
  opj_j2k_merge_ppt() (:4240). Unreachable today: PPT is a tile-part-
  header-only marker, so default_tcp never holds one
ppt_markers /                 YES     yes           YES              LATENT
ppt_markers_count
  m_data per entry, freed in a loop over the count at :9488. Same shape as
  m_mct_records, unreachable for the same reason as ppt_buffer

The last two rows are not exploitable today, but they are the same mistake — the copy function clears neither the pointer nor the count.

Why nullptr is reachable in Chrome, and not a theoretical condition

PDFium replaces OpenJPEG's allocator (third_party/libopenjpeg/0034-opj_malloc.patch) and documents that it may fail:

C
// core/fxcrt/fx_memory.h:16
// For external C libraries to malloc through PDFium. These may return nullptr.
void* FXMEM_DefaultAlloc(size_t byte_size);
C++
// core/fxcrt/fx_memory_pa.cpp:38-49
void* Alloc(size_t num_members, size_t member_size) {
  ...
  return GetGeneralPartitionAllocator()
      .root()
      ->Alloc<partition_alloc::AllocFlags::kReturnNull>(total.ValueOrDie(),
                                                        "GeneralPartition");
}

So OpenJPEG receiving nullptr is by design, not an edge case.

And the affected allocation runs in bulk. The attached poc.pdf is 14,143 bytes and declares 65,025 tiles with 10 MCT records per tile — record 0 being 4096 bytes. Because the copy is per tile, rendering that one page performs the 4096-byte allocation 65,026 times (65,025 tiles + the original in the default TCP), and peak renderer RSS reaches ~1.42 GiB.

The tile count, the MCT record count and each record's size are all read from the codestream, so an attacker scales the demand at will — this is input-induced memory pressure, not an incidental OOM. Any one of those 65,026 nullptr returns produces the double-free; no race to win and no offset to guess.

What was observed

Chrome 150.0.7871.187 x64, Windows 11, renderer process, with a Job Object ProcessMemoryLimit of 1200 MB applied to the browser (children inherit the job). No modification to Chrome, and no command-line flag.

INPUT                                              RUNS   RESULT
------------------------------------------------------------------------
poc.pdf                                            3      renderer crash, 3/3
control PDF (ordinary image, otherwise identical)  2      no crash,       0/2

The three crashes are identical:

exception    0xC0000005  ACCESS_VIOLATION
access       write
RIP          chrome.dll+0x3870B70      (inside PartitionAlloc's free path)
faulting     movq $0x0,(%rdi)          8-byte store; RDI equals the faulting address
addresses    0x000012E000679C00 / 0x00006EA000678000 / 0x00001E1800678000

This is not Chrome's deliberate out-of-memory abort, which is 0xE0000008. The faulting addresses share their low bits while the ASLR-dependent upper bits differ.

The renderer stack for all three, recovered from the minidumps plus the shipped chrome.dll:

#0  chrome.dll+0x3870B70   PartitionRoot::Free
#1  chrome.dll+0x972E0DC   opj_j2k_tcp_destroy            j2k.c:9531
#2  chrome.dll+0x972DC20   opj_j2k_destroy                j2k.c:9574
#3  chrome.dll+0x9739368   opj_destroy_codec
#4  chrome.dll+0x96EBD4A   fxcodec::CJPX_Decoder::~CJPX_Decoder
#5  chrome.dll+0x96EB1C1   fxcodec::CJPX_Decoder::Create  [Init() returned false]
#6  chrome.dll+0x9625559   CPDF_DIB::LoadJpxBitmap        cpdf_dib.cpp:634
#7  chrome.dll+0x96230BB   CPDF_DIB::CreateDecoder        cpdf_dib.cpp:474
#8  chrome.dll+0x9623ACE   CPDF_DIB::StartLoadDIBBase     cpdf_dib.cpp:227

Two things in that stack are worth noting. Frame #2 is j2k.c:9574, the per-tile teardown — the second free — and not j2k.c:9374, the default-TCP teardown, which has already returned. And frame #5 shows CJPX_Decoder::Create running the destructor on its Init() == false branch, i.e. header parsing failed, which is exactly what opj_j2k_copy_default_tcp_and_create_tcd() returning OPJ_FALSE after a failed opj_malloc produces. A successful decode never reaches this code.

Independently, an ASAN build of pdfium_test in Chrome's own allocator configuration, given the same input, reports the defect by name:

ERROR: AddressSanitizer: attempting double-free on 0x7d8ffbe50e80
    #2 opj_j2k_tcp_destroy   third_party/libopenjpeg/j2k.c:9531
    #3 opj_j2k_destroy       third_party/libopenjpeg/j2k.c:9574   <- second free
  freed by thread T0 here:
    #2 opj_j2k_tcp_destroy   third_party/libopenjpeg/j2k.c:9531
    #3 opj_j2k_destroy       third_party/libopenjpeg/j2k.c:9374   <- first free
  previously allocated by thread T0 here:
    #2 opj_j2k_read_mct      third_party/libopenjpeg/j2k.c:5988

ASAN splits the two frees the same way the Chrome stack does — 9374 under freed by, 9574 under attempting double-free — and attributes the allocation to opj_j2k_read_mct, the default TCP's MCT data. On a 32-bit build of upstream OpenJPEG the same codestream aborts with double free or corruption (!prev) under no artificial constraint at all, because the 4 GB address space is the natural limit.

Stated up front so it is not discovered later: opening poc.pdf in a default Chrome does not deterministically crash. The trigger needs one allocation to fail, so the reproduction constrains renderer memory. On 64-bit Linux the OOM killer intervenes before malloc returns nullptr; Windows has no OOM killer and a commit failure returns nullptr, which is why the browser reproduction is on Windows.

Suggested fix

Diff
         l_tcp->m_mct_decoding_matrix = 00;
+        l_tcp->m_nb_mct_records = 0;
         l_tcp->m_nb_max_mct_records = 0;
         l_tcp->m_mct_records = 00;
+        l_tcp->m_nb_mcc_records = 0;
         l_tcp->m_nb_max_mcc_records = 0;
         l_tcp->m_mcc_records = 00;
@@
         memcpy(l_tcp->m_mct_records, l_default_tcp->m_mct_records, l_mct_records_size);
+        l_tcp->m_nb_max_mct_records = l_default_tcp->m_nb_max_mct_records;
@@
-            l_tcp->m_nb_max_mct_records += 1;
+            l_tcp->m_nb_mct_records += 1;

Three added lines and one changed line: clear the count fields alongside the capacity fields; set the capacity right after the array allocation (mirroring what the MCC path already does at j2k.c:9305); and make the copy loop increment the count — what the existing comment intends.

It deliberately does not touch ppt_buffer or ppt_markers. Both are the same mistake but are unreachable today, and keeping the fix minimal keeps it reviewable; clearing those two as well is a reasonable belt-and-braces addition, which we have not regression-tested.

Applied and regression-checked: the PoC ends on the normal error path (exit=1, no crash), and three ordinary inputs decode byte-identically before and after. Mechanism controls behave as the analysis predicts — a codestream with a single MCT record, or with the failing record last, does not reproduce at any memory limit, because nothing is left aliased past the failure point.

Impact analysis

Who can exploit it

Displaying an image is the whole attack. The victim opens a page or a PDF, Chrome's built-in viewer decodes the embedded JPX image while laying the page out, and the renderer's heap is corrupted before anything is drawn. There is no click to make, no dialog to accept, no plugin to have installed, and no non-default setting involved. Rendering is the trigger.

So any party that can put the image in front of a Chrome user reaches it, through every ordinary delivery path: a link, a PDF embedded via <iframe> or <embed>, an email attachment opened in Chrome, a drive-by navigation, an ad frame. No prior access, no credentials, and no same-origin relationship are needed. The PoC is 14,143 bytes.

What they gain

The same heap block is passed to PartitionRoot::Free twice in the renderer process.

What we demonstrated is a renderer crash: 0xC0000005 write access violation inside PartitionAlloc's free path, 3/3 runs, with an otherwise identical control PDF crashing 0/2 under the same conditions. Under AddressSanitizer, in Chrome's own allocator configuration, the same input is diagnosed as AddressSanitizer: attempting double-free.

We did not attempt to develop that further, so we cannot speak to it from experience. What we can say is that the conditions a skilled attacker would need in order to control the corruption appear to be present, because several of them are read straight from the file:

  • The size of the double-freed block is chosen in the file. Each MCT record's data length is Lmct - 8, anywhere from 1 to 65,527 bytes, which determines the PartitionAlloc bucket the duplicated slot belongs to.
  • The number of double-freed blocks is chosen in the file. With N MCT records and the allocation failing at index j, entries j..N-1 are all left aliasing, and all of them are freed twice. N can be up to 256, and placing the largest record first makes the failure land early, which maximises N-j.
  • It is deterministic rather than a race. There is no timing window and no offset to guess; the PoC gives the allocator 65,026 chances to return nullptr during one page render, and any one of them produces the same state.
  • It can be retried freely. A page can navigate an <iframe> to the PDF repeatedly, varying record sizes and counts between attempts.
  • It happens on a clean teardown path. The double-free occurs inside opj_j2k_destroy() on the decoder's normal error path, not on an already-corrupted heap.

Given that, our honest reading is that a competent exploit developer would have a realistic chance of stabilising this into something more than a crash, possibly renderer code execution. We are stating that as an assessment, not a result — we have no exploit, and we did not test whether PartitionAlloc's hardening (encoded freelist entries, slot-span metadata checks, partition isolation) blocks it. That is the main open question in this report, and we are not in a position to answer it from outside.

For classification, this is CWE-415: Double Free — memory corruption in the renderer process, reached from web content without user interaction.

The precondition, stated plainly

The trigger requires one opj_malloc() to return nullptr — renderer memory pressure. That is not something the attacker has to hope for:

  • The file controls the demand. The tile count, the MCT record count, and each record's data size are all read from the codestream, so the file dictates how much memory decoding it requires.
  • The amplification is large. Our 14,143-byte PoC performs the affected 4096-byte allocation 65,026 times during a single page render and drives peak renderer RSS to 1.42 GiB (1,490,864 KB measured). A variant demanding roughly 127 GiB is attached as poc_huge.j2k.
  • Any single failure suffices. No race to win, no offset to guess, no specific one of those 65,026 allocations to hit.
  • The pressure can also come from the attacker. A page can consume memory in another frame — large canvases, ArrayBuffers, its own decoded images — before navigating the victim frame to the PDF.
  • Windows returns nullptr rather than killing the process. There is no OOM killer, so a commit failure surfaces as the nullptr this code mishandles. On 64-bit Linux the OOM killer usually intervenes first, which is why our browser reproduction is on Windows.
  • PDFium designed the nullptr contract. core/fxcrt/fx_memory.h:16 says "For external C libraries to malloc through PDFium. These may return nullptr.", and core/fxcrt/fx_memory_pa.cpp:47 passes AllocFlags::kReturnNull. Returning nullptr is intended behaviour, not a fault condition.

Our browser reproduction makes the pressure explicit with a Job Object process commit limit (1200 MB), so that the result is deterministic and the control comparison is clean.

We have not demonstrated the allocation failing on an unconstrained desktop, and we are not claiming it. We were also unable to test several situations where it seems more likely — low-memory Android and ChromeOS devices, memory-capped or throttled tabs, and sessions with several large tabs already resident — and we have no visibility into how often real renderers reach allocation failure.

Also relevant: 32-bit Chrome is still shipped, and there the address space is 4 GB, where this PoC's ~1.42 GiB of demand should fail far more readily. We reproduced the defect with no artificial constraint at all on a 32-bit build of upstream OpenJPEG (double free or corruption (!prev), SIGABRT), which supports that reasoning, but we did not verify it in 32-bit Chrome itself.

Scope

  • Chrome 150.0.7871.187 x64 — verified. The bundled code is byte-identical to upstream at all three affected sites, and none of the 22 local patches listed under Local Modifications in third_party/libopenjpeg/README.pdfium touches them (0023-opj_j2k_read_mct_records.patch fixes a different bug in opj_j2k_read_mct).
  • third_party/libopenjpeg/README.pdfium records Security Critical: yes, Shipped: yes, and Update Mechanism: Manual, so the bundle would need its own roll even after upstream lands a fix.
  • Unfixed upstream (OpenJPEG master 402ef586, 2026-07-07); no released version contains a fix. Other consumers of the library are affected too, which is why the defect was also reported to the OpenJPEG project with the same patch.

Mitigating factors

  • The renderer is sandboxed; this is renderer-process corruption, not a sandbox escape.
  • It requires memory pressure, so it is not a plain "open a link and the tab dies" bug on a well-provisioned desktop.
  • PartitionAlloc's hardening may blunt or detect the corruption before it becomes useful. We did not test that boundary, and it is the biggest unknown in the assessment above.

The cause

What version of Chrome have you found the security issue in?

150.0.7871.187 (Official Build) (64-bit) - stable - Windows 11

Is the security issue related to a crash?

Yes, it is related to a crash.

Choose the type of vulnerability

Memory Corruption

How would you like to be publicly acknowledged for your report?

Jeongkihyun

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 15 min read.

Context

PDFium is the PDF rendering library Chrome ships, and it bundles its own copy of OpenJPEG under third_party/libopenjpeg to decode JPX images embedded in PDFs. The copy in question is version 2.5.4, revision 6c4a29b0. The vulnerability reported here is a double free in [redacted](), reachable from a single JPX image inside a PDF, and it is triggered by one opj_malloc() call returning nullptr.

That last point matters because PDFium deliberately allows its allocator to return nullptr, so the failing allocation is a designed code path rather than an anomaly. The defect was also unfixed upstream at the time of the report (OpenJPEG master 402ef586, 2026-07-07).

All j2k.c line numbers in this article refer to the file Chrome ships, third_party/libopenjpeg/j2k.c at bundle 2.5.4 revision 6c4a29b0. The corresponding upstream lines are 9 lower in [redacted]() and 10 lower in the teardown functions.

Setup

The reproduction was done on Chrome 150.0.7871.187 (Official Build) (64-bit), stable, on Windows 11, in the renderer process. No modification was made to Chrome and no command-line flag was used. To make the failing allocation deterministic, a Job Object ProcessMemoryLimit of 1200 MB was applied to the browser, and child processes inherit the job.

The proof of concept is a file called poc.pdf, 14,143 bytes in size. It declares 65,025 tiles with 10 MCT records per tile, record 0 being 4096 bytes. A control PDF with an ordinary image and otherwise identical content was used for comparison. A second variant, poc_huge.j2k, demands roughly 127 GiB.

An ASAN build of pdfium_test in Chrome's own allocator configuration was used as a second, independent confirmation, and a 32-bit build of upstream OpenJPEG was used to test the defect without any artificial memory constraint.

Finding it

[redacted]() clones the default TCP once per tile. It memcpys the whole struct and then clears the fields that describe memory not owned by the tile, but it clears only the pointer and capacity fields and misses the count fields:

C
/* j2k.c:9236-9251 */
for (i = 0; i < l_nb_tiles; ++i) {
    l_current_tccp = l_tcp->tccps;
    memcpy(l_tcp, l_default_tcp, sizeof(opj_tcp_t));   /* copies m_nb_mct_records = N too */
    ...
    /* Remove memory not owned by this tile in case of early error return. */
    l_tcp->m_mct_decoding_matrix = 00;
    l_tcp->m_nb_max_mct_records  = 0;      /* capacity IS cleared */
    l_tcp->m_mct_records         = 00;
    l_tcp->m_nb_max_mcc_records  = 0;
    l_tcp->m_mcc_records         = 00;
    /* m_nb_mct_records is NOT cleared -> stays at N */

The record array is then shallow-copied, so every entry's m_data aliases the default TCP's buffer:

C
/* j2k.c:9266-9272 */
l_mct_records_size = l_default_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t);
l_tcp->m_mct_records = (opj_mct_data_t*)opj_malloc(l_mct_records_size);
if (! l_tcp->m_mct_records) { return OPJ_FALSE; }
memcpy(l_tcp->m_mct_records, l_default_tcp->m_mct_records, l_mct_records_size);

A loop then gives each entry its own buffer, clearing the alias one entry at a time. If that allocation fails at index j, entries j..N-1 are left aliasing the default TCP:

C
/* j2k.c:9278-9294 */
for (j = 0; j < l_default_tcp->m_nb_mct_records; ++j) {
    if (l_src_mct_rec->m_data) {
        l_dest_mct_rec->m_data = (OPJ_BYTE*) opj_malloc(l_src_mct_rec->m_data_size);
        if (! l_dest_mct_rec->m_data) {
            return OPJ_FALSE;              /* <-- entries j..N-1 remain aliases */
        }
        memcpy(l_dest_mct_rec->m_data, l_src_mct_rec->m_data, l_src_mct_rec->m_data_size);
    }
    ++l_src_mct_rec;
    ++l_dest_mct_rec;
    /* Update with each pass to free exactly what has been allocated on early return. */
    l_tcp->m_nb_max_mct_records += 1;      /* <-- bumps CAPACITY, not COUNT */
}

This is the crux. The author did implement per-pass rollback tracking and wrote the intent in the comment: "Update with each pass to free exactly what has been allocated on early return." But the loop increments m_nb_max_mct_records, the capacity, while the destructor iterates m_nb_mct_records, the count:

C
/* j2k.c:9525-9536  opj_j2k_tcp_destroy() */
if (p_tcp->m_mct_records) {
    opj_mct_data_t * l_mct_data = p_tcp->m_mct_records;
    for (i = 0; i < p_tcp->m_nb_mct_records; ++i) {     /* iterates N times */
        if (l_mct_data->m_data) {
            opj_free(l_mct_data->m_data);                /* frees the aliases too */
            l_mct_data->m_data = 00;
        }
        ++l_mct_data;
    }

So the default TCP's m_data is freed twice. opj_j2k_destroy() runs the two teardowns in this order:

  1. j2k.c:9374, the default TCP. First free.
  2. j2k.c:9417 to opj_j2k_cp_destroy() to j2k.c:9574, the per-tile TCP array, which is what still holds the aliases. Second free.

The intended guard does nothing because of one wrong field name. The comment states the intent that the code fails to implement, so this is not intended behaviour.

Why only the MCT records

Every field opj_j2k_tcp_destroy() frees was cross-checked. Only m_mct_records has all three properties at once, and is reachable:

Text
FIELD                         COUNT   PER-ELEMENT   DTOR ITERATES
                              STALE   OWNED PTR     THE COUNT       RESULT
--------------------------------------------------------------------------
m_mct_records                 yes     yes           yes  (:9529)    DOUBLE-FREE
m_mcc_records                 yes     no            -                safe
  array freed whole (:9519); members are offsets into m_mct_records (:9316)
m_mct_decoding_matrix         no      -             -                safe
  cleared at :9247
m_mct_coding_matrix (:8242)   yes     -             -                safe
mct_norms           (:8270)   yes     -             -                safe
  both encoder-only allocations, NULL when decoding
tccps                         no      -             -                safe
  reattached at :9253
m_data / m_data_size          -       -             -                safe
  inlined opj_j2k_tcp_data_destroy; tile payload, only set during tile
  decoding, so default_tcp never holds one
ppt_buffer                    YES     yes           -                LATENT
  opj_j2k_merge_ppt() (:4240). Unreachable today: PPT is a tile-part-
  header-only marker, so default_tcp never holds one
ppt_markers /                 YES     yes           YES              LATENT
ppt_markers_count
  m_data per entry, freed in a loop over the count at :9488. Same shape as
  m_mct_records, unreachable for the same reason as ppt_buffer

The last two rows are not exploitable today, but they are the same mistake: the copy function clears neither the pointer nor the count.

Why nullptr is reachable in Chrome

PDFium replaces OpenJPEG's allocator (third_party/libopenjpeg/0034-opj_malloc.patch) and documents that it may fail:

C
// core/fxcrt/fx_memory.h:16
// For external C libraries to malloc through PDFium. These may return nullptr.
void* FXMEM_DefaultAlloc(size_t byte_size);
C++
// core/fxcrt/fx_memory_pa.cpp:38-49
void* Alloc(size_t num_members, size_t member_size) {
  ...
  return GetGeneralPartitionAllocator()
      .root()
      ->Alloc<partition_alloc::AllocFlags::kReturnNull>(total.ValueOrDie(),
                                                        "GeneralPartition");
}

So OpenJPEG receiving nullptr is by design, not an edge case. The affected allocation also runs in bulk. Because the copy is per tile, rendering the single page in poc.pdf performs the 4096-byte allocation 65,026 times (65,025 tiles plus the original in the default TCP), and peak renderer RSS reaches about 1.42 GiB.

The tile count, the MCT record count and each record's size are all read from the codestream, so an attacker scales the demand at will. This is input-induced memory pressure, not an incidental OOM. Any one of those 65,026 nullptr returns produces the double free; there is no race to win and no offset to guess.

Exploitation

Step 1: build a PDF whose JPX image declares many tiles and MCT records

The codestream in poc.pdf declares 65,025 tiles with 10 MCT records per tile, record 0 being 4096 bytes. The file is 14,143 bytes. Each MCT record's data length is Lmct - 8, anywhere from 1 to 65,527 bytes, and the number of records N can be up to 256. Placing the largest record first makes the failure land early, which maximises the number of entries left aliasing, N-j.

Step 2: constrain renderer memory so one allocation fails

A Job Object ProcessMemoryLimit of 1200 MB was applied to the browser, and children inherit the job. On Windows there is no OOM killer, so a commit failure returns nullptr rather than killing the process. On 64-bit Linux the OOM killer intervenes before malloc returns nullptr, which is why the browser reproduction is on Windows.

Step 3: open the PDF and observe the crash

Text
INPUT                                              RUNS   RESULT
------------------------------------------------------------------------
poc.pdf                                            3      renderer crash, 3/3
control PDF (ordinary image, otherwise identical)  2      no crash,       0/2

The three crashes are identical:

Text
exception    0xC0000005  ACCESS_VIOLATION
access       write
RIP          chrome.dll+0x3870B70      (inside PartitionAlloc's free path)
faulting     movq $0x0,(%rdi)          8-byte store; RDI equals the faulting address
addresses    0x000012E000679C00 / 0x00006EA000678000 / 0x00001E1800678000

This is not Chrome's deliberate out-of-memory abort, which is 0xE0000008. The faulting addresses share their low bits while the ASLR-dependent upper bits differ.

The renderer stack for all three, recovered from the minidumps plus the shipped chrome.dll:

Text
#0  chrome.dll+0x3870B70   PartitionRoot::Free
#1  chrome.dll+0x972E0DC   opj_j2k_tcp_destroy            j2k.c:9531
#2  chrome.dll+0x972DC20   opj_j2k_destroy                j2k.c:9574
#3  chrome.dll+0x9739368   opj_destroy_codec
#4  chrome.dll+0x96EBD4A   fxcodec::CJPX_Decoder::~CJPX_Decoder
#5  chrome.dll+0x96EB1C1   fxcodec::CJPX_Decoder::Create  [Init() returned false]
#6  chrome.dll+0x9625559   CPDF_DIB::LoadJpxBitmap        cpdf_dib.cpp:634
#7  chrome.dll+0x96230BB   CPDF_DIB::CreateDecoder        cpdf_dib.cpp:474
#8  chrome.dll+0x9623ACE   CPDF_DIB::StartLoadDIBBase     cpdf_dib.cpp:227

Two frames are worth noting. Frame #2 is j2k.c:9574, the per-tile teardown, the second free, and not j2k.c:9374, the default-TCP teardown, which has already returned. Frame #5 shows CJPX_Decoder::Create running the destructor on its Init() == false branch, meaning header parsing failed, which is exactly what [redacted]() returning OPJ_FALSE after a failed opj_malloc produces. A successful decode never reaches this code.

Step 4: confirm with AddressSanitizer

An ASAN build of pdfium_test in Chrome's own allocator configuration, given the same input, reports the defect by name:

Text
ERROR: AddressSanitizer: attempting double-free on 0x7d8ffbe50e80
    #2 opj_j2k_tcp_destroy   third_party/libopenjpeg/j2k.c:9531
    #3 opj_j2k_destroy       third_party/libopenjpeg/j2k.c:9574   <- second free
  freed by thread T0 here:
    #2 opj_j2k_tcp_destroy   third_party/libopenjpeg/j2k.c:9531
    #3 opj_j2k_destroy       third_party/libopenjpeg/j2k.c:9374   <- first free
  previously allocated by thread T0 here:
    #2 opj_j2k_read_mct      third_party/libopenjpeg/j2k.c:5988

ASAN splits the two frees the same way the Chrome stack does: 9374 under freed by, 9574 under attempting double-free. It attributes the allocation to opj_j2k_read_mct, the default TCP's MCT data.

Step 5: test without an artificial constraint

On a 32-bit build of upstream OpenJPEG the same codestream aborts with double free or corruption (!prev) under no artificial constraint at all, because the 4 GB address space is the natural limit.

Limits of the reproduction

Opening poc.pdf in a default Chrome does not deterministically crash. The trigger needs one allocation to fail, so the reproduction constrains renderer memory. The report states that the allocation failing on an unconstrained desktop was not demonstrated and is not claimed. Several situations where it seems more likely could not be tested: low-memory Android and ChromeOS devices, memory-capped or throttled tabs, and sessions with several large tabs already resident. There is no visibility into how often real renderers reach allocation failure. 32-bit Chrome is still shipped, and there the address space is 4 GB, where this PoC's roughly 1.42 GiB of demand should fail far more readily, but this was not verified in 32-bit Chrome itself.

Mechanism controls behave as the analysis predicts: a codestream with a single MCT record, or with the failing record last, does not reproduce at any memory limit, because nothing is left aliased past the failure point.

Root cause

The copy function clears the pointer and capacity fields of the cloned TCP but not the count fields. The record array is shallow-copied, so entries alias the default TCP's buffers, and the loop that should give each entry its own buffer returns early on a failed allocation, leaving entries j..N-1 aliased. The rollback tracking that was meant to handle this increments the capacity field, m_nb_max_mct_records, while opj_j2k_tcp_destroy() iterates the count field, m_nb_mct_records, which is still N. The destructor therefore frees the aliased pointers as well, and opj_j2k_destroy() frees the default TCP first (j2k.c:9374) and the per-tile array second (j2k.c:9574).

Existing defences did not stop it. The bundled code is byte-identical to upstream at all three affected sites, and none of the 22 local patches listed under Local Modifications in third_party/libopenjpeg/README.pdfium touches them; 0023-opj_j2k_read_mct_records.patch fixes a different bug in opj_j2k_read_mct. The bundle records Security Critical: yes, Shipped: yes, and Update Mechanism: Manual, so it would need its own roll even after upstream lands a fix. No released version of OpenJPEG contains a fix.

Impact

Displaying an image is the whole attack. The victim opens a page or a PDF, Chrome's built-in viewer decodes the embedded JPX image while laying the page out, and the renderer's heap is corrupted before anything is drawn. There is no click to make, no dialog to accept, no plugin to have installed, and no non-default setting involved. Any party that can put the image in front of a Chrome user reaches it through ordinary delivery paths: a link, a PDF embedded via <iframe> or <embed>, an email attachment opened in Chrome, a drive-by navigation, an ad frame. No prior access, no credentials and no same-origin relationship are needed.

The same heap block is passed to PartitionRoot::Free twice in the renderer process. What was demonstrated is a renderer crash: 0xC0000005 write access violation inside PartitionAlloc's free path, 3/3 runs, with an otherwise identical control PDF crashing 0/2 under the same conditions. Under AddressSanitizer, in Chrome's own allocator configuration, the same input is diagnosed as AddressSanitizer: attempting double-free.

The report states that no further development was attempted and that there is no exploit. The assessment is that the conditions a skilled attacker would need in order to control the corruption appear to be present, because several of them are read straight from the file:

  • The size of the double-freed block is chosen in the file. Each MCT record's data length is Lmct - 8, anywhere from 1 to 65,527 bytes, which determines the PartitionAlloc bucket the duplicated slot belongs to.
  • The number of double-freed blocks is chosen in the file. With N MCT records and the allocation failing at index j, entries j..N-1 are all left aliasing, and all of them are freed twice. N can be up to 256, and placing the largest record first makes the failure land early, which maximises N-j.
  • It is deterministic rather than a race. There is no timing window and no offset to guess; the PoC gives the allocator 65,026 chances to return nullptr during one page render, and any one of them produces the same state.
  • It can be retried freely. A page can navigate an <iframe> to the PDF repeatedly, varying record sizes and counts between attempts.
  • It happens on a clean teardown path. The double free occurs inside opj_j2k_destroy() on the decoder's normal error path, not on an already-corrupted heap.

A competent exploit developer would, on that reading, have a realistic chance of stabilising this into something more than a crash, possibly renderer code execution. That is an assessment, not a result. Whether PartitionAlloc's hardening (encoded freelist entries, slot-span metadata checks, partition isolation) blocks it was not tested, and that is the main open question in the report.

The precondition is renderer memory pressure, and the attacker does not have to hope for it. The file controls the demand, since the tile count, the MCT record count and each record's data size are all read from the codestream. The amplification is large: the 14,143-byte PoC performs the affected 4096-byte allocation 65,026 times during a single page render and drives peak renderer RSS to 1.42 GiB (1,490,864 KB measured), and a variant demanding roughly 127 GiB is attached as poc_huge.j2k. Any single failure suffices. The pressure can also come from the attacker, since a page can consume memory in another frame (large canvases, ArrayBuffers, its own decoded images) before navigating the victim frame to the PDF. Windows returns nullptr rather than killing the process, and PDFium designed the nullptr contract: core/fxcrt/fx_memory.h:16 says "For external C libraries to malloc through PDFium. These may return nullptr.", and core/fxcrt/fx_memory_pa.cpp:47 passes AllocFlags::kReturnNull.

Mitigating factors: the renderer is sandboxed, so this is renderer-process corruption, not a sandbox escape. It requires memory pressure, so it is not a plain "open a link and the tab dies" bug on a well-provisioned desktop. PartitionAlloc's hardening may blunt or detect the corruption before it becomes useful; that boundary was not tested.

The classification is CWE-415: Double Free, memory corruption in the renderer process, reached from web content without user interaction. The defect was also reported to the OpenJPEG project with the same patch, since other consumers of the library are affected too.

Fix

The suggested patch is three added lines and one changed line: clear the count fields alongside the capacity fields, set the capacity right after the array allocation (mirroring what the MCC path already does at j2k.c:9305), and make the copy loop increment the count, which is what the existing comment intends.

Diff
         l_tcp->m_mct_decoding_matrix = 00;
+        l_tcp->m_nb_mct_records = 0;
         l_tcp->m_nb_max_mct_records = 0;
         l_tcp->m_mct_records = 00;
+        l_tcp->m_nb_mcc_records = 0;
         l_tcp->m_nb_max_mcc_records = 0;
         l_tcp->m_mcc_records = 00;
@@
         memcpy(l_tcp->m_mct_records, l_default_tcp->m_mct_records, l_mct_records_size);
+        l_tcp->m_nb_max_mct_records = l_default_tcp->m_nb_max_mct_records;
@@
-            l_tcp->m_nb_max_mct_records += 1;
+            l_tcp->m_nb_mct_records += 1;

The patch deliberately does not touch ppt_buffer or ppt_markers. Both are the same mistake but are unreachable today, and keeping the fix minimal keeps it reviewable; clearing those two as well is a reasonable belt-and-braces addition, which was not regression-tested.

Applied and regression-checked: the PoC ends on the normal error path (exit=1, no crash), and three ordinary inputs decode byte-identically before and after.

Variants to test

  1. Other bundled copies of OpenJPEG. Check whether a product ships a version of j2k.c where [redacted]() clears m_nb_max_mct_records but not m_nb_mct_records. A positive result is a codestream with many MCT records that, under a memory limit, produces a double free in opj_j2k_tcp_destroy().
  2. The latent ppt_buffer and ppt_markers paths. The report marks both as the same mistake but unreachable because PPT is a tile-part-header-only marker, so default_tcp never holds one. A positive result would be a code path where the default TCP does hold a PPT buffer or PPT markers and the copy function leaves the pointer and count stale.
  3. Single-record and last-record controls. A codestream with a single MCT record, or with the failing record last, should not reproduce at any memory limit, because nothing is left aliased past the failure point. If it does reproduce, the analysis of which entries remain aliased is wrong.
  4. 32-bit builds. On a 32-bit build of upstream OpenJPEG the same codestream aborts with double free or corruption (!prev) under no artificial constraint. A positive result in 32-bit Chrome itself would confirm the reasoning that the 4 GB address space makes the failure far more likely.
  5. Memory-capped environments. Low-memory Android and ChromeOS devices, memory-capped or throttled tabs, and sessions with several large tabs already resident are situations where the allocation seems more likely to fail. A positive result is the same 0xC0000005 write inside PartitionAlloc's free path, or an ASAN double-free report, without an artificial Job Object limit.
  6. Attacker-driven pressure. A page that consumes memory in another frame (large canvases, ArrayBuffers, its own decoded images) before navigating the victim frame to the PDF. A positive result is the same crash with the pressure coming from the page rather than from the file's own tile count.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 30 min read.

What happened, in plain words

Chrome can display PDF files. To draw the pictures inside a PDF, Chrome uses a piece of software called PDFium, which is the PDF rendering library Chrome ships. Some PDFs contain images in a format called JPX (also known as JPEG 2000). To read those images, PDFium uses another piece of software, a library called OpenJPEG, and Chrome carries its own copy of OpenJPEG inside its source tree, in a folder named third_party/libopenjpeg. The copy in question is version 2.5.4, revision 6c4a29b0.

This report describes a bug in that copy. The bug is a double free: a program asks the computer to release the same piece of memory twice. Releasing memory twice is like handing back the same borrowed library book twice: the librarian may put it on the shelf while someone else is already borrowing it, and the records get confused. In software, the result can be a crash, and sometimes worse.

The bug lives in a function called [redacted](). It can be reached from a single JPX image inside a PDF, and it is triggered when one call to opj_malloc() returns nullptr. opj_malloc() is OpenJPEG's way of asking the operating system for a block of memory, and nullptr is the answer "no, I cannot give you any right now".

That last point matters. PDFium deliberately allows its memory allocator to answer nullptr, so the failing allocation is a designed code path rather than an anomaly. The defect was also unfixed upstream at the time of the report: upstream means the original OpenJPEG project, and at OpenJPEG master 402ef586, dated 2026-07-07, the bug was still there.

All j2k.c line numbers in this article refer to the file Chrome ships, third_party/libopenjpeg/j2k.c at bundle 2.5.4 revision 6c4a29b0. The corresponding upstream lines are 9 lower in [redacted]() and 10 lower in the teardown functions.

Setup

The reproduction was done on Chrome 150.0.7871.187 (Official Build) (64-bit), stable, on Windows 11, in the renderer process. The renderer process is the part of Chrome that turns a web page or a PDF into what you see on screen; it is kept separate from the rest of the browser so that a problem there is contained. No modification was made to Chrome and no command-line flag was used.

To make the failing allocation deterministic, a Job Object ProcessMemoryLimit of 1200 MB was applied to the browser, and child processes inherit the job. A Job Object is a Windows feature for grouping processes and putting limits on them, a bit like a household budget that every family member has to stay within. Here the limit was 1200 MB of memory, so that the browser would run out of memory on purpose and the test would behave the same way every time.

The proof of concept is a file called poc.pdf, 14,143 bytes in size. A proof of concept is a small, deliberately built file or program that demonstrates a bug without doing any real harm. It declares 65,025 tiles with 10 MCT records per tile, record 0 being 4096 bytes. A tile is a rectangular piece of an image, the way a large mosaic is made of many small squares. An MCT record is a small data structure that describes a colour transformation used when decoding the image. A control PDF with an ordinary image and otherwise identical content was used for comparison: a control is a version of the test where the bug should not happen, so you can tell the difference between "the bug caused this" and "something else caused this". A second variant, poc_huge.j2k, demands roughly 127 GiB.

An ASAN build of pdfium_test in Chrome's own allocator configuration was used as a second, independent confirmation. ASAN stands for AddressSanitizer, a tool built into some compilers that watches memory use while a program runs and shouts when something is wrong, like a smoke alarm for memory. pdfium_test is a small test program that opens PDFs with PDFium outside the browser. A 32-bit build of upstream OpenJPEG was used to test the defect without any artificial memory constraint. 32-bit and 64-bit describe how much memory a program can address: a 32-bit program can only reach about 4 GB, while a 64-bit program can reach far more.

Finding it

[redacted]() clones the default TCP once per tile. The default TCP is a template that describes how to decode the image; cloning it per tile means each tile gets its own copy to work with. It memcpys the whole struct and then clears the fields that describe memory not owned by the tile, but it clears only the pointer and capacity fields and misses the count fields. memcpy is a standard C function that copies a block of bytes from one place to another. A struct is a bundle of related values kept together under one name, like a form with several fields. A pointer is a value that says where in memory something lives, like an address on an envelope. Capacity is how much room has been set aside; count is how many items are actually in use.

C
/* j2k.c:9236-9251 */
for (i = 0; i < l_nb_tiles; ++i) {
    l_current_tccp = l_tcp->tccps;
    memcpy(l_tcp, l_default_tcp, sizeof(opj_tcp_t));   /* copies m_nb_mct_records = N too */
    ...
    /* Remove memory not owned by this tile in case of early error return. */
    l_tcp->m_mct_decoding_matrix = 00;
    l_tcp->m_nb_max_mct_records  = 0;      /* capacity IS cleared */
    l_tcp->m_mct_records         = 00;
    l_tcp->m_nb_max_mcc_records  = 0;
    l_tcp->m_mcc_records         = 00;
    /* m_nb_mct_records is NOT cleared -> stays at N */

Line by line:

  • for (i = 0; i < l_nb_tiles; ++i) { starts a loop that runs once for every tile. l_nb_tiles is the number of tiles.
  • l_current_tccp = l_tcp->tccps; saves a pointer to the tile's coding parameters, so they can be put back after the copy.
  • memcpy(l_tcp, l_default_tcp, sizeof(opj_tcp_t)); copies the whole default TCP structure over the tile's structure. The comment notes that this also copies m_nb_mct_records, the count of MCT records, which is N.
  • The comment /* Remove memory not owned by this tile in case of early error return. */ explains the intent: after the copy, the tile's structure points at memory that belongs to the default TCP, and that must be cleared so the tile does not free someone else's memory if something goes wrong early.
  • l_tcp->m_mct_decoding_matrix = 00; clears one pointer. 00 is a way of writing a null pointer.
  • l_tcp->m_nb_max_mct_records = 0; clears the capacity of the MCT record array. The comment says capacity IS cleared.
  • l_tcp->m_mct_records = 00; clears the pointer to the MCT record array.
  • l_tcp->m_nb_max_mcc_records = 0; and l_tcp->m_mcc_records = 00; do the same for a second array, the MCC records.
  • The final comment says m_nb_mct_records is NOT cleared, so it stays at N. That is the mistake: the count still says there are N records, even though the pointer was just set to null.

The record array is then shallow-copied, so every entry's m_data aliases the default TCP's buffer. A shallow copy copies the addresses but not the things they point to, like photocopying a list of addresses rather than the houses. When two entries point at the same buffer, they are called aliases.

C
/* j2k.c:9266-9272 */
l_mct_records_size = l_default_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t);
l_tcp->m_mct_records = (opj_mct_data_t*)opj_malloc(l_mct_records_size);
if (! l_tcp->m_mct_records) { return OPJ_FALSE; }
memcpy(l_tcp->m_mct_records, l_default_tcp->m_mct_records, l_mct_records_size);

Line by line:

  • l_mct_records_size = l_default_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t); works out how many bytes the record array needs: the number of records times the size of one record.
  • l_tcp->m_mct_records = (opj_mct_data_t*)opj_malloc(l_mct_records_size); asks for that much memory and stores the address in the tile's structure.
  • if (! l_tcp->m_mct_records) { return OPJ_FALSE; } checks whether the request failed. If it did, the function returns OPJ_FALSE, meaning "this did not work".
  • memcpy(l_tcp->m_mct_records, l_default_tcp->m_mct_records, l_mct_records_size); copies the array of records from the default TCP into the new memory. Because the records contain pointers, the copies now point at the same data buffers as the originals.

A loop then gives each entry its own buffer, clearing the alias one entry at a time. If that allocation fails at index j, entries j..N-1 are left aliasing the default TCP:

C
/* j2k.c:9278-9294 */
for (j = 0; j < l_default_tcp->m_nb_mct_records; ++j) {
    if (l_src_mct_rec->m_data) {
        l_dest_mct_rec->m_data = (OPJ_BYTE*) opj_malloc(l_src_mct_rec->m_data_size);
        if (! l_dest_mct_rec->m_data) {
            return OPJ_FALSE;              /* <-- entries j..N-1 remain aliases */
        }
        memcpy(l_dest_mct_rec->m_data, l_src_mct_rec->m_data, l_src_mct_rec->m_data_size);
    }
    ++l_src_mct_rec;
    ++l_dest_mct_rec;
    /* Update with each pass to free exactly what has been allocated on early return. */
    l_tcp->m_nb_max_mct_records += 1;      /* <-- bumps CAPACITY, not COUNT */
}

Line by line:

  • for (j = 0; j < l_default_tcp->m_nb_mct_records; ++j) { loops over every record in the default TCP.
  • if (l_src_mct_rec->m_data) { checks that the source record actually has data.
  • l_dest_mct_rec->m_data = (OPJ_BYTE*) opj_malloc(l_src_mct_rec->m_data_size); asks for a new buffer of the same size for the destination record.
  • if (! l_dest_mct_rec->m_data) { return OPJ_FALSE; } returns early if the request failed. The comment points out that entries j..N-1 are still aliases at this point.
  • memcpy(l_dest_mct_rec->m_data, l_src_mct_rec->m_data, l_src_mct_rec->m_data_size); copies the data into the new buffer, so this entry no longer aliases the default TCP.
  • ++l_src_mct_rec; and ++l_dest_mct_rec; move both pointers to the next record.
  • The comment says the intent is to update with each pass so that an early return frees exactly what has been allocated.
  • l_tcp->m_nb_max_mct_records += 1; increases the capacity by one. The comment notes this bumps CAPACITY, not COUNT.

This is the crux. The author did implement per-pass rollback tracking and wrote the intent in the comment: "Update with each pass to free exactly what has been allocated on early return." But the loop increments m_nb_max_mct_records, the capacity, while the destructor iterates m_nb_mct_records, the count. A destructor is the function that runs when something is being cleaned up and thrown away.

C
/* j2k.c:9525-9536  opj_j2k_tcp_destroy() */
if (p_tcp->m_mct_records) {
    opj_mct_data_t * l_mct_data = p_tcp->m_mct_records;
    for (i = 0; i < p_tcp->m_nb_mct_records; ++i) {     /* iterates N times */
        if (l_mct_data->m_data) {
            opj_free(l_mct_data->m_data);                /* frees the aliases too */
            l_mct_data->m_data = 00;
        }
        ++l_mct_data;
    }

Line by line:

  • if (p_tcp->m_mct_records) { checks that there is a record array to clean up.
  • opj_mct_data_t * l_mct_data = p_tcp->m_mct_records; starts at the first record.
  • for (i = 0; i < p_tcp->m_nb_mct_records; ++i) { loops over the records, using the count. The comment says it iterates N times.
  • if (l_mct_data->m_data) { checks that this record has data.
  • opj_free(l_mct_data->m_data); releases the data buffer. The comment notes that this frees the aliases too, because some entries still point at the default TCP's buffers.
  • l_mct_data->m_data = 00; clears the pointer so it is not used again.
  • ++l_mct_data; moves to the next record.

So the default TCP's m_data is freed twice. opj_j2k_destroy() runs the two teardowns in this order:

  1. j2k.c:9374, the default TCP. First free.
  2. j2k.c:9417 to opj_j2k_cp_destroy() to j2k.c:9574, the per-tile TCP array, which is what still holds the aliases. Second free.

The intended guard does nothing because of one wrong field name. The comment states the intent that the code fails to implement, so this is not intended behaviour.

Why only the MCT records

Every field opj_j2k_tcp_destroy() frees was cross-checked. Only m_mct_records has all three properties at once, and is reachable. Reachable means an attacker can actually get the program to that point with a crafted file.

Text
FIELD                         COUNT   PER-ELEMENT   DTOR ITERATES
                              STALE   OWNED PTR     THE COUNT       RESULT
--------------------------------------------------------------------------
m_mct_records                 yes     yes           yes  (:9529)    DOUBLE-FREE
m_mcc_records                 yes     no            -                safe
  array freed whole (:9519); members are offsets into m_mct_records (:9316)
m_mct_decoding_matrix         no      -             -                safe
  cleared at :9247
m_mct_coding_matrix (:8242)   yes     -             -                safe
mct_norms           (:8270)   yes     -             -                safe
  both encoder-only allocations, NULL when decoding
tccps                         no      -             -                safe
  reattached at :9253
m_data / m_data_size          -       -             -                safe
  inlined opj_j2k_tcp_data_destroy; tile payload, only set during tile
  decoding, so default_tcp never holds one
ppt_buffer                    YES     yes           -                LATENT
  opj_j2k_merge_ppt() (:4240). Unreachable today: PPT is a tile-part-
  header-only marker, so default_tcp never holds one
ppt_markers /                 YES     yes           YES              LATENT
ppt_markers_count
  m_data per entry, freed in a loop over the count at :9488. Same shape as
  m_mct_records, unreachable for the same reason as ppt_buffer

Reading the table: the first column names the field. The second asks whether its count is stale, meaning out of date after the copy. The third asks whether each element has its own pointer that gets freed. The fourth asks whether the destructor loops over the count. The last column gives the result. m_mct_records is the only row with yes in all three, so it is the only double free. The last two rows are not exploitable today, but they are the same mistake: the copy function clears neither the pointer nor the count. Latent means the bug is present but cannot currently be triggered.

Why nullptr is reachable in Chrome

PDFium replaces OpenJPEG's allocator (third_party/libopenjpeg/0034-opj_malloc.patch) and documents that it may fail. A patch is a small change applied to someone else's code before it is built.

C
// core/fxcrt/fx_memory.h:16
// For external C libraries to malloc through PDFium. These may return nullptr.
void* FXMEM_DefaultAlloc(size_t byte_size);

Line by line:

  • The comment says this function exists so that external C libraries can ask PDFium for memory, and that the answer may be nullptr.
  • void* FXMEM_DefaultAlloc(size_t byte_size); declares the function: it takes a size in bytes and returns a pointer to memory, or nullptr if it cannot.
C++
// core/fxcrt/fx_memory_pa.cpp:38-49
void* Alloc(size_t num_members, size_t member_size) {
  ...
  return GetGeneralPartitionAllocator()
      .root()
      ->Alloc<partition_alloc::AllocFlags::kReturnNull>(total.ValueOrDie(),
                                                        "GeneralPartition");
}

Line by line:

  • void* Alloc(size_t num_members, size_t member_size) { is a function that takes a number of items and the size of each, and returns a pointer.
  • return GetGeneralPartitionAllocator() gets Chrome's general-purpose memory allocator. PartitionAlloc is Chrome's own memory allocator, the component that hands out and takes back memory inside the browser.
  • .root() gets the top-level allocator inside it.
  • ->Alloc<partition_alloc::AllocFlags::kReturnNull>(...) asks for memory with the flag kReturnNull, which means "if you cannot give me memory, return nullptr instead of crashing".
  • total.ValueOrDie() is the total size to allocate, and "GeneralPartition" is a label used for diagnostics.

So OpenJPEG receiving nullptr is by design, not an edge case. The affected allocation also runs in bulk. Because the copy is per tile, rendering the single page in poc.pdf performs the 4096-byte allocation 65,026 times (65,025 tiles plus the original in the default TCP), and peak renderer RSS reaches about 1.42 GiB. RSS stands for resident set size, the amount of physical memory a process is actually using at that moment. GiB is a unit of memory, roughly a thousand million bytes.

The tile count, the MCT record count and each record's size are all read from the codestream, so an attacker scales the demand at will. The codestream is the compressed data inside the image file. This is input-induced memory pressure, not an incidental OOM. OOM means out of memory. Any one of those 65,026 nullptr returns produces the double free; there is no race to win and no offset to guess. A race condition is a bug that depends on timing, where two things happen in an unlucky order; here the result is the same every time.

Exploitation

Step 1: build a PDF whose JPX image declares many tiles and MCT records

The codestream in poc.pdf declares 65,025 tiles with 10 MCT records per tile, record 0 being 4096 bytes. The file is 14,143 bytes. Each MCT record's data length is Lmct - 8, anywhere from 1 to 65,527 bytes, and the number of records N can be up to 256. Placing the largest record first makes the failure land early, which maximises the number of entries left aliasing, N-j.

Why this step: the file itself decides how much memory decoding will need. A tiny file can ask for a huge amount of work, which is what makes the attack practical.

Step 2: constrain renderer memory so one allocation fails

A Job Object ProcessMemoryLimit of 1200 MB was applied to the browser, and children inherit the job. On Windows there is no OOM killer, so a commit failure returns nullptr rather than killing the process. An OOM killer is a feature of some operating systems that picks a process and kills it when memory runs out. On 64-bit Linux the OOM killer intervenes before malloc returns nullptr, which is why the browser reproduction is on Windows.

Why this step: the bug only happens when one memory request fails. On a normal desktop with plenty of memory, that may never happen, so the test makes it happen on purpose and in a repeatable way.

Step 3: open the PDF and observe the crash

Text
INPUT                                              RUNS   RESULT
------------------------------------------------------------------------
poc.pdf                                            3      renderer crash, 3/3
control PDF (ordinary image, otherwise identical)  2      no crash,       0/2

This table compares the malicious file with the control. poc.pdf was opened three times and crashed the renderer all three times. The control PDF was opened twice and never crashed. That contrast is what shows the crash is caused by the crafted image and not by the memory limit alone.

The three crashes are identical:

Text
exception    0xC0000005  ACCESS_VIOLATION
access       write
RIP          chrome.dll+0x3870B70      (inside PartitionAlloc's free path)
faulting     movq $0x0,(%rdi)          8-byte store; RDI equals the faulting address
addresses    0x000012E000679C00 / 0x00006EA000678000 / 0x00001E1800678000

Line by line:

  • exception 0xC0000005 ACCESS_VIOLATION is Windows' name for a program touching memory it is not allowed to touch.
  • access write says the program was trying to write, not read.
  • RIP chrome.dll+0x3870B70 is the instruction pointer, the address of the instruction that was running. It is inside PartitionAlloc's free path, the code that releases memory.
  • faulting movq $0x0,(%rdi) is the machine instruction that failed: it writes an 8-byte zero to the address held in the RDI register. A register is a small storage slot inside the processor.
  • addresses ... lists the three faulting addresses from the three runs.

This is not Chrome's deliberate out-of-memory abort, which is 0xE0000008. The faulting addresses share their low bits while the ASLR-dependent upper bits differ. ASLR stands for address space layout randomisation: the operating system shuffles where things sit in memory each time a program starts, so the upper parts of addresses change between runs while the lower parts stay the same.

The renderer stack for all three, recovered from the minidumps plus the shipped chrome.dll. A stack is the list of function calls that led to the current point, like a trail of breadcrumbs. A minidump is a small file Windows writes when a program crashes, containing enough information to inspect it afterwards.

Text
#0  chrome.dll+0x3870B70   PartitionRoot::Free
#1  chrome.dll+0x972E0DC   opj_j2k_tcp_destroy            j2k.c:9531
#2  chrome.dll+0x972DC20   opj_j2k_destroy                j2k.c:9574
#3  chrome.dll+0x9739368   opj_destroy_codec
#4  chrome.dll+0x96EBD4A   fxcodec::CJPX_Decoder::~CJPX_Decoder
#5  chrome.dll+0x96EB1C1   fxcodec::CJPX_Decoder::Create  [Init() returned false]
#6  chrome.dll+0x9625559   CPDF_DIB::LoadJpxBitmap        cpdf_dib.cpp:634
#7  chrome.dll+0x96230BB   CPDF_DIB::CreateDecoder        cpdf_dib.cpp:474
#8  chrome.dll+0x9623ACE   CPDF_DIB::StartLoadDIBBase     cpdf_dib.cpp:227

Line by line, from the bottom up, because the bottom is where the work started:

  • #8 CPDF_DIB::StartLoadDIBBase is PDFium starting to load an image.
  • #7 CPDF_DIB::CreateDecoder creates the decoder for that image.
  • #6 CPDF_DIB::LoadJpxBitmap loads a JPX bitmap, which is the image format in question.
  • #5 fxcodec::CJPX_Decoder::Create [Init() returned false] is the decoder being created, but its initialisation returned false, meaning it failed.
  • #4 fxcodec::CJPX_Decoder::~CJPX_Decoder is the decoder being destroyed, the ~ marking a destructor.
  • #3 opj_destroy_codec is OpenJPEG cleaning up its codec.
  • #2 opj_j2k_destroy j2k.c:9574 is the per-tile teardown, the second free.
  • #1 opj_j2k_tcp_destroy j2k.c:9531 is the function that frees the aliased data.
  • #0 PartitionRoot::Free is Chrome's allocator actually releasing the memory, where the crash happens.

Two frames are worth noting. Frame #2 is j2k.c:9574, the per-tile teardown, the second free, and not j2k.c:9374, the default-TCP teardown, which has already returned. Frame #5 shows CJPX_Decoder::Create running the destructor on its Init() == false branch, meaning header parsing failed, which is exactly what [redacted]() returning OPJ_FALSE after a failed opj_malloc produces. A successful decode never reaches this code.

Step 4: confirm with AddressSanitizer

An ASAN build of pdfium_test in Chrome's own allocator configuration, given the same input, reports the defect by name:

Text
ERROR: AddressSanitizer: attempting double-free on 0x7d8ffbe50e80
    #2 opj_j2k_tcp_destroy   third_party/libopenjpeg/j2k.c:9531
    #3 opj_j2k_destroy       third_party/libopenjpeg/j2k.c:9574   <- second free
  freed by thread T0 here:
    #2 opj_j2k_tcp_destroy   third_party/libopenjpeg/j2k.c:9531
    #3 opj_j2k_destroy       third_party/libopenjpeg/j2k.c:9374   <- first free
  previously allocated by thread T0 here:
    #2 opj_j2k_read_mct      third_party/libopenjpeg/j2k.c:5988

Line by line:

  • ERROR: AddressSanitizer: attempting double-free on 0x7d8ffbe50e80 is the tool saying it caught a double free at that memory address.
  • The first stack shows where the second free happened: opj_j2k_tcp_destroy at j2k.c:9531, called from opj_j2k_destroy at j2k.c:9574.
  • freed by thread T0 here: shows where the first free happened: the same opj_j2k_tcp_destroy at j2k.c:9531, but called from opj_j2k_destroy at j2k.c:9374. A thread is one line of execution inside a program; T0 is the first thread.
  • previously allocated by thread T0 here: shows where the memory was first handed out: opj_j2k_read_mct at j2k.c:5988, which reads the MCT data from the file.

ASAN splits the two frees the same way the Chrome stack does: 9374 under freed by, 9574 under attempting double-free. It attributes the allocation to opj_j2k_read_mct, the default TCP's MCT data.

Why this step: the browser crash shows something went wrong, but ASAN names the problem directly and points at both frees, which is much stronger evidence than a crash alone.

Step 5: test without an artificial constraint

On a 32-bit build of upstream OpenJPEG the same codestream aborts with double free or corruption (!prev) under no artificial constraint at all, because the 4 GB address space is the natural limit. An abort is the program stopping itself on purpose when it detects something it cannot continue from.

Why this step: it shows the bug is not an artefact of the 1200 MB limit. On a 32-bit build, the natural 4 GB ceiling is enough to make the memory request fail.

Limits of the reproduction

Opening poc.pdf in a default Chrome does not deterministically crash. The trigger needs one allocation to fail, so the reproduction constrains renderer memory. The report states that the allocation failing on an unconstrained desktop was not demonstrated and is not claimed. Several situations where it seems more likely could not be tested: low-memory Android and ChromeOS devices, memory-capped or throttled tabs, and sessions with several large tabs already resident. There is no visibility into how often real renderers reach allocation failure. 32-bit Chrome is still shipped, and there the address space is 4 GB, where this PoC's roughly 1.42 GiB of demand should fail far more readily, but this was not verified in 32-bit Chrome itself.

Mechanism controls behave as the analysis predicts: a codestream with a single MCT record, or with the failing record last, does not reproduce at any memory limit, because nothing is left aliased past the failure point. A mechanism control is a test that changes one detail to check that the explanation is right.

Root cause

The copy function clears the pointer and capacity fields of the cloned TCP but not the count fields. The record array is shallow-copied, so entries alias the default TCP's buffers, and the loop that should give each entry its own buffer returns early on a failed allocation, leaving entries j..N-1 aliased. The rollback tracking that was meant to handle this increments the capacity field, m_nb_max_mct_records, while opj_j2k_tcp_destroy() iterates the count field, m_nb_mct_records, which is still N. The destructor therefore frees the aliased pointers as well, and opj_j2k_destroy() frees the default TCP first (j2k.c:9374) and the per-tile array second (j2k.c:9574).

Existing defences did not stop it. The bundled code is byte-identical to upstream at all three affected sites, and none of the 22 local patches listed under Local Modifications in third_party/libopenjpeg/README.pdfium touches them; 0023-opj_j2k_read_mct_records.patch fixes a different bug in opj_j2k_read_mct. The bundle records Security Critical: yes, Shipped: yes, and Update Mechanism: Manual, so it would need its own roll even after upstream lands a fix. A roll here means updating the bundled copy to a newer version. No released version of OpenJPEG contains a fix.

Impact

Displaying an image is the whole attack. The victim opens a page or a PDF, Chrome's built-in viewer decodes the embedded JPX image while laying the page out, and the renderer's heap is corrupted before anything is drawn. The heap is the pool of memory a program uses for data it creates while running. There is no click to make, no dialog to accept, no plugin to have installed, and no non-default setting involved. Any party that can put the image in front of a Chrome user reaches it through ordinary delivery paths: a link, a PDF embedded via <iframe> or <embed>, an email attachment opened in Chrome, a drive-by navigation, an ad frame. An <iframe> is a way to put one web page inside another, and <embed> is a similar way to put a file inside a page. A drive-by navigation is a page that sends your browser somewhere without you asking. No prior access, no credentials and no same-origin relationship are needed. Same-origin is the browser rule that pages from one site should not be able to read another site's data.

The same heap block is passed to PartitionRoot::Free twice in the renderer process. What was demonstrated is a renderer crash: 0xC0000005 write access violation inside PartitionAlloc's free path, 3/3 runs, with an otherwise identical control PDF crashing 0/2 under the same conditions. Under AddressSanitizer, in Chrome's own allocator configuration, the same input is diagnosed as AddressSanitizer: attempting double-free.

The report states that no further development was attempted and that there is no exploit. An exploit is a file or technique that turns a bug into something an attacker can control, rather than just a crash. The assessment is that the conditions a skilled attacker would need in order to control the corruption appear to be present, because several of them are read straight from the file:

  • The size of the double-freed block is chosen in the file. Each MCT record's data length is Lmct - 8, anywhere from 1 to 65,527 bytes, which determines the PartitionAlloc bucket the duplicated slot belongs to. A bucket is a size class in an allocator, like sorting parcels into small, medium and large boxes.
  • The number of double-freed blocks is chosen in the file. With N MCT records and the allocation failing at index j, entries j..N-1 are all left aliasing, and all of them are freed twice. N can be up to 256, and placing the largest record first makes the failure land early, which maximises N-j.
  • It is deterministic rather than a race. There is no timing window and no offset to guess; the PoC gives the allocator 65,026 chances to return nullptr during one page render, and any one of them produces the same state.
  • It can be retried freely. A page can navigate an <iframe> to the PDF repeatedly, varying record sizes and counts between attempts.
  • It happens on a clean teardown path. The double free occurs inside opj_j2k_destroy() on the decoder's normal error path, not on an already-corrupted heap.

A competent exploit developer would, on that reading, have a realistic chance of stabilising this into something more than a crash, possibly renderer code execution. Code execution means making the program run instructions the attacker chose. That is an assessment, not a result. Whether PartitionAlloc's hardening (encoded freelist entries, slot-span metadata checks, partition isolation) blocks it was not tested, and that is the main open question in the report. Hardening means extra defences built into the allocator. A freelist is the allocator's list of free blocks; encoded entries mean the list is scrambled so an attacker cannot easily forge an entry. Partition isolation means different kinds of data are kept in separate pools.

The precondition is renderer memory pressure, and the attacker does not have to hope for it. The file controls the demand, since the tile count, the MCT record count and each record's data size are all read from the codestream. The amplification is large: the 14,143-byte PoC performs the affected 4096-byte allocation 65,026 times during a single page render and drives peak renderer RSS to 1.42 GiB (1,490,864 KB measured), and a variant demanding roughly 127 GiB is attached as poc_huge.j2k. Any single failure suffices. The pressure can also come from the attacker, since a page can consume memory in another frame (large canvases, ArrayBuffers, its own decoded images) before navigating the victim frame to the PDF. A canvas is a drawing area in a web page, and an ArrayBuffer is a block of raw bytes a web page can allocate. Windows returns nullptr rather than killing the process, and PDFium designed the nullptr contract: core/fxcrt/fx_memory.h:16 says "For external C libraries to malloc through PDFium. These may return nullptr.", and core/fxcrt/fx_memory_pa.cpp:47 passes AllocFlags::kReturnNull.

Mitigating factors: the renderer is sandboxed, so this is renderer-process corruption, not a sandbox escape. A sandbox is a set of restrictions that stops a process from touching the rest of the system, like keeping a child in a playpen. It requires memory pressure, so it is not a plain "open a link and the tab dies" bug on a well-provisioned desktop. PartitionAlloc's hardening may blunt or detect the corruption before it becomes useful; that boundary was not tested.

The classification is CWE-415: Double Free, memory corruption in the renderer process, reached from web content without user interaction. CWE is a public catalogue of weakness types, and CWE-415 is its entry for double free. The defect was also reported to the OpenJPEG project with the same patch, since other consumers of the library are affected too.

Fix

The suggested patch is three added lines and one changed line: clear the count fields alongside the capacity fields, set the capacity right after the array allocation (mirroring what the MCC path already does at j2k.c:9305), and make the copy loop increment the count, which is what the existing comment intends.

Diff
         l_tcp->m_mct_decoding_matrix = 00;
+        l_tcp->m_nb_mct_records = 0;
         l_tcp->m_nb_max_mct_records = 0;
         l_tcp->m_mct_records = 00;
+        l_tcp->m_nb_mcc_records = 0;
         l_tcp->m_nb_max_mcc_records = 0;
         l_tcp->m_mcc_records = 00;
@@
         memcpy(l_tcp->m_mct_records, l_default_tcp->m_mct_records, l_mct_records_size);
+        l_tcp->m_nb_max_mct_records = l_default_tcp->m_nb_max_mct_records;
@@
-            l_tcp->m_nb_max_mct_records += 1;
+            l_tcp->m_nb_mct_records += 1;

Line by line:

  • + l_tcp->m_nb_mct_records = 0; adds the missing line that clears the count of MCT records, next to the line that already clears the capacity.
  • + l_tcp->m_nb_mcc_records = 0; does the same for the MCC records.
  • + l_tcp->m_nb_max_mct_records = l_default_tcp->m_nb_max_mct_records; sets the capacity right after the array is allocated, copying the value from the default TCP.
  • - l_tcp->m_nb_max_mct_records += 1; removes the line that wrongly incremented the capacity.
  • + l_tcp->m_nb_mct_records += 1; replaces it with a line that increments the count, which is what the comment intended.

The patch deliberately does not touch ppt_buffer or ppt_markers. Both are the same mistake but are unreachable today, and keeping the fix minimal keeps it reviewable; clearing those two as well is a reasonable belt-and-braces addition, which was not regression-tested. A regression test checks that existing behaviour still works after a change.

Applied and regression-checked: the PoC ends on the normal error path (exit=1, no crash), and three ordinary inputs decode byte-identically before and after.

Variants to test

  1. Other bundled copies of OpenJPEG. Check whether a product ships a version of j2k.c where [redacted]() clears m_nb_max_mct_records but not m_nb_mct_records. A positive result is a codestream with many MCT records that, under a memory limit, produces a double free in opj_j2k_tcp_destroy().
  2. The latent ppt_buffer and ppt_markers paths. The report marks both as the same mistake but unreachable because PPT is a tile-part-header-only marker, so default_tcp never holds one. A positive result would be a code path where the default TCP does hold a PPT buffer or PPT markers and the copy function leaves the pointer and count stale.
  3. Single-record and last-record controls. A codestream with a single MCT record, or with the failing record last, should not reproduce at any memory limit, because nothing is left aliased past the failure point. If it does reproduce, the analysis of which entries remain aliased is wrong.
  4. 32-bit builds. On a 32-bit build of upstream OpenJPEG the same codestream aborts with double free or corruption (!prev) under no artificial constraint. A positive result in 32-bit Chrome itself would confirm the reasoning that the 4 GB address space makes the failure far more likely.
  5. Memory-capped environments. Low-memory Android and ChromeOS devices, memory-capped or throttled tabs, and sessions with several large tabs already resident are situations where the allocation seems more likely to fail. A positive result is the same 0xC0000005 write inside PartitionAlloc's free path, or an ASAN double-free report, without an artificial Job Object limit.
  6. Attacker-driven pressure. A page that consumes memory in another frame (large canvases, ArrayBuffers, its own decoded images) before navigating the victim frame to the PDF. A positive result is the same crash with the pressure coming from the page rather than from the file's own tile count.

Glossary

  • PDFium: the PDF rendering library Chrome ships, which turns PDF files into what you see on screen.
  • OpenJPEG: a library for reading and writing JPEG 2000 images, bundled inside Chrome to decode JPX images in PDFs.
  • JPX / JPEG 2000: an image format that can be embedded in PDFs.
  • Double free: a bug where a program releases the same piece of memory twice.
  • Memory corruption: a bug where a program writes to memory it should not, so later use of that memory goes wrong.
  • opj_malloc(): OpenJPEG's function for asking the operating system for a block of memory.
  • nullptr: the special value meaning "no address", used when a memory request fails.
  • Allocator: the part of a program that hands out and takes back memory.
  • PartitionAlloc: Chrome's own memory allocator.
  • Renderer process: the part of Chrome that turns a page or PDF into what you see, kept separate from the rest of the browser.
  • Heap: the pool of memory a program uses for data it creates while running.
  • Struct: a bundle of related values kept together under one name.
  • Pointer: a value that says where in memory something lives.
  • Capacity: how much room has been set aside in an array.
  • Count: how many items are actually in use in an array.
  • memcpy: a standard C function that copies a block of bytes from one place to another.
  • Shallow copy: a copy that duplicates addresses but not the things they point to.
  • Alias: two pointers that point at the same memory.
  • Destructor: the function that runs when something is being cleaned up and thrown away.
  • Teardown: the process of cleaning up and releasing resources.
  • TCP (in OpenJPEG): a structure describing how to decode an image; the default TCP is a template cloned per tile.
  • Tile: a rectangular piece of an image.
  • MCT record: a small data structure describing a colour transformation used when decoding.
  • MCC record: a related data structure in OpenJPEG.
  • Codestream: the compressed data inside an image file.
  • Proof of concept (PoC): a small, deliberately built file or program that demonstrates a bug without doing real harm.
  • Control: a version of a test where the bug should not happen, used for comparison.
  • ASAN (AddressSanitizer): a tool that watches memory use while a program runs and reports errors.
  • pdfium_test: a small test program that opens PDFs with PDFium outside the browser.
  • 32-bit / 64-bit: how much memory a program can address; 32-bit is limited to about 4 GB.
  • RSS (resident set size): the amount of physical memory a process is actually using.
  • GiB: a unit of memory, roughly a thousand million bytes.
  • OOM (out of memory): the condition where a program or system has run out of memory.
  • OOM killer: an operating system feature that kills a process when memory runs out.
  • Job Object: a Windows feature for grouping processes and putting limits on them.
  • ProcessMemoryLimit: the memory limit set on a Windows Job Object.
  • Stack: the list of function calls that led to the current point.
  • Minidump: a small file Windows writes when a program crashes, used for inspection afterwards.
  • RIP: the instruction pointer, the address of the instruction currently running.
  • Register: a small storage slot inside the processor.
  • ASLR (address space layout randomisation): the operating system shuffling where things sit in memory each time a program starts.
  • Access violation: Windows' name for a program touching memory it is not allowed to touch.
  • Abort: a program stopping itself on purpose when it detects something it cannot continue from.
  • Thread: one line of execution inside a program.
  • Patch: a small change applied to code before it is built.
  • Upstream: the original project that a bundled copy comes from.
  • Roll: updating a bundled copy to a newer version.
  • Regression test: a test that checks existing behaviour still works after a change.
  • CWE-415: the public catalogue entry for double free.
  • Sandbox: a set of restrictions that stops a process from touching the rest of the system.
  • Exploit: a file or technique that turns a bug into something an attacker can control.
  • Code execution: making a program run instructions the attacker chose.
  • Hardening: extra defences built into a component.
  • Freelist: the allocator's list of free blocks.
  • Partition isolation: keeping different kinds of data in separate memory pools.
  • Bucket: a size class in an allocator.
  • <iframe>: a way to put one web page inside another.
  • <embed>: a way to put a file inside a web page.
  • Drive-by navigation: a page that sends your browser somewhere without you asking.
  • Same-origin: the browser rule that pages from one site should not be able to read another site's data.
  • Canvas: a drawing area in a web page.
  • ArrayBuffer: a block of raw bytes a web page can allocate.
  • Latent: a bug that is present but cannot currently be triggered.
  • Reachable: a bug an attacker can actually get the program to hit with a crafted file.
  • Race condition: a bug that depends on timing, where two things happen in an unlucky order.
  • Deterministic: producing the same result every time.
  • Mechanism control: a test that changes one detail to check that the explanation is right.

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.