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

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

The WebNN service-side code dropped the outputPadding and outputSizes adjustment fields when rebuilding a convTranspose2d operation, so the TFLite backend misclassified the padding mode as SAME and recomputed geometry assuming zero adjustment. This caused a heap-buffer-overflow read of the temporary col_data buffer during dispatch.

Syn4pse Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 25 days

Summary

WebNN convTranspose2d with outputPadding or outputSizes causes a heap-buffer-overflow in TFLite’s TransposeConvV2. The service-side ConvertToConvTranspose2dAttributes drops the adjustment fields and keeps only the final output shape, so GetTfLitePaddingMode misclassifies the operation as kTfLitePaddingSame. TFLite then recomputes padding assuming zero adjustment, producing a geometry mismatch that overreads the temporary col_data buffer during dispatch().

Details

The bug is a semantic truncation across the Blink -> service boundary that cascades into a OOB read.

First, the Blink layer correctly preserves the transpose-conv adjustment geometry. ConvertToConvTranspose2dAttributes captures both outputPadding and outputSizes:

C++
const auto output_padding = options->getOutputPaddingOr({0, 0});
attributes.value().output_padding = webnn::Size2d<uint32_t>{
    .height = output_padding[0], .width = output_padding[1]};

if (options->hasOutputSizes()) {
  auto output_sizes = options->getOutputSizesOr({});
  attributes.value().output_sizes = webnn::Size2d<uint32_t>{
      .height = output_sizes[0], .width = output_sizes[1]};
}

However, the service-side reconstruction discards this information. The Mojo Conv2d type does not carry outputPadding or outputSizes. The service-side ConvertToConvTranspose2dAttributes reconstructs only the final output dimensions from the operand descriptor, losing the reason the output differs from canonical SAME geometry:

C++
auto* output = GetMojoOperand(operands, conv2d.output_operand_id);
CHECK_EQ(output->descriptor.Rank(), 4u);
webnn::Size2d<uint32_t> output_sizes;
switch (context_properties.input_operand_layout) {
  case webnn::InputOperandLayout::kNhwc:
    output_sizes.height = output->descriptor.shape()[1];
    output_sizes.width = output->descriptor.shape()[2];
    component_attributes.filter_layout =
        ConvTranspose2dFilterOperandLayout::kOhwi;
    break;
  ...
}
component_attributes.output_sizes = std::move(output_sizes);

Consequently, the TFLite backend misclassifies the padding mode. Without the adjustment fields, it cannot distinguish canonical SAME from adjusted SAME. GetTfLitePaddingMode selects kTfLitePaddingSame based solely on the explicit padding tuple, and SerializeConv2d lowers the operation with that mode plus the (adjusted) output-shape tensor:

C++
if (explicit_padding == upper_padding) {
  return TfLitePadding{.mode = ::tflite::Padding_SAME};
}
...
op_inputs = {output_shape_tensor_index, filter_tensor_info.index,
             explicit_pad_index.value_or(input_tensor_info.index), bias_index};
operator_kind = ::tflite::BuiltinOperator_TRANSPOSE_CONV;
builtin_options = ::tflite::CreateTransposeConvOptions(
                      builder_, padding_mode.mode, conv2d.strides->width,
                      conv2d.strides->height, activation_type)
                      .Union();

At runtime, this mismatch causes a heap-buffer-overflow. EvalFloat delegates to TransposeConvV2, which recomputes SAME padding from the output dimensions assuming zero adjustment. Its Col2im loop traverses col_data using the recomputed geometry:

C++
for (int h = 0; h < height_col; ++h) {
  int w_pad = -pad_l;
  for (int w = 0; w < width_col; ++w) {
    T* im_patch_data = im_data + (h_pad * width + w_pad) * depth;
    for (int ih = h_pad; ih < h_pad + filter_h; ++ih) {
      for (int iw = w_pad; iw < w_pad + filter_w; ++iw) {
        if (ih >= 0 && ih < height && iw >= 0 && iw < width) {
          for (int i = 0; i < depth; ++i) {
            im_patch_data[i] += col_data[i];
          }
        }
        im_patch_data += depth;
        col_data += depth;
      }

For example, with padding [0,1,0,1], stride=[2,2], filter=[1,3,3,1], and an adjusted output like 7x7 / 7x6 / 6x7, Chromium tells TFLite to use SAME but passes a non-canonical output extent. The Col2im traversal runs past the 340-byte temporary buffer, producing a heap-buffer-overflow.

Bisection

This issue is introduced by the commit https://chromium-review.googlesource.com/c/chromium/src/+/5635194

Reproduction

Run chrome from https://storage.googleapis.com/chromium-browser-asan/linux-release/asan-linux-release-1598914.zip with the following command:

./chrome --enable-features=ExperimentalWebMachineLearningNeuralNetwork,WebMachineLearningNeuralNetwork --no-sandbox poc.html

You would observe the OOB shown in asan.txt

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the Mojo Conv2d message type did not carry outputPadding or outputSizes, so the service reconstructed only the final output dimensions and lost the information needed to distinguish canonical SAME padding from adjusted SAME padding.

Impact

An attacker could trigger a heap-buffer-overflow read in the renderer's WebNN/TFLite path, which under ASan is a crash and in a release build may leak or corrupt adjacent heap memory.

What the attacker needed

Chrome with WebNN experimental features; Attacker-supplied HTML page; Sandbox disabled in the PoC

How it was found

  1. Launch the ASan build of Chrome with the experimental WebNN features enabled and sandbox disabled.
  2. Load the proof-of-concept HTML page.
  3. Observe the out-of-bounds access reported in the ASan output.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A neural-network operation called convTranspose2d lets the caller adjust the final output size. The browser's front-end kept that adjustment, but the back-end service threw it away and only kept the final shape. When the maths library later recalculated padding, it assumed no adjustment, so its loop walked past the end of a temporary buffer and read memory it should not have.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Syn4pse

View all

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