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

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

A WebNN graph using concat and avgPool2d with ceil rounding caused a heap buffer overflow read in the TFLite/XNNPACK backend because the padding helper returned VALID padding without accounting for ceil rounding. An attacker could trigger an out-of-bounds heap read in the GPU process, potentially leaking heap memory shared between origins.

Tobias Wienand Follow

Originally disclosed on Chrome VRP

Bounty$43,000 High View original
  • Fix shipped in 27 days

Report description

Heap Buffer Overflow (READ) in TFLite + XNNPack via WebNN


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://source.chromium.org/chromium/chromium/src/+/main:third_party/xnnpack/src/src/xx-copy/xx-copy-scalar-memcpy.c;l=18;drc=1bbe3261c7cd6ca9d140b5cea7aed9df2982418a


The problem

Please describe the technical details of the vulnerability

XNNPACK heap-buffer-overflow (OOB Read) via WebNN concat + avgPool2d ceil rounding

Environment

Ubuntu + AMD processor (for completeness, shouldn't matter).

Base Chromium revision

a0062e558d37e03d9129522e5a3c6c29946d8195 (2026-02-10)

GN args

is_asan = true
is_debug = false
symbol_level = 1

Build

cd chromium/src
gn gen out/asan_shell
autoninja -C out/asan_shell content_shell

Running the PoC

WebNN is behind a feature flag. The GPU process is a separate process, so its ASAN errors don't appear on the main process stderr. Setting ASAN_OPTIONS with log_path captures per-process ASAN output to disk.

ASAN_OPTIONS="log_path=/tmp/asan_log:detect_leaks=0" ./out/asan_shell/content_shell --enable-features=WebMachineLearningNeuralNetwork file:///path/to/poc.html

The GPU process crashes during graph dispatch (inference). ASAN output is at /tmp/asan_log.<gpu_pid>. The poc.html file is included in this report.

ASAN output

==3511981==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7cf3f8f74708 at pc 0x60c72c4ed02b bp 0x7be37d4f98a0 sp 0x7be37d4f9060
READ of size 12 at 0x7cf3f8f74708 thread T71 (ThreadPoolForeg)
    #0 __asan_memcpy
    #1 xnn_xx_copy_ukernel__scalar_memcpy  third_party/xnnpack/src/src/xx-copy/xx-copy-scalar-memcpy.c:18:3
    #2 xnn_compute_univector_strided       third_party/xnnpack/src/src/operator-run.c:1733:5
    #3 xnn_run_operator_with_index         third_party/xnnpack/src/src/operator-run.c:2482:9
    #4 xnn_invoke_runtime                  third_party/xnnpack/src/src/runtime.c:1207:38
    #5 SubgraphInvoke                      third_party/tflite/src/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc:1421:25
    #6 tflite::Subgraph::Invoke()          third_party/tflite/src/tensorflow/lite/core/subgraph.cc:1653:17
    #7 DoDispatch                          services/webnn/tflite/graph_impl_tflite.cc:306:41

0x7cf3f8f74708 is located 0 bytes after 200-byte region [0x7cf3f8f74640,0x7cf3f8f74708)
allocated by thread T71 here:
    #0 operator new(unsigned long)
    #1 SubgraphInit  third_party/tflite/src/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc:1230:12

SUMMARY: AddressSanitizer: heap-buffer-overflow third_party/xnnpack/src/src/xx-copy/xx-copy-scalar-memcpy.c:18:3

Root cause

The bug is in GetPool2dTfLitePaddingMode() in graph_builder_tflite.cc (line 354):

C
base::expected<TfLitePadding, std::string> GetPool2dTfLitePaddingMode(
    const mojom::Padding2d& padding2d, ..., const webnn::Size2d<uint32_t>& output) {
  std::array<uint32_t, 4> explicit_padding = { ... };
  std::array<uint32_t, 4> no_padding = {0, 0, 0, 0};
  if (explicit_padding == no_padding) {
    return TfLitePadding{.mode = ::tflite::Padding_VALID};  // BUG
  }
  // ... ceil rounding handling code (lines 394-412) never reached ...
}

When explicit padding is [0,0,0,0], the function immediately returns Padding_VALID without checking whether the output dimensions require ceil rounding. This bypasses the ceil rounding handling code at lines 394-412, which would add extra ending padding to make TFLite's floor-based formula produce the correct output size.

The consequence is a shape mismatch between WebNN's validated graph and XNNPACK's internal computation: WebNN computes pool output shapes using ceil rounding, but XNNPACK recomputes them using floor division. The concat operator then reads past the smaller actual allocation.

Removing the early return and rebuilding content_shell eliminates the crash.

Bisection

Introducing commit: 6c9e4fea79849343c09bae0214cd76904f43be22 (2024-03-13) Title: "webnn: Support Pool2d in in //services/webnn/tflite" CL: https://chromium-review.googlesource.com/c/chromium/src/+/5359192

The parent commit returned "pool2d is not implemented" for pool2d. This commit added SerializePool2d(), which reused GetTfLitePaddingMode() (written for Conv2d) without ceil rounding awareness. The Blink IDL already had roundingType: 'ceil' at this point, so the bug was immediately reachable from JavaScript.

Verified by simulating both states on the current tree: disabling pool2d serialization produces no crash; re-enabling it reproduces the heap-buffer-overflow.

Impact analysis

Affected platforms

Tested on Linux (x86_64) with the TFLite+XNNPACK backend. The bug is in graph_builder_tflite.cc which is used on all platforms with the TFLite backend: Linux, Android (ARM64, x86/x64), and ChromeOS.

Impact

  • Attack vector: Any website, no user interaction required beyond navigation. WebNN is behind a feature flag (WebMachineLearningNeuralNetwork), which is not yet enabled by default, but eligible for VRP according to the rules and it is also in origin trial since Jan 31: https://chromium-review.googlesource.com/c/chromium/src/+/7518276.
  • Process: GPU process. On Android, this is unsandboxed.
  • Primitive: OOB heap read.
  • Consequence: Heap leak in a process shared between different origins. Maybe useful if heap leak can propagate back to JS

The cause

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

147.0.7681.0 dev

Is the security issue related to a crash?

Yes, it is related to a crash.

Choose the type of vulnerability

Memory Corruption (in a non-sandboxed process)

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

Tobias Wienand

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

Context

This report describes a heap buffer overflow (out of bounds read) in Chrome's WebNN implementation, specifically in the TFLite plus XNNPack backend. WebNN is the Web Neural Network API, which lets web pages build and run machine learning graphs inside the browser. Chrome dispatches those graphs to a backend; on the affected platforms the backend is TFLite with the XNNPack delegate, and the work runs in the GPU process.

The vulnerable code path is the serialisation of a WebNN graph into a TFLite model. The researcher traced the fault to GetPool2dTfLitePaddingMode() in graph_builder_tflite.cc, which decides how padding is expressed to TFLite. The bug is a mismatch between WebNN's ceil-based output shape calculation and TFLite/XNNPack's floor-based recomputation, which leads XNNPack to read past a heap allocation.

The report was filed under the Chrome VRP. The platform metadata records it as a high severity heap buffer overflow in WebML, disclosed on 2026-03-10, with a bounty of 43000.00 USD. The report itself does not state a CVSS score.

Setup

The researcher tested on Ubuntu with an AMD processor, noting that the CPU should not matter. The base Chromium revision was:

Text
[redacted] (2026-02-10)

The build used AddressSanitizer with these GN args:

Text
is_asan = true
is_debug = false
symbol_level = 1

The build commands were:

Bash
cd chromium/src
gn gen out/asan_shell
autoninja -C out/asan_shell content_shell

WebNN is behind a feature flag. Because the GPU process is a separate process, its ASAN errors do not appear on the main process stderr. The researcher therefore set ASAN_OPTIONS with log_path so that each process writes its ASAN output to disk.

The reported Chrome version was 147.0.7681.0 dev.

Finding it

The report answered the form's question about the URL or repository containing the vulnerability with a link to the XNNPack scalar copy kernel:

Text
https://source.chromium.org/chromium/chromium/src/+/main:third_party/xnnpack/src/src/xx-copy/xx-copy-scalar-memcpy.c;l=18;drc=[redacted]

The report's technical description is titled "XNNPACK heap-buffer-overflow (OOB Read) via WebNN concat + avgPool2d ceil rounding". The crash is a heap buffer overflow read inside xnn_xx_copy_ukernel__scalar_memcpy, reached through the TFLite XNNPack delegate during graph dispatch (inference).

The researcher's summary of the issue is: heap buffer overflow (READ) in TFLite plus XNNPack via WebNN.

Exploitation

Step 1: Build an ASAN content_shell

The researcher built content_shell with ASAN enabled using the GN args and commands shown above.

Step 2: Run the PoC with WebNN enabled and per-process ASAN logging

The PoC is an HTML file. WebNN is enabled with the WebMachineLearningNeuralNetwork feature flag, and ASAN output is redirected to a log file per process:

Bash
ASAN_OPTIONS="log_path=/tmp/asan_log:detect_leaks=0" ./out/asan_shell/content_shell --enable-features=WebMachineLearningNeuralNetwork file:///path/to/poc.html

The GPU process crashes during graph dispatch (inference). The ASAN output is written to /tmp/asan_log.<gpu_pid>.

Step 3: Read the ASAN report

The captured ASAN output was:

Text
==3511981==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7cf3f8f74708 at pc 0x60c72c4ed02b bp 0x7be37d4f98a0 sp 0x7be37d4f9060
READ of size 12 at 0x7cf3f8f74708 thread T71 (ThreadPoolForeg)
    #0 __asan_memcpy
    #1 xnn_xx_copy_ukernel__scalar_memcpy  third_party/xnnpack/src/src/xx-copy/xx-copy-scalar-memcpy.c:18:3
    #2 xnn_compute_univector_strided       third_party/xnnpack/src/src/operator-run.c:1733:5
    #3 xnn_run_operator_with_index         third_party/xnnpack/src/src/operator-run.c:2482:9
    #4 xnn_invoke_runtime                  third_party/xnnpack/src/src/runtime.c:1207:38
    #5 SubgraphInvoke                      third_party/tflite/src/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc:1421:25
    #6 tflite::Subgraph::Invoke()          third_party/tflite/src/tensorflow/lite/core/subgraph.cc:1653:17
    #7 DoDispatch                          services/webnn/tflite/graph_impl_tflite.cc:306:41

0x7cf3f8f74708 is located 0 bytes after 200-byte region [0x7cf3f8f74640,0x7cf3f8f74708)
allocated by thread T71 here:
    #0 operator new(unsigned long)
    #1 SubgraphInit  third_party/tflite/src/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc:1230:12

SUMMARY: AddressSanitizer: heap-buffer-overflow third_party/xnnpack/src/src/xx-copy/xx-copy-scalar-memcpy.c:18:3

The important parts of this output:

  1. The fault is a READ of size 12 at an address located 0 bytes after a 200-byte heap region. The read is just past the end of the allocation.
  2. The stack shows the read happening in xnn_xx_copy_ukernel__scalar_memcpy, called from xnn_compute_univector_strided, then through the XNNPack runtime and the TFLite XNNPack delegate's SubgraphInvoke.
  3. The dispatch originates in DoDispatch in services/webnn/tflite/graph_impl_tflite.cc.
  4. The 200-byte region was allocated in SubgraphInit in the XNNPack delegate.

Step 4: Confirm the fix by removing the early return

The report states that removing the early return and rebuilding content_shell eliminates the crash.

Step 5: Bisect to the introducing commit

The introducing commit was:

Text
[redacted] (2024-03-13)

Its title was "webnn: Support Pool2d in in //services/webnn/tflite", and the CL was:

Text
https://chromium-review.googlesource.com/c/chromium/src/+/5359192

The parent commit returned "pool2d is not implemented" for pool2d. The introducing commit added SerializePool2d(), which reused GetTfLitePaddingMode() (written for Conv2d) without ceil rounding awareness. The Blink IDL already had roundingType: 'ceil' at that point, so the bug was immediately reachable from JavaScript.

The report states that simulating both states on the current tree was used: disabling pool2d serialisation produces no crash, and re-enabling it reproduces the heap buffer overflow.

Root cause

The bug is in GetPool2dTfLitePaddingMode() in graph_builder_tflite.cc (line 354). The report shows this excerpt:

C
base::expected<TfLitePadding, std::string> GetPool2dTfLitePaddingMode(
    const mojom::Padding2d& padding2d, ..., const webnn::Size2d<uint32_t>& output) {
  std::array<uint32_t, 4> explicit_padding = { ... };
  std::array<uint32_t, 4> no_padding = {0, 0, 0, 0};
  if (explicit_padding == no_padding) {
    return TfLitePadding{.mode = ::tflite::Padding_VALID};  // BUG
  }
  // ... ceil rounding handling code (lines 394-412) never reached ...
}

When explicit padding is [0,0,0,0], the function immediately returns Padding_VALID without checking whether the output dimensions require ceil rounding. This bypasses the ceil rounding handling code at lines 394-412, which would add extra ending padding so that TFLite's floor-based formula produces the correct output size.

The consequence is a shape mismatch between WebNN's validated graph and XNNPACK's internal computation. WebNN computes pool output shapes using ceil rounding, but XNNPACK recomputes them using floor division. The concat operator then reads past the smaller actual allocation.

In other words, the early return treats zero explicit padding as equivalent to valid padding, but it skips the adjustment needed when the requested output size implies ceil rounding. The downstream operator (concat) then operates on a buffer sized according to the smaller, floor-based shape, and the copy kernel reads beyond it.

Impact

The report describes the following impact:

  1. Attack vector: any website, with no user interaction required beyond navigation. WebNN is behind the WebMachineLearningNeuralNetwork feature flag, which the report says is not yet enabled by default but is eligible for VRP according to the program rules. The report also notes that WebNN has been in origin trial since Jan 31, citing https://chromium-review.googlesource.com/c/chromium/src/+/7518276.
  2. Process: the GPU process. On Android, the report states this process is unsandboxed.
  3. Primitive: out of bounds heap read.
  4. Consequence: a heap leak in a process shared between different origins. The report hedges that this may be useful if the heap leak can propagate back to JavaScript.

The researcher classified the issue as memory corruption in a non-sandboxed process and confirmed it is related to a crash. Affected platforms, as tested and reasoned by the researcher, are Linux (x86_64) with the TFLite plus XNNPack backend, and, because the bug is in graph_builder_tflite.cc, all platforms using the TFLite backend: Linux, Android (ARM64, x86/x64) and ChromeOS. The report lists the primitive as an out of bounds heap read and the consequence as a heap leak in a process shared between different origins.

Fix

The report does not describe an upstream patch or the exact change that was merged. What it does say is that the early return in GetPool2dTfLitePaddingMode() is the bug, and that removing the early return and rebuilding content_shell eliminates the crash. The report says the early return bypasses the ceil rounding handling at lines 394-412, which would add extra ending padding so that TFLite's floor-based formula produces the correct output size. The report does not state which of these was actually applied.

Variants to test

  1. Other pooling configurations with zero explicit padding and ceil rounding. Build WebNN graphs where avgPool2d or maxPool2d uses roundingType: 'ceil' with zero explicit padding and output dimensions that do not divide evenly. A positive result is an ASAN heap buffer overflow in the XNNPack copy kernel or another XNNPack operator, reached through DoDispatch.
  2. Other operators reusing Conv2d padding logic. The report notes that SerializePool2d() reused GetTfLitePaddingMode() written for Conv2d. Try other WebNN operators that share padding helpers with Conv2d and support ceil rounding. A positive result is a shape mismatch between the WebNN validated graph and the TFLite/XNNPack recomputation, visible as an out of bounds access or a wrong output shape.
  3. Concat combined with mismatched shapes. The crash here involved concat reading past a smaller allocation. Try concat with inputs whose shapes are computed through ceil-rounded pooling. A positive result is an out of bounds read in the copy kernel, as in this report.
  4. Different backends and platforms. The report tested Linux x86_64 and reasoned about Android and ChromeOS. Run the same PoC on Android (ARM64, x86/x64) and ChromeOS with the TFLite backend. A positive result is the same ASAN report or a crash in the GPU process.
  5. Feature flag and origin trial reachability. Check whether WebNN is reachable without the WebMachineLearningNeuralNetwork flag in builds where the origin trial is active. A positive result is the crash occurring from a normal web page without enabling the flag manually.

Each of these should be run with ASAN enabled and with log_path set, because the GPU process output is otherwise not visible on the main process stderr.

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

What happened, in plain words

A security researcher found a bug in Google Chrome, the web browser. The bug lets a normal web page make one of Chrome's internal helper processes read a small amount of memory it should not be allowed to read. The memory it reads sits just past the end of a block of memory that Chrome had set aside for something else. Reading past the end of a block like this is called a heap buffer overflow, and when the read goes past the end it is specifically an out of bounds read.

The part of Chrome involved is called WebNN. WebNN is a feature that lets web pages ask the browser to run machine learning calculations, the kind of maths used by image recognition, speech tools and similar software. Chrome does not do that maths itself: it hands the work to a separate piece of software called a backend. On the affected systems the backend is TFLite together with a component called XNNPack. The work runs inside Chrome's GPU process, which is a separate process from the one that shows you the page.

The researcher traced the fault to a single function that decides how to describe padding (extra empty space around the edges of an image-like grid of numbers) when Chrome converts a WebNN calculation into a TFLite model. The bug is a mismatch: WebNN works out the size of a result using one rounding rule (ceil, round up), while TFLite and XNNPack work it out using another (floor, round down). Because the two disagree, XNNPack ends up reading past a memory block that was allocated using the smaller, rounded-down size.

The report was filed under the Chrome VRP, Google's Vulnerability Reward Program, which pays researchers for finding and reporting security bugs. The platform metadata records it as a high severity heap buffer overflow in WebML, disclosed on 2026-03-10, with a bounty of 43000.00 USD. The report itself does not state a CVSS score. CVSS is a standard scoring system for how serious a vulnerability is; the report simply does not give one.

The report as filed

The researcher's own one-line summary of the issue was:

Text
Heap Buffer Overflow (READ) in TFLite + XNNPack via WebNN

In plain words: a read that goes past the end of a memory buffer, happening in the TFLite and XNNPack software, reached through the WebNN feature. The word READ matters. The bug does not write data anywhere it should not; it only reads. That makes it less immediately dangerous than a write, but still a leak of memory contents.

Where the bug was reported

The report was submitted to the Chrome VRP, described in the form as:

Text
Chrome VRP – Report security issues affecting the Chrome browser. [See program rules](https://bughunters.google.com/about/rules/5745167867576320/chrome-vulnerability-reward-program-rules)

A bug bounty program is an arrangement where a company invites outsiders to look for security problems and pays them for good reports. The program rules are the contract: they say what counts, how much is paid and how disclosure works.

Where in the code

The form asked which URL or repository contained the vulnerability. The answer was a link to a specific line in the Chromium source code browser:

Text
https://source.chromium.org/chromium/chromium/src/+/main:third_party/xnnpack/src/src/xx-copy/xx-copy-scalar-memcpy.c;l=18;drc=[redacted]

This is a URL into source.chromium.org, a website that lets anyone browse the source code of Chromium, the open source project Chrome is built from. The URL points at a file called xx-copy-scalar-memcpy.c, line 18 (l=18), at a particular revision of the code (drc= followed by a long hexadecimal string, which is a unique identifier for one exact snapshot of the code). The file is a small routine that copies bytes around, and it is where the out of bounds read physically happens. The report gives this URL as the location of the vulnerability.

The problem, in technical detail

The researcher's technical description has a title that names the two ingredients:

Text
XNNPACK heap-buffer-overflow (OOB Read) via WebNN concat + avgPool2d ceil rounding

Unpacking that: XNNPACK is the low level maths library; heap-buffer-overflow (OOB Read) means reading past the end of a heap allocation; via WebNN means the route in is the WebNN feature; concat is an operation that glues two grids of numbers together end to end; avgPool2d is an operation that shrinks a two dimensional grid by averaging small patches of it; and ceil rounding means the shrinking rounds the resulting size up rather than down. The report's technical description is titled "XNNPACK heap-buffer-overflow (OOB Read) via WebNN concat + avgPool2d ceil rounding".

Environment

The researcher tested on Ubuntu (a Linux distribution) with an AMD processor, and noted that the processor should not matter. This kind of note is standard in bug reports: it tells readers that the bug is not tied to one brand of hardware.

Base Chromium revision

Text
[redacted] (2026-02-10)

This is the exact snapshot of the Chromium source code the researcher built. The long hexadecimal string is a commit hash, a unique fingerprint for one saved state of the project. The date in brackets is when that snapshot was made. Giving the exact revision lets anyone else rebuild precisely the same software and try to reproduce the bug.

GN args

Text
is_asan = true
is_debug = false
symbol_level = 1

GN is the tool Chromium uses to generate its build files; the "args" are settings that control how the browser is compiled. Line by line:

  1. is_asan = true turns on AddressSanitizer. AddressSanitizer, often shortened to ASAN, is a tool built into the compiler that watches memory accesses while a program runs. It places invisible guard zones around every block of memory the program allocates, and if the program reads or writes into a guard zone, ASAN stops it and prints a detailed report. It is like putting a strip of fresh paint around every object on a shelf: if something touches the paint, you know it reached too far. Without ASAN, a small out of bounds read often goes unnoticed because the memory next to the block happens to be readable.
  2. is_debug = false builds an optimised, non-debug version. Debug builds are slower and behave differently; testing on a release-like build makes the result more realistic.
  3. symbol_level = 1 keeps some function names and line numbers in the binary so that ASAN reports can name the functions and files involved. Without symbols, the report would be a list of meaningless addresses.

Build

Bash
cd chromium/src
gn gen out/asan_shell
autoninja -C out/asan_shell content_shell

Line by line:

  1. cd chromium/src changes the current directory into the folder holding the Chromium source code. cd means change directory.
  2. gn gen out/asan_shell asks GN to generate the build files for a build configuration called asan_shell, placing them in a folder named out/asan_shell. This is where the settings above are applied.
  3. autoninja -C out/asan_shell content_shell compiles the target called content_shell using the generated files. autoninja is a wrapper around Ninja, a build tool that runs the compiler. content_shell is a minimal browser shell used for testing: it has the rendering and networking machinery of Chrome but not the full user interface. Building it is much faster than building all of Chrome, and it is enough to run a web page that uses WebNN.

Running the PoC

The researcher explains that WebNN is behind a feature flag. A feature flag is a switch inside the browser that turns a feature on or off; features still under development are usually off by default so that ordinary users are not affected. The GPU process is a separate process, so its ASAN errors do not appear on the main process stderr. stderr is the standard channel a program uses to print error messages; each process has its own, and the terminal only shows the one belonging to the process it launched. Setting ASAN_OPTIONS with log_path captures per-process ASAN output to disk. ASAN_OPTIONS is an environment variable, a setting passed to a program when it starts, that configures ASAN's behaviour.

Bash
ASAN_OPTIONS="log_path=/tmp/asan_log:detect_leaks=0" ./out/asan_shell/content_shell --enable-features=WebMachineLearningNeuralNetwork file:///path/to/poc.html

Line by line:

  1. ASAN_OPTIONS="log_path=/tmp/asan_log:detect_leaks=0" sets the environment variable for this one command. log_path=/tmp/asan_log tells ASAN to write its report to a file whose name starts with /tmp/asan_log instead of to the terminal. detect_leaks=0 turns off leak detection, a different ASAN feature that reports memory that was allocated and never freed; it is switched off here to keep the output focused on the crash.
  2. ./out/asan_shell/content_shell runs the browser shell that was just built. The ./ means "in the current directory".
  3. --enable-features=WebMachineLearningNeuralNetwork is a command line switch that turns on the WebNN feature, whose internal flag name is WebMachineLearningNeuralNetwork. Without it, the page's WebNN calls would simply fail.
  4. file:///path/to/poc.html is the address of the test page. file:// means the page is loaded from the local disk rather than from a website. PoC stands for proof of concept: a small, deliberately crafted example that demonstrates the bug.

The GPU process crashes during graph dispatch (inference). A graph here means the network of machine learning operations the page has described; dispatch means Chrome handing that graph to the backend to be executed; inference means actually running the calculations. ASAN output is at /tmp/asan_log.<gpu_pid>, where <gpu_pid> is the numeric process identifier of the GPU process, so each run produces a differently named file.

ASAN output

Text
==3511981==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7cf3f8f74708 at pc 0x60c72c4ed02b bp 0x7be37d4f98a0 sp 0x7be37d4f9060
READ of size 12 at 0x7cf3f8f74708 thread T71 (ThreadPoolForeg)
    #0 __asan_memcpy
    #1 xnn_xx_copy_ukernel__scalar_memcpy  third_party/xnnpack/src/src/xx-copy/xx-copy-scalar-memcpy.c:18:3
    #2 xnn_compute_univector_strided       third_party/xnnpack/src/src/operator-run.c:1733:5
    #3 xnn_run_operator_with_index         third_party/xnnpack/src/src/operator-run.c:2482:9
    #4 xnn_invoke_runtime                  third_party/xnnpack/src/src/runtime.c:1207:38
    #5 SubgraphInvoke                      third_party/tflite/src/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc:1421:25
    #6 tflite::Subgraph::Invoke()          third_party/tflite/src/tensorflow/lite/core/subgraph.cc:1653:17
    #7 DoDispatch                          services/webnn/tflite/graph_impl_tflite.cc:306:41

0x7cf3f8f74708 is located 0 bytes after 200-byte region [0x7cf3f8f74640,0x7cf3f8f74708)
allocated by thread T71 here:
    #0 operator new(unsigned long)
    #1 SubgraphInit  third_party/tflite/src/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc:1230:12

SUMMARY: AddressSanitizer: heap-buffer-overflow third_party/xnnpack/src/src/xx-copy/xx-copy-scalar-memcpy.c:18:3

This is the heart of the evidence. Line by line:

  1. The first line is ASAN announcing an error. heap-buffer-overflow is the class of problem: an access outside a block of memory on the heap. The heap is the general purpose pool of memory a program uses for things it creates while running, as opposed to the stack, which is used for short lived local data. The 0x... values are memory addresses, written in hexadecimal (base 16), which is how programmers usually write addresses. pc, bp and sp are the program counter, base pointer and stack pointer: registers in the processor that record where execution currently is. ==3511981== is the process identifier of the crashing process.
  2. READ of size 12 says the program tried to read 12 bytes in one go. thread T71 (ThreadPoolForeg) says it happened on a worker thread named ThreadPoolForeground, one of several threads the browser uses to do work in parallel. Threads are like separate workers inside one process.
  3. The numbered lines starting with #0 are the call stack: the chain of function calls that led to the fault, with the most recent call at the top. Reading from the bottom up tells the story. #7 DoDispatch in services/webnn/tflite/graph_impl_tflite.cc is Chrome's WebNN code starting to run the graph. #6 tflite::Subgraph::Invoke() is TFLite running one subgraph. #5 SubgraphInvoke in the XNNPack delegate is TFLite handing the work to XNNPack. #4 xnn_invoke_runtime, #3 xnn_run_operator_with_index and #2 xnn_compute_univector_strided are XNNPack's own layers of scheduling. #1 xnn_xx_copy_ukernel__scalar_memcpy is the actual copying routine, and #0 __asan_memcpy is ASAN's instrumented version of the standard memory copy function, which is where the bad read was caught. Each line also gives the file and line number, for example xx-copy-scalar-memcpy.c:18:3 means line 18, column 3.
  4. The next paragraph is ASAN's memory map. 0x7cf3f8f74708 is located 0 bytes after 200-byte region [0x7cf3f8f74640,0x7cf3f8f74708) means the address being read is exactly at the end of a block that is 200 bytes long, starting at the first address in the square brackets and ending at the second. "0 bytes after" means the very first byte past the end. The closing bracket is a round one, a convention meaning the end address itself is not part of the region.
  5. The second stack, under allocated by thread T71 here, shows where that 200-byte block came from: operator new(unsigned long) is the C++ memory allocation function, and SubgraphInit in the XNNPack delegate is the code that asked for it. So the block was created when XNNPack set up the subgraph, and it was too small for what the copy routine later tried to read.
  6. The final SUMMARY line repeats the key facts in one line: the error type and the exact source location.

What this output proves is that the read went one byte past a 200-byte allocation, and that the allocation was made during subgraph setup. It does not by itself say why the sizes disagreed; that comes from reading the code.

Confirming the fix by removing the early return

The researcher reports that removing the early return (described in the root cause below) and rebuilding content_shell eliminates the crash. The report states that removing the early return and rebuilding content_shell eliminates the crash.

Bisection

Bisection is a technique for finding which change introduced a bug. You take a known good version and a known bad version and repeatedly test the midpoint, narrowing the range in half each time, like guessing a number between one and a hundred by always asking "higher or lower". The introducing commit was:

Text
[redacted] (2024-03-13)

Its title was "webnn: Support Pool2d in in //services/webnn/tflite", and the CL was:

Text
https://chromium-review.googlesource.com/c/chromium/src/+/5359192

A commit is one saved change to the source code, identified by a hash. A CL, short for changelist, is the code review entry where that change was proposed and discussed; the URL points at it on chromium-review.googlesource.com, Google's code review site for Chromium. The title says the change added support for Pool2d, the pooling operation, to the TFLite part of WebNN. The doubled word "in in" is in the original title.

The parent commit, meaning the version just before this change, returned "pool2d is not implemented" for pool2d. In other words, before this change, asking WebNN to do pooling simply produced an error message. The introducing commit added SerializePool2d(), a function that translates a WebNN pooling operation into the TFLite equivalent. It reused GetTfLitePaddingMode(), a helper written for Conv2d (convolution, a different operation), without ceil rounding awareness. The Blink IDL already had roundingType: 'ceil' at that point, so the bug was immediately reachable from JavaScript. Blink is Chrome's rendering engine, the part that runs web page code; IDL, interface definition language, is the file that declares which features web pages can call and with what options. Because the option to round up already existed in the web facing interface, any page could ask for it as soon as the pooling code existed.

The report states that simulating both states on the current tree was used: disabling pool2d serialisation produces no crash, and re-enabling it reproduces the heap buffer overflow. "On the current tree" means in the latest source code rather than in the old commit; the researcher switched the feature off and on in the modern code to confirm the same cause.

Root cause

The bug is in GetPool2dTfLitePaddingMode() in graph_builder_tflite.cc (line 354). The report shows this excerpt:

C
base::expected<TfLitePadding, std::string> GetPool2dTfLitePaddingMode(
    const mojom::Padding2d& padding2d, ..., const webnn::Size2d<uint32_t>& output) {
  std::array<uint32_t, 4> explicit_padding = { ... };
  std::array<uint32_t, 4> no_padding = {0, 0, 0, 0};
  if (explicit_padding == no_padding) {
    return TfLitePadding{.mode = ::tflite::Padding_VALID};  // BUG
  }
  // ... ceil rounding handling code (lines 394-412) never reached ...
}

Line by line, in plain words:

  1. The first line declares a function called GetPool2dTfLitePaddingMode. Its return type, base::expected<TfLitePadding, std::string>, means it returns either a padding value or an error message; expected is a C++ type for "one of two things". Its parameters include a padding description (padding2d), some parts elided with ..., and the requested output size (output).
  2. std::array<uint32_t, 4> explicit_padding = { ... }; creates a four element array holding the padding the page asked for on each side. The ... means the report does not show the actual values here.
  3. std::array<uint32_t, 4> no_padding = {0, 0, 0, 0}; creates a four element array of zeros, used for comparison.
  4. if (explicit_padding == no_padding) { checks whether the requested padding is all zeros.
  5. return TfLitePadding{.mode = ::tflite::Padding_VALID}; // BUG is the early return. If the padding is all zeros, the function immediately tells TFLite to use "valid" padding, which means no padding at all. The comment // BUG is the researcher's annotation marking the faulty line.
  6. The last line is a comment noting that the ceil rounding handling code at lines 394 to 412 is never reached in this case.

When explicit padding is [0,0,0,0], the function immediately returns Padding_VALID without checking whether the output dimensions require ceil rounding. This bypasses the ceil rounding handling code at lines 394-412, which would add extra ending padding so that TFLite's floor-based formula produces the correct output size.

The consequence is a shape mismatch between WebNN's validated graph and XNNPACK's internal computation. A shape here means the dimensions of a grid of numbers, for example how many rows and columns. WebNN computes pool output shapes using ceil rounding, but XNNPACK recomputes them using floor division. The concat operator then reads past the smaller actual allocation.

In other words, the early return treats zero explicit padding as equivalent to valid padding, but it skips the adjustment needed when the requested output size implies ceil rounding. The downstream operator (concat) then operates on a buffer sized according to the smaller, floor-based shape, and the copy kernel reads beyond it. A kernel here means a small routine that does the actual work; a buffer is a block of memory holding data.

An everyday comparison: imagine two people packing identical boxes. One rounds the number of items up to the next whole box, the other rounds down. They agree on the label but not on the contents, so when the second person reaches into the box expecting the first person's count, their hand goes past what is actually there.

Impact

The report describes the following impact:

  1. Attack vector: any website, with no user interaction required beyond navigation. An attack vector is the route an attacker uses. Here it is simply a web page: the visitor does not need to click anything, just load the page. WebNN is behind the WebMachineLearningNeuralNetwork feature flag, which the report says is not yet enabled by default but is eligible for VRP according to the program rules. The report also notes that WebNN has been in origin trial since Jan 31, citing https://chromium-review.googlesource.com/c/chromium/src/+/7518276. An origin trial is a scheme where a limited set of real websites can use an unfinished feature early, so the feature is reachable by some real sites even before it is on for everyone.
  2. Process: the GPU process. On Android, the report states this process is unsandboxed. A sandbox is a set of restrictions that limits what a process can do if it is compromised; an unsandboxed process has fewer of those limits, so a bug there is more serious.
  3. Primitive: out of bounds heap read. A primitive, in security writing, is the basic capability a bug gives an attacker, before any further steps.
  4. Consequence: a heap leak in a process shared between different origins. An origin is the combination of scheme, host and port that identifies a website for security purposes; processes shared between origins mean data from one site could in principle end up visible to another. A heap leak means memory contents that should have stayed private are exposed. The report hedges that this may be useful if the heap leak can propagate back to JavaScript, that is, if the leaked bytes can be delivered to page code.

The researcher classified the issue as memory corruption in a non-sandboxed process and confirmed it is related to a crash. Affected platforms, as tested and reasoned by the researcher, are Linux (x86_64) with the TFLite plus XNNPack backend, and, because the bug is in graph_builder_tflite.cc, all platforms using the TFLite backend: Linux, Android (ARM64, x86/x64) and ChromeOS. The report lists the primitive as an out of bounds heap read and the consequence as a heap leak in a process shared between different origins.

The reported Chrome version was 147.0.7681.0 dev. The "dev" channel is the early, less stable build of Chrome used for testing upcoming changes.

Fix

The report does not describe an upstream patch or the exact change that was merged. What it does say is that the early return in GetPool2dTfLitePaddingMode() is the bug, and that removing the early return and rebuilding content_shell eliminates the crash. The report says the early return bypasses the ceil rounding handling at lines 394-412, which would add extra ending padding so that TFLite's floor-based formula produces the correct output size.

Variants to test

These are follow-up experiments to see whether the same kind of mistake exists elsewhere. Each one is a hypothesis, not a confirmed bug.

  1. Other pooling configurations with zero explicit padding and ceil rounding. Build WebNN graphs where avgPool2d or maxPool2d uses roundingType: 'ceil' with zero explicit padding and output dimensions that do not divide evenly. A positive result is an ASAN heap buffer overflow in the XNNPack copy kernel or another XNNPack operator, reached through DoDispatch. In plain words: try the same rounding mismatch with the other pooling operation and with sizes that do not divide neatly.
  2. Other operators reusing Conv2d padding logic. The report notes that SerializePool2d() reused GetTfLitePaddingMode() written for Conv2d. Try other WebNN operators that share padding helpers with Conv2d and support ceil rounding. A positive result is a shape mismatch between the WebNN validated graph and the TFLite/XNNPack recomputation, visible as an out of bounds access or a wrong output shape. In plain words: if one operation borrowed a helper that did not fit, other operations may have borrowed it too.
  3. Concat combined with mismatched shapes. The crash here involved concat reading past a smaller allocation. Try concat with inputs whose shapes are computed through ceil-rounded pooling. A positive result is an out of bounds read in the copy kernel, as in this report. In plain words: the gluing step is where the read went wrong, so vary the shapes being glued.
  4. Different backends and platforms. The report tested Linux x86_64 and reasoned about Android and ChromeOS. Run the same PoC on Android (ARM64, x86/x64) and ChromeOS with the TFLite backend. A positive result is the same ASAN report or a crash in the GPU process. In plain words: check whether the same mistake shows up on phones and Chromebooks.
  5. Feature flag and origin trial reachability. Check whether WebNN is reachable without the WebMachineLearningNeuralNetwork flag in builds where the origin trial is active. A positive result is the crash occurring from a normal web page without enabling the flag manually. In plain words: find out whether ordinary users, not just testers with a switch flipped, can reach the bug.

Each of these should be run with ASAN enabled and with log_path set, because the GPU process output is otherwise not visible on the main process stderr. That last point is practical advice: without the log file setting, the crash report would be written by a process whose output the terminal is not showing, and the tester would see nothing.

Glossary

  • AddressSanitizer (ASAN): a tool built into the compiler that detects out of bounds and other invalid memory accesses at runtime and prints a detailed report.
  • API: an agreed set of functions a program offers so other programs can use its features, like a menu of services.
  • Attack vector: the route by which an attacker reaches a vulnerable piece of software.
  • Backend: the component that actually performs work on behalf of a higher level feature; here, TFLite plus XNNPack doing the maths for WebNN.
  • Bisection: finding the change that introduced a bug by repeatedly testing the midpoint between a known good and a known bad version.
  • Blink: Chrome's rendering engine, the part that runs web page code.
  • Buffer: a block of memory set aside to hold data.
  • Bug bounty program: an arrangement where a company pays outsiders for reporting security problems.
  • Ceil rounding: rounding a number up to the next whole value.
  • Chrome VRP: Google's Vulnerability Reward Program for Chrome.
  • CL (changelist): a proposed code change and its review entry on a code review site.
  • Commit: one saved change to a source code repository, identified by a hash.
  • Commit hash: a long hexadecimal string that uniquely identifies a commit.
  • Concat: an operation that joins two or more grids of numbers end to end.
  • Conv2d: a two dimensional convolution, a common machine learning operation that slides a small filter over a grid.
  • Cookie: a small piece of data a website stores in the browser to remember state between requests.
  • CVSS: a standard scoring system for the severity of a vulnerability.
  • Environment variable: a named setting passed to a program when it starts.
  • Feature flag: an internal switch that turns a feature on or off.
  • Floor rounding: rounding a number down to the previous whole value.
  • GN: the tool Chromium uses to generate its build files.
  • GPU process: a separate Chrome process that handles graphics and other heavy computation.
  • Graph: a network of operations describing a computation, here a machine learning model.
  • Heap: the general purpose pool of memory a program uses for data created while running.
  • Heap buffer overflow: an access outside a block of memory allocated on the heap.
  • Hex / hexadecimal: base 16 notation, used to write memory addresses and hashes.
  • IDL (interface definition language): a file declaring which features web pages can call and with what options.
  • Inference: running a machine learning model to produce a result.
  • Kernel: a small routine that performs the actual computation.
  • Memory corruption: damage to memory contents caused by invalid accesses.
  • Mojom: Chromium's system for defining interfaces between processes.
  • Origin: the combination of scheme, host and port that identifies a website for security purposes.
  • Origin trial: a scheme letting a limited set of real websites use an unfinished feature early.
  • Out of bounds (OOB) read: reading memory outside the intended block.
  • Padding: extra empty space added around the edges of a grid of numbers.
  • Parent commit: the version of the code immediately before a given commit.
  • PoC (proof of concept): a small crafted example that demonstrates a bug.
  • Pooling (avgPool2d, maxPool2d): shrinking a grid by combining small patches, by averaging or by taking the maximum.
  • Primitive: the basic capability a bug gives an attacker.
  • Process: a running instance of a program, with its own memory.
  • Process identifier (PID): the number the operating system uses to identify a running process.
  • Register: a small, fast storage location inside the processor.
  • Revision: one exact snapshot of a source code repository.
  • Sandbox: restrictions that limit what a process can do if it is compromised.
  • Shape: the dimensions of a grid of numbers.
  • Stack (call stack): the chain of function calls currently in progress.
  • stderr: the standard channel a program uses to print error messages.
  • Subgraph: a portion of a TFLite model that is executed as a unit.
  • Symbols: names and line numbers kept in a compiled binary so reports can identify functions.
  • TFLite: TensorFlow Lite, a lightweight machine learning runtime used by Chrome.
  • Thread: a worker inside a process that runs code in parallel with other workers.
  • Token: a piece of data used to prove identity or authorise an action; none appears in this report.
  • WebML: machine learning on the web, the general area this bug is filed under.
  • WebNN: the Web Neural Network API, which lets web pages build and run machine learning graphs in the browser.
  • XNNPack: a low level library of optimised maths routines used by TFLite.

More by Tobias Wienand

View all

1 more disclosed report, 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.