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

Heap buffer overflow in WebML (CVE-2026-5858)

The WebNN-to-TFLite translation layer fuses a quantized GEMM into TFLite's FULLY_CONNECTED operator without validating that the weight tensor's per-channel quantization axis is dimension 0. An attacker can supply a weight tensor with per-channel quantization along dimension 1, causing a heap buffer overflow in the GPU process.

c6eed09fc8b174b0f3eebedcceb1e792 Follow

Originally disclosed on Chrome VRP

Bounty$43,000 Critical View original
  • Fix shipped in 22 days

Title

Heap buffer overflow in TFLite FullyConnectedPerChannel via WebNN quantized GEMM with wrong per-axis quantization dimension

Summary

The WebNN-to-TFLite translation layer fuses a quantized GEMM into TFLite's FULLY_CONNECTED operator without validating that the weight tensor's per-channel quantization axis is dimension 0 (output channels). An attacker can supply a weight tensor with per-channel quantization along dimension 1 (input channels) instead, causing PrepareImpl to allocate per-channel multiplier and shift arrays sized to the input channel count rather than the output channel count. When the kernel evaluates, it iterates over output channels and reads past the end of those arrays, producing a heap-buffer-overflow in the GPU process. Affected platforms: all where the TFLite WebNN backend is active (Linux, ChromeOS, Android by default; Windows and macOS as a fallback). No special GPU hardware is required.

Bisect

TFLite upstream — FullyConnectedPerChannel introduced

This commit introduced per-channel quantization for FULLY_CONNECTED in a single change: PrepareImpl allocates per_channel_output_multiplier and per_channel_output_shift arrays sized to filter->dims->data[quantized_dimension], with only a self-referential consistency check (scale->size == filter->dims->data[quantized_dimension]) and no enforcement that quantized_dimension == 0. The optimized FullyConnectedPerChannel kernel then iterates over filter->dims->data[0] (output channels) elements, causing a heap OOB read when quantized_dimension != 0 and dim 0 > dim quantized_dimension.

Became web-reachable

This commit added quantized GEMM fusion in the WebNN TFLite graph builder without validating that the weight tensor's per-channel quantization axis is dimension 0.

Root Cause

WebNN's dequantizeLinear allows per-channel quantization where the scale tensor has a non-unit dimension indicating the quantization axis. When fusing a quantized GEMM into TFLite's FULLY_CONNECTED, CanFuseQuantizeAndGetOutput(const mojom::Gemm&) checks only whether B's scale has more than one element and whether bTranspose is true:

C++
// services/webnn/tflite/graph_builder_tflite.cc:2072-2083
size_t number_of_b_scale =
    GetOperand(b_dequantize.scale_operand_id).descriptor.NumberOfElements();
const bool per_channel_quantization = number_of_b_scale != 1;
if (per_channel_quantization && !gemm.b_transpose) {
  return std::nullopt;
}

There is no validation that B's quantization axis will map to TFLite FULLY_CONNECTED's filter dimension 0 (output channels). If B has shape [N, K] and its scale has shape [1, K], SerializeQuantizeParams computes the quantization axis by scanning the scale shape for the non-unit dimension, arriving at axis 1:

C++
// services/webnn/tflite/graph_builder_tflite.cc:7001-7009
for (size_t i = 0; i < scale_shape.size(); ++i) {
  if (scale_shape[i] != 1) {
    axis = (input_rank - scale_shape.size()) + i;   // yields axis = 1
  }
}

TFLite's fully_connected::PrepareImpl validates only that the scale array length matches the filter size along the declared quantization dimension, which is a self-consistent but semantically wrong check:

C++
// third_party/tflite/src/tensorflow/lite/kernels/fully_connected.cc:453-463
TF_LITE_ENSURE_EQ(context, affine_quantization->scale->size,
                  filter->dims->data[affine_quantization->quantized_dimension]);
// ...
data->per_channel_output_multiplier.resize(per_channel_quantization_size);
data->per_channel_output_shift.resize(per_channel_quantization_size);

For a filter of shape [1024, 2] with quantized_dimension = 1, the arrays are allocated with size 2. The optimized FullyConnectedPerChannel kernel then passes these 2-element arrays as per-row multipliers to the ruy GEMM backend, which expects 1024 entries (one per output row). The ruy kernel reads well past the allocated buffer.

Reproduce

Tested at commit 3ad31ba232d9a804b4de78d788e391f82b40a906. No source modifications required.

Build:

autoninja -C out/asan-release chrome

Windows

ASAN_OPTIONS=detect_odr_violation=0 out/asan-release/chrome.exe ^
  --no-sandbox ^
  --enable-features=WebMachineLearningNeuralNetwork ^
  --disable-features=WebNNOnnxRuntime ^
  --user-data-dir=%TEMP%\poc-tflite005 ^
  --enable-logging=stderr ^
  poc.html

Linux

out/asan-release/chrome \
  --no-sandbox \
  --enable-features=WebMachineLearningNeuralNetwork \
  --enable-logging=stderr \
  poc.html

The GPU process crashes within seconds. ASAN reports a heap-buffer-overflow READ of size 32 in ruy::Kernel8bitAvx2Impl, called from FullyConnectedPerChannel. The complete ASAN log is attached in issue_tflite005/asan.log.

==23132==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x1254fc5da8af
READ of size 32 at 0x1254fc5da8af thread T23
    #0 ruy::Kernel8bitAvx2Impl<32>           kernel_avx2_fma.cc:359
    #5 GemmImplUsingRuy::Run                 cpu_backend_gemm_ruy.h:141
    #6 optimized_integer_ops::FullyConnectedPerChannel  fully_connected.h:95
    #7 fully_connected::EvalQuantized<1>     fully_connected.cc:1510
    #8 fully_connected::Eval<1>              fully_connected.cc:1795
    #12 webnn::tflite::GraphImplTflite::ComputeResources::DoDispatch  graph_impl_tflite.cc:328

0x1254fc5da8af is located 1 bytes before 8-byte region
allocated by thread T23 here:
    #1 std::vector<int>::resize              vector.h:1362
    #2 fully_connected::PrepareImpl          fully_connected.cc:463

SUMMARY: AddressSanitizer: heap-buffer-overflow ruy::Kernel8bitAvx2Impl

Credit

Please use c6eed09fc8b174b0f3eebedcceb1e792 as the credit for this vulnerability. Thank you.

The original report as published on the Chromium issue tracker, by c6eed09fc8b174b0f3eebedcceb1e792. 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. 7 min read.

Context

The target is Google Chrome, specifically the WebNN (Web Machine Learning Neural Network) implementation and its TFLite backend. WebNN is a web API that lets a page describe neural network graphs (GEMM, dequantizeLinear and so on) and have the browser execute them, typically in the GPU process. On some platforms Chrome translates a WebNN graph into a TFLite graph and runs it through TFLite kernels.

The report concerns a quantized GEMM. In WebNN, dequantizeLinear supports per-channel quantization: the scale tensor can have a non-unit dimension that indicates the quantization axis. When the WebNN-to-TFLite translation layer recognises a quantized GEMM, it fuses the dequantize and the GEMM into TFLite's FULLY_CONNECTED operator. The report shows that this fusion does not check that the weight tensor's per-channel quantization axis is dimension 0 (output channels). If the axis is dimension 1 (input channels) instead, the TFLite kernel allocates per-channel multiplier and shift arrays sized to the input channel count, then iterates over output channels and reads past the end of those arrays. The result is a heap buffer overflow in the GPU process.

The report states the affected platforms: all where the TFLite WebNN backend is active, which it describes as Linux, ChromeOS and Android by default, and Windows and macOS as a fallback. No special GPU hardware is required.

The platform metadata records this as a critical severity heap buffer overflow in WebML, disclosed on 2026-04-07, with a bounty of 43000.00 USD. The report itself is titled around TFLite FullyConnectedPerChannel and the WebNN quantized GEMM path.

Setup

The researcher tested at commit [redacted] and states that no source modifications were required. The build is an AddressSanitizer release build of Chrome:

Bash
autoninja -C out/asan-release chrome

The proof of concept is a page named poc.html, loaded directly as a command line argument. The report does not include the contents of poc.html; it only shows how Chrome is launched with it. The complete ASAN log is said to be attached in issue_tflite005/asan.log, which is not reproduced in the text either.

Two launch configurations are given, one for Windows and one for Linux. Both disable the sandbox and enable the WebMachineLearningNeuralNetwork feature. The Windows command additionally disables WebNNOnnxRuntime and sets a temporary user data directory.

Finding it

The researcher traced the problem through two commits, one in TFLite upstream and one in Chromium.

TFLite upstream: FullyConnectedPerChannel introduced

  • Commit: [redacted]
  • Date: 2022-06-12
  • Author: A. Unique TensorFlower
  • Subject: TFLite FC Layer Per-channel quantization (Full-Integer i8xi8->i8 or i16xi8->i16)
  • Piper: PiperOrigin-RevId: 454517886
  • URL: https://github.com/tensorflow/tensorflow/commit/[redacted]

According to the report, this commit introduced per-channel quantization for FULLY_CONNECTED in a single change. PrepareImpl allocates per_channel_output_multiplier and per_channel_output_shift arrays sized to filter->dims->data[quantized_dimension], with only a self-referential consistency check (scale->size == filter->dims->data[quantized_dimension]) and no enforcement that quantized_dimension == 0. The optimized FullyConnectedPerChannel kernel then iterates over filter->dims->data[0] (output channels) elements, which causes a heap out-of-bounds read when quantized_dimension != 0 and dim 0 is greater than dim quantized_dimension.

Became web-reachable

The report says this commit added quantized GEMM fusion in the WebNN TFLite graph builder without validating that the weight tensor's per-channel quantization axis is dimension 0. That is what made the older TFLite behaviour reachable from a web page.

Exploitation

Step 1: build an ASAN Chrome

The researcher builds an AddressSanitizer release build so that the out-of-bounds read is detected and reported:

Bash
autoninja -C out/asan-release chrome

Step 2: launch Chrome on Windows

Text
ASAN_OPTIONS=detect_odr_violation=0 out/asan-release/chrome.exe ^
  --no-sandbox ^
  --enable-features=WebMachineLearningNeuralNetwork ^
  --disable-features=WebNNOnnxRuntime ^
  --user-data-dir=%TEMP%\poc-tflite005 ^
  --enable-logging=stderr ^
  poc.html

--enable-features=WebMachineLearningNeuralNetwork turns on the WebNN feature. --disable-features=WebNNOnnxRuntime keeps the TFLite backend in play rather than the ONNX Runtime path. --no-sandbox removes the sandbox for the test, and --enable-logging=stderr sends logging to standard error. The last argument is the proof of concept page.

Step 3: launch Chrome on Linux

Text
out/asan-release/chrome \
  --no-sandbox \
  --enable-features=WebMachineLearningNeuralNetwork \
  --enable-logging=stderr \
  poc.html

The Linux command is the same idea without the Windows-specific flags. The report does not show the contents of poc.html, so the exact WebNN graph the page builds is not given in the text. What the report does describe is the shape of the graph that triggers the bug: a quantized GEMM whose weight tensor B has shape [N, K] and whose scale has shape [1, K], so that the per-channel quantization axis resolves to dimension 1 rather than dimension 0.

Step 4: observe the crash

The report states that the GPU process crashes within seconds. ASAN reports a heap-buffer-overflow READ of size 32 in ruy::Kernel8bitAvx2Impl, called from FullyConnectedPerChannel. The ASAN log excerpt is:

Text
==23132==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x1254fc5da8af
READ of size 32 at 0x1254fc5da8af thread T23
    #0 ruy::Kernel8bitAvx2Impl<32>           kernel_avx2_fma.cc:359
    #5 GemmImplUsingRuy::Run                 cpu_backend_gemm_ruy.h:141
    #6 optimized_integer_ops::FullyConnectedPerChannel  fully_connected.h:95
    #7 fully_connected::EvalQuantized<1>     fully_connected.cc:1510
    #8 fully_connected::Eval<1>              fully_connected.cc:1795
    #12 webnn::tflite::GraphImplTflite::ComputeResources::DoDispatch  graph_impl_tflite.cc:328

0x1254fc5da8af is located 1 bytes before 8-byte region
allocated by thread T23 here:
    #1 std::vector<int>::resize              vector.h:1362
    #2 fully_connected::PrepareImpl          fully_connected.cc:463

SUMMARY: AddressSanitizer: heap-buffer-overflow ruy::Kernel8bitAvx2Impl

The stack shows the path from the WebNN TFLite graph dispatch (GraphImplTflite::ComputeResources::DoDispatch) through the TFLite FULLY_CONNECTED evaluation into the ruy GEMM backend. The allocation site is fully_connected::PrepareImpl at fully_connected.cc:463, which is the per_channel_output_shift.resize(...) line shown in the root cause section. The read happens in the AVX2 ruy kernel.

Root Cause

The report explains the bug in three layers.

The WebNN fusion check

CanFuseQuantizeAndGetOutput(const mojom::Gemm&) checks only whether B's scale has more than one element and whether bTranspose is true:

C++
// services/webnn/tflite/graph_builder_tflite.cc:2072-2083
size_t number_of_b_scale =
    GetOperand(b_dequantize.scale_operand_id).descriptor.NumberOfElements();
const bool per_channel_quantization = number_of_b_scale != 1;
if (per_channel_quantization && !gemm.b_transpose) {
  return std::nullopt;
}

There is no validation that B's quantization axis will map to TFLite FULLY_CONNECTED's filter dimension 0 (output channels).

The axis computation

If B has shape [N, K] and its scale has shape [1, K], SerializeQuantizeParams computes the quantization axis by scanning the scale shape for the non-unit dimension, arriving at axis 1:

C++
// services/webnn/tflite/graph_builder_tflite.cc:7001-7009
for (size_t i = 0; i < scale_shape.size(); ++i) {
  if (scale_shape[i] != 1) {
    axis = (input_rank - scale_shape.size()) + i;   // yields axis = 1
  }
}

The TFLite preparation check

TFLite's fully_connected::PrepareImpl validates only that the scale array length matches the filter size along the declared quantization dimension. The report calls this a self-consistent but semantically wrong check:

C++
// third_party/tflite/src/tensorflow/lite/kernels/fully_connected.cc:453-463
TF_LITE_ENSURE_EQ(context, affine_quantization->scale->size,
                  filter->dims->data[affine_quantization->quantized_dimension]);
// ...
data->per_channel_output_multiplier.resize(per_channel_quantization_size);
data->per_channel_output_shift.resize(per_channel_quantization_size);

For a filter of shape [1024, 2] with quantized_dimension = 1, the arrays are allocated with size 2. The optimized FullyConnectedPerChannel kernel then passes these 2-element arrays as per-row multipliers to the ruy GEMM backend, which expects 1024 entries (one per output row). The ruy kernel reads well past the allocated buffer.

In short, the WebNN layer accepts a per-channel quantization axis that is not dimension 0, the TFLite preparation step only checks that the scale length matches the declared axis, and the kernel then indexes the arrays by output channel. The mismatch between the allocation size (input channels) and the iteration count (output channels) is the overflow. The existing checks did not stop it because each one is internally consistent with the wrong axis; neither layer enforces that the axis is the output channel dimension.

Impact

The report describes a heap-buffer-overflow read in the GPU process, reachable from a web page through WebNN on platforms where the TFLite WebNN backend is active. The report states that no special GPU hardware is required. The ASAN log shows a read of size 32 past an 8-byte allocation, in the ruy AVX2 kernel.

The report does not describe what an attacker could do beyond triggering the crash, and it does not claim code execution or any specific consequence other than the GPU process crash. The platform metadata classifies the issue as critical, but the report text itself only demonstrates the out-of-bounds read and the crash. Any statement about exploitability beyond that would go beyond what the original says.

Fix

What it identifies as the missing validation is a check that the weight tensor's per-channel quantization axis is dimension 0 (output channels) before fusing a quantized GEMM into TFLite FULLY_CONNECTED.

Variants to test

  1. Other per-channel axes.
  2. Different dimension ratios.
  3. Transpose combinations.
  4. Other backends and platforms.
  5. Other fused operators.

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. 20 min read.

What happened, in plain words

A security researcher found a bug in Google Chrome. Chrome is the web browser made by Google. The bug is in a part of Chrome that lets a web page ask the browser to run a small artificial intelligence (AI) calculation, the kind used by machine learning models. When a page sends a specially shaped request, Chrome's graphics helper process (called the GPU process) reads memory it should not read, and crashes.

That kind of mistake has a name: a heap buffer overflow. Imagine a row of numbered lockers, and someone is told to open lockers 1 to 1024, but only 2 lockers were actually built. When they reach locker 3, they are reading whatever happens to be next to the row, which belongs to someone else. In a computer, that "next to the row" is other memory, and reading it can crash the program or, in worse cases, leak information.

The report describes the bug in detail, shows how to reproduce the crash, and explains which lines of code are responsible. The platform records it as a critical severity issue in WebML (the web machine learning area), disclosed on 2026-04-07, with a bounty of 43000.00 USD paid to the researcher. The report itself is titled around TFLite FullyConnectedPerChannel and the WebNN quantized GEMM path.

This article walks through the original report from the beginning, explaining every technical idea as it appears, for a reader who has never studied security.

Context

What the product is

Google Chrome is a web browser. When you open a web page, Chrome downloads files (HTML, JavaScript, images) and runs them in a controlled way. Modern browsers split their work into several processes: one process draws the page, another handles the network, another talks to the graphics card. This separation is a safety measure: if one process misbehaves, the others keep running.

The GPU process is the one that talks to the graphics card. It is also used for heavy calculations that benefit from parallel hardware, including some AI work.

What WebNN is

WebNN stands for Web Neural Network. It is a web API, meaning a set of functions that a web page can call, like a menu of services the browser offers. Through WebNN, a page can describe a neural network (a mathematical model made of layers of numbers) and ask the browser to run it. The browser decides how to run it, often in the GPU process.

A useful comparison: an API is like a restaurant menu. You do not go into the kitchen; you order from the menu, and the kitchen decides how to cook it. WebNN is the menu a page uses to order "run this neural network".

What TFLite is

TFLite (TensorFlow Lite) is a small, fast library for running neural networks on phones, laptops and other devices. It is made by Google as part of the TensorFlow project. Chrome can translate a WebNN graph into a TFLite graph and run it with TFLite's building blocks, called kernels. A kernel is one operation, such as "multiply two matrices" or "add a bias".

What a quantized GEMM is

A GEMM (General Matrix Multiply) is a standard mathematical operation: multiply two grids of numbers (matrices) and produce a third. Neural networks are mostly made of these.

Quantization is a way of storing numbers with less precision to save memory and speed things up. Instead of storing each number as a decimal (like 3.14159), you store a small integer (like 42) plus a scale and a zero point that let you convert back approximately. It is like writing distances in whole kilometres instead of metres and centimetres: smaller, faster, slightly less exact.

Per-channel quantization means using a different scale for each "channel". A channel here is one slice of the data, for example one output neuron. Each channel gets its own scale value, stored in a small array (a list of numbers).

What the report is about

When Chrome translates a WebNN graph into a TFLite graph, it can fuse two operations into one. Fusion means combining steps to save time, like a recipe that says "chop and fry" in one instruction instead of two. Here, the translation layer fuses a dequantize step (turning small integers back into decimals) and a GEMM into TFLite's FULLY_CONNECTED operator, which is the standard "dense layer" of a neural network.

The report shows that this fusion does not check that the weight tensor's per-channel quantization axis is dimension 0 (the output channels). If the axis is dimension 1 (the input channels) instead, the TFLite kernel allocates arrays sized to the input channel count, then loops over output channels and reads past the end of those arrays. The result is a heap buffer overflow in the GPU process.

A tensor is just a grid of numbers with a shape. A shape like [1024, 2] means 1024 rows and 2 columns. An axis (or dimension) is one of those directions: axis 0 is the rows, axis 1 is the columns.

The report states the affected platforms: all where the TFLite WebNN backend is active, which it describes as Linux, ChromeOS and Android by default, and Windows and macOS as a fallback. No special GPU hardware is required.

The platform metadata records this as a critical severity heap buffer overflow in WebML, disclosed on 2026-04-07, with a bounty of 43000.00 USD.

Setup

The researcher tested at commit [redacted] and states that no source modifications were required. A commit is a saved snapshot of a code project, identified by a long hexadecimal string. Saying "tested at commit X" means "I ran the code exactly as it was at that snapshot".

The build is an AddressSanitizer release build of Chrome. AddressSanitizer, often shortened to ASAN, is a tool built into the compiler that watches memory accesses while a program runs. When the program reads or writes outside a memory block it was given, ASAN stops it and prints a detailed report. It is like a safety inspector standing next to every locker, noting when someone reaches into the wrong one.

Bash
autoninja -C out/asan-release chrome

Line by line:

  • autoninja is Google's build tool wrapper. It runs the build system that compiles Chrome from source code into an executable program.
  • -C out/asan-release tells it to work in the directory out/asan-release, which is a build output folder configured for an ASAN release build.
  • chrome is the name of the target to build, meaning the Chrome executable.

Why this step: you cannot test a memory bug without a tool that notices memory bugs. A normal Chrome build would silently read the wrong memory and might not crash in an obvious way. An ASAN build turns the mistake into a loud, precise report.

The proof of concept is a page named poc.html, loaded directly as a command line argument. A proof of concept (PoC) is a small demonstration that proves a bug is real, without needing the full attack. The report does not include the contents of poc.html; it only shows how Chrome is launched with it. The complete ASAN log is said to be attached in issue_tflite005/asan.log, which is not reproduced in the text either.

Two launch configurations are given, one for Windows and one for Linux. Both disable the sandbox and enable the WebMachineLearningNeuralNetwork feature. The sandbox is Chrome's isolation mechanism: each process is locked in a box so that even if it is compromised, it cannot touch the rest of the system. Disabling it is normal during security testing, because the researcher wants to see the raw crash without the sandbox interfering. The Windows command additionally disables WebNNOnnxRuntime and sets a temporary user data directory.

Finding it

The researcher traced the problem through two commits, one in TFLite upstream and one in Chromium. Upstream means the original project that another project borrows code from. TFLite is upstream; Chromium (the open source project behind Chrome) uses it.

TFLite upstream: FullyConnectedPerChannel introduced

  • Commit: [redacted]
  • Date: 2022-06-12
  • Author: A. Unique TensorFlower
  • Subject: TFLite FC Layer Per-channel quantization (Full-Integer i8xi8->i8 or i16xi8->i16)
  • Piper: PiperOrigin-RevId: 454517886
  • URL: https://github.com/tensorflow/tensorflow/commit/[redacted]

According to the report, this commit introduced per-channel quantization for FULLY_CONNECTED in a single change. PrepareImpl allocates per_channel_output_multiplier and per_channel_output_shift arrays sized to filter->dims->data[quantized_dimension], with only a self-referential consistency check (scale->size == filter->dims->data[quantized_dimension]) and no enforcement that quantized_dimension == 0. The optimized FullyConnectedPerChannel kernel then iterates over filter->dims->data[0] (output channels) elements, which causes a heap out-of-bounds read when quantized_dimension != 0 and dim 0 is greater than dim quantized_dimension.

In plain words: PrepareImpl is the setup function that runs before the actual calculation. It prepares two lists, one of multipliers and one of shifts, used to convert numbers back and forth during quantization. It sizes those lists according to the dimension the caller declared as the quantization axis. The only check is that the scale list length matches that same declared dimension, which is circular: it checks that the number matches itself. Nothing checks that the declared axis is 0, the output channels. Later, the fast kernel loops over output channels (dimension 0) and reads one entry per output channel from those lists. If the lists were sized for dimension 1 and dimension 0 is larger, the loop runs past the end of the lists.

Became web-reachable

The report says this commit added quantized GEMM fusion in the WebNN TFLite graph builder without validating that the weight tensor's per-channel quantization axis is dimension 0. That is what made the older TFLite behaviour reachable from a web page.

"Reachable from a web page" is the key phrase. Before this commit, the buggy TFLite code existed but a web page could not easily feed it the wrong shape. After the commit, a page using WebNN could. A bug that only a local program can trigger is less serious than one any website can trigger, because the latter can be delivered by simply visiting a page.

Exploitation

Step 1: build an ASAN Chrome

The researcher builds an AddressSanitizer release build so that the out-of-bounds read is detected and reported:

Bash
autoninja -C out/asan-release chrome

Line by line:

  • autoninja runs the build.
  • -C out/asan-release selects the ASAN release output folder.
  • chrome is the program to produce.

Why: without ASAN, the out-of-bounds read might go unnoticed. With ASAN, the moment the kernel reads past the end of the list, the program stops and prints exactly where and how.

Step 2: launch Chrome on Windows

Text
ASAN_OPTIONS=detect_odr_violation=0 out/asan-release/chrome.exe ^
  --no-sandbox ^
  --enable-features=WebMachineLearningNeuralNetwork ^
  --disable-features=WebNNOnnxRuntime ^
  --user-data-dir=%TEMP%\poc-tflite005 ^
  --enable-logging=stderr ^
  poc.html

Line by line:

  • ASAN_OPTIONS=detect_odr_violation=0 sets an environment variable that tells ASAN to skip a particular class of warning (ODR violations, which are about duplicate definitions across libraries). This keeps the output focused on the real bug.
  • out/asan-release/chrome.exe is the ASAN build of Chrome.
  • ^ at the end of a line is the Windows command prompt's way of saying "the command continues on the next line". It is not part of the program's arguments.
  • --no-sandbox turns off the sandbox for this test run.
  • --enable-features=WebMachineLearningNeuralNetwork turns on the WebNN feature. Chrome hides unfinished features behind switches like this.
  • --disable-features=WebNNOnnxRuntime turns off an alternative backend (ONNX Runtime) so that the TFLite backend is the one used. Without this, Chrome might take a different path and the bug would not appear.
  • --user-data-dir=%TEMP%\poc-tflite005 tells Chrome to use a fresh, temporary profile folder. This avoids mixing with your normal browsing data and makes the test repeatable.
  • --enable-logging=stderr sends Chrome's log messages to the standard error stream, so the researcher can see them in the terminal.
  • poc.html is the proof of concept page, opened as if it were a URL.

Why each flag: the goal is to make Chrome use exactly the code path that contains the bug, with a clean profile, and to see the crash output in the terminal.

Step 3: launch Chrome on Linux

Text
out/asan-release/chrome \
  --no-sandbox \
  --enable-features=WebMachineLearningNeuralNetwork \
  --enable-logging=stderr \
  poc.html

Line by line:

  • out/asan-release/chrome is the ASAN build on Linux.
  • \ at the end of a line is the Linux shell's line continuation, the equivalent of Windows ^.
  • --no-sandbox disables the sandbox.
  • --enable-features=WebMachineLearningNeuralNetwork enables WebNN.
  • --enable-logging=stderr sends logs to the terminal.
  • poc.html is the page.

The Linux command is the same idea without the Windows-specific flags. The report does not show the contents of poc.html, so the exact WebNN graph the page builds is not given in the text. What the report does describe is the shape of the graph that triggers the bug: a quantized GEMM whose weight tensor B has shape [N, K] and whose scale has shape [1, K], so that the per-channel quantization axis resolves to dimension 1 rather than dimension 0.

In plain words: the weight matrix has N rows and K columns. The scale list has one row and K columns. When the code looks for the axis, it finds the only non-1 dimension, which is the second one (K), and calls that axis 1. But the kernel expects the per-channel axis to be the first one (N, the output channels). That mismatch is the bug.

Step 4: observe the crash

The report states that the GPU process crashes within seconds. ASAN reports a heap-buffer-overflow READ of size 32 in ruy::Kernel8bitAvx2Impl, called from FullyConnectedPerChannel. The ASAN log excerpt is:

Text
==23132==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x1254fc5da8af
READ of size 32 at 0x1254fc5da8af thread T23
    #0 ruy::Kernel8bitAvx2Impl<32>           kernel_avx2_fma.cc:359
    #5 GemmImplUsingRuy::Run                 cpu_backend_gemm_ruy.h:141
    #6 optimized_integer_ops::FullyConnectedPerChannel  fully_connected.h:95
    #7 fully_connected::EvalQuantized<1>     fully_connected.cc:1510
    #8 fully_connected::Eval<1>              fully_connected.cc:1795
    #12 webnn::tflite::GraphImplTflite::ComputeResources::DoDispatch  graph_impl_tflite.cc:328

0x1254fc5da8af is located 1 bytes before 8-byte region
allocated by thread T23 here:
    #1 std::vector<int>::resize              vector.h:1362
    #2 fully_connected::PrepareImpl          fully_connected.cc:463

SUMMARY: AddressSanitizer: heap-buffer-overflow ruy::Kernel8bitAvx2Impl

Line by line:

  • ==23132==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x1254fc5da8af is ASAN's headline: it has detected a heap buffer overflow at a particular memory address. The number in ==...== is the process identifier.
  • READ of size 32 at 0x1254fc5da8af thread T23 says the program tried to read 32 bytes from that address, on thread 23. A thread is one line of execution inside a process; a process can have many.
  • The #0 to #12 lines are the stack trace: the chain of function calls that led to the bad read, from the innermost (#0) to the outer ones. Reading from top to bottom: the AVX2 ruy kernel (ruy::Kernel8bitAvx2Impl) was called by the ruy GEMM runner (GemmImplUsingRuy::Run), which was called by FullyConnectedPerChannel, which was called by the quantized evaluation function, and so on up to the WebNN TFLite graph dispatch (GraphImplTflite::ComputeResources::DoDispatch).
  • 0x1254fc5da8af is located 1 bytes before 8-byte region says the bad address is just before a small 8-byte block of memory. In other words, the read started before the block, not inside it.
  • allocated by thread T23 here: shows where that 8-byte block came from: std::vector<int>::resize inside fully_connected::PrepareImpl. That is the list allocation described in the root cause.
  • SUMMARY: AddressSanitizer: heap-buffer-overflow ruy::Kernel8bitAvx2Impl is ASAN's one-line summary.

The stack shows the path from the WebNN TFLite graph dispatch (GraphImplTflite::ComputeResources::DoDispatch) through the TFLite FULLY_CONNECTED evaluation into the ruy GEMM backend. ruy is a matrix multiplication library used by TFLite. The allocation site is fully_connected::PrepareImpl at fully_connected.cc:463, which is the per_channel_output_shift.resize(...) line shown in the root cause section. The read happens in the AVX2 ruy kernel. AVX2 is a set of processor instructions for doing several numbers at once; the kernel uses it to multiply faster.

Root Cause

The report explains the bug in three layers.

The WebNN fusion check

CanFuseQuantizeAndGetOutput(const mojom::Gemm&) checks only whether B's scale has more than one element and whether bTranspose is true:

C++
// services/webnn/tflite/graph_builder_tflite.cc:2072-2083
size_t number_of_b_scale =
    GetOperand(b_dequantize.scale_operand_id).descriptor.NumberOfElements();
const bool per_channel_quantization = number_of_b_scale != 1;
if (per_channel_quantization && !gemm.b_transpose) {
  return std::nullopt;
}

Line by line:

  • size_t number_of_b_scale = starts a variable that will hold a count. size_t is an unsigned integer type used for sizes.
  • GetOperand(b_dequantize.scale_operand_id).descriptor.NumberOfElements(); looks up the scale operand and asks how many numbers it contains.
  • const bool per_channel_quantization = number_of_b_scale != 1; sets a true/false flag: if the scale has more than one number, we are in per-channel mode.
  • if (per_channel_quantization && !gemm.b_transpose) { checks: if we are in per-channel mode and the weight is not transposed, then...
  • return std::nullopt; ...refuse to fuse. std::nullopt means "no value", i.e. do not fuse.

There is no validation that B's quantization axis will map to TFLite FULLY_CONNECTED's filter dimension 0 (output channels). The check only looks at how many scale values there are and whether the weight is transposed. It never asks which axis those scale values describe.

The axis computation

If B has shape [N, K] and its scale has shape [1, K], SerializeQuantizeParams computes the quantization axis by scanning the scale shape for the non-unit dimension, arriving at axis 1:

C++
// services/webnn/tflite/graph_builder_tflite.cc:7001-7009
for (size_t i = 0; i < scale_shape.size(); ++i) {
  if (scale_shape[i] != 1) {
    axis = (input_rank - scale_shape.size()) + i;   // yields axis = 1
  }
}

Line by line:

  • for (size_t i = 0; i < scale_shape.size(); ++i) { loops over each position in the scale's shape.
  • if (scale_shape[i] != 1) { checks whether this position is not 1. A dimension of 1 means "only one value here", so a non-1 dimension is the one carrying the per-channel data.
  • axis = (input_rank - scale_shape.size()) + i; computes the axis number, aligning the scale's shape with the input's rank. Rank is the number of dimensions a tensor has; a matrix has rank 2.
  • // yields axis = 1 is a comment saying that, for the shape [1, K], this calculation produces axis 1.

Why this matters: the code assumes the only non-1 dimension is the per-channel axis, but it does not check that this axis is 0. For a scale of shape [1, K], it picks axis 1, which is the input channel direction, not the output channel direction.

The TFLite preparation check

TFLite's fully_connected::PrepareImpl validates only that the scale array length matches the filter size along the declared quantization dimension. The report calls this a self-consistent but semantically wrong check:

C++
// third_party/tflite/src/tensorflow/lite/kernels/fully_connected.cc:453-463
TF_LITE_ENSURE_EQ(context, affine_quantization->scale->size,
                  filter->dims->data[affine_quantization->quantized_dimension]);
// ...
data->per_channel_output_multiplier.resize(per_channel_quantization_size);
data->per_channel_output_shift.resize(per_channel_quantization_size);

Line by line:

  • TF_LITE_ENSURE_EQ(context, affine_quantization->scale->size, starts a check that two values are equal. TF_LITE_ENSURE_EQ is a TFLite macro that aborts with an error if they are not.
  • filter->dims->data[affine_quantization->quantized_dimension]); is the second value: the size of the filter along the declared quantization dimension.
  • // ... marks omitted lines.
  • data->per_channel_output_multiplier.resize(per_channel_quantization_size); allocates the multiplier list with the computed size.
  • data->per_channel_output_shift.resize(per_channel_quantization_size); allocates the shift list with the same size.

Why this is "self-consistent but semantically wrong": the check compares the scale length to the filter size along the axis the caller declared. If the caller declared axis 1, the check compares the scale length to the filter's size along axis 1, and they match. The check passes. But the kernel later uses these lists as if they were indexed by output channels (axis 0). The check is consistent with the wrong declaration, so it does not catch the mistake.

For a filter of shape [1024, 2] with quantized_dimension = 1, the arrays are allocated with size 2. The optimized FullyConnectedPerChannel kernel then passes these 2-element arrays as per-row multipliers to the ruy GEMM backend, which expects 1024 entries (one per output row). The ruy kernel reads well past the allocated buffer.

In short, the WebNN layer accepts a per-channel quantization axis that is not dimension 0, the TFLite preparation step only checks that the scale length matches the declared axis, and the kernel then indexes the arrays by output channel. The mismatch between the allocation size (input channels) and the iteration count (output channels) is the overflow. The existing checks did not stop it because each one is internally consistent with the wrong axis; neither layer enforces that the axis is the output channel dimension.

Impact

The report describes a heap-buffer-overflow read in the GPU process, reachable from a web page through WebNN on platforms where the TFLite WebNN backend is active. The report states that no special GPU hardware is required. The ASAN log shows a read of size 32 past an 8-byte allocation, in the ruy AVX2 kernel.

The report does not describe what an attacker could do beyond triggering the crash, and it does not claim code execution or any specific consequence other than the GPU process crash. The platform metadata classifies the issue as critical, but the report text itself only demonstrates the out-of-bounds read and the crash. Any statement about exploitability beyond that would go beyond what the original says.

In plain words: the report proves the crash. It does not prove that an attacker could turn the crash into something worse, such as running their own code. That distinction matters when reading security news: a crash is a bug, but not every crash is a full compromise.

Fix

A patch is a small code change that repairs a bug. What the report identifies as the missing validation is a check that the weight tensor's per-channel quantization axis is dimension 0 (output channels) before fusing a quantized GEMM into TFLite FULLY_CONNECTED.

Variants to test

A variant here means a related version of the same bug that might exist elsewhere.

  1. Other per-channel axes.
  2. Different dimension ratios.
  3. Transpose combinations.
  4. Other backends and platforms.
  5. Other fused operators.

Glossary

  • API: a set of functions a program offers to other programs, like a menu of services.
  • ASAN (AddressSanitizer): a tool that watches memory accesses during a program run and reports out-of-bounds reads and writes.
  • AVX2: a set of processor instructions for doing several numbers at once, used to speed up calculations.
  • Axis (dimension): one direction in a tensor's shape; axis 0 is the rows, axis 1 the columns, and so on.
  • Backend: the internal component that actually performs a task; here, the TFLite or ONNX Runtime path used by WebNN.
  • Bounty: a payment made to a researcher who reports a security bug.
  • Buffer: a block of memory set aside to hold data.
  • Commit: a saved snapshot of a code project, identified by a long hexadecimal string.
  • Critical: the highest severity label used by the platform for this issue.
  • Dequantize: convert a small integer plus scale back into an approximate decimal number.
  • Fusion: combining two operations into one to save time.
  • GEMM (General Matrix Multiply): the standard operation of multiplying two matrices.
  • GPU process: the Chrome process that talks to the graphics card and runs some heavy calculations.
  • Heap: the area of memory a program uses for data it creates while running.
  • Heap buffer overflow: reading or writing past the end of a block of heap memory.
  • Kernel: one operation in a neural network library, such as matrix multiply or add.
  • Matrix: a grid of numbers with rows and columns.
  • Neural network: a mathematical model made of layers of numbers, used for machine learning.
  • Out-of-bounds (OOB): outside the allowed range of a memory block.
  • Patch: a small code change that repairs a bug.
  • Per-channel quantization: using a different scale for each channel of the data.
  • PoC (proof of concept): a small demonstration that proves a bug is real.
  • Process: a running program with its own memory; Chrome uses several for safety.
  • Quantization: storing numbers with less precision (small integers plus a scale) to save memory and time.
  • Rank: the number of dimensions a tensor has.
  • ruy: a matrix multiplication library used by TFLite.
  • Sandbox: Chrome's isolation mechanism that locks each process in a box.
  • Scale: a number used to convert between quantized integers and real values.
  • Severity: a label describing how serious a bug is.
  • Stack trace: the chain of function calls that led to a point in a program.
  • Tensor: a grid of numbers with a shape.
  • TFLite (TensorFlow Lite): a small, fast library for running neural networks on devices.
  • Thread: one line of execution inside a process.
  • Upstream: the original project that another project borrows code from.
  • Variant: a related version of a bug that might exist elsewhere.
  • WebNN (Web Neural Network): a web API that lets a page describe and run neural networks in the browser.
  • Zero point: a number used together with the scale in quantization to map integers back to real values.

More by c6eed09fc8b174b0f3eebedcceb1e792

View all

52 more disclosed reports, best first.

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.