Overview

High
Severity
CVSS
No
Exploited ITW
Fixed
Fix Status
ImpactOut of bounds write in Fonts
DescriptionOut of bounds write in Fonts
ComponentFonts
Bug ClassOOB
Tracker503425922
Fix commit71a1e763a70a (chromium/src) +2/-2
CISA KEVNot listed
CreditedMatej Smycka
Disclosed2026-05-12

Files Changed

  • DEPS
  • third_party/harfbuzz/src
From 71a1e763a70a51e868e52b61c4906fa113d19e40 Mon Sep 17 00:00:00 2001
From: Dominik Röttsches <drott@chromium.org>
Date: Fri, 08 May 2026 13:00:46 -0700
Subject: [PATCH] [merge] Cherry-pick apply_stch() fix

Cherry-pick upstream fix for issue below:
https://github.com/harfbuzz/harfbuzz/pull/5929

Merging by pulling in chromium/m148 branch of HarfBuzz
which I prepared earlier.

https://chromium-review.googlesource.com/q/project:external/github.com/harfbuzz/harfbuzz+branch:chromium/m148

Bug: 503425922
Fixed: 509414656
Change-Id: I2987b5f1d4f2ba3d559c58b84fa3a3f68beae9ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7810458
Reviewed-by: Daniil Sakhapov <sakhapov@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/branch-heads/7778@{#2552}
Cr-Branched-From: 77f495ee216d4c3cc784d33658bad4778c0680ee-refs/heads/main@{#1610480}
---

diff --git a/DEPS b/DEPS
index e6e0bc68..8b5babd 100644
--- a/DEPS
+++ b/DEPS
@@ -363,7 +363,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling HarfBuzz
   # and whatever else without interference from each other.
-  'harfbuzz_revision': '4fc96139259ebc35f40118e0382ac8037d928e5c',
+  'harfbuzz_revision': 'f027b8e9039f73bf803eae684fee2eb2d30e4180',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Emoji Segmenter
   # and whatever else without interference from each other.
diff --git a/third_party/harfbuzz/src b/third_party/harfbuzz/src
index 4fc9613..f027b8e 160000
--- a/third_party/harfbuzz/src
+++ b/third_party/harfbuzz/src
@@ -1 +1 @@
-Subproject commit 4fc96139259ebc35f40118e0382ac8037d928e5c
+Subproject commit f027b8e9039f73bf803eae684fee2eb2d30e4180
Loading diff…

Original Bug Report

reported by ma...@gmail.com

apply_stch uint32 accumulation OOB write (Chromium renderer SEGV)


Report description

apply_stch uint32 accumulation OOB write (Chromium renderer SEGV)


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://chromium.googlesource.com/chromium/src/third_party/+/refs/heads/main


The problem

Please describe the technical details of the vulnerability

Summary

In HarfBuzz apply_stch (src/hb-ot-shaper-arabic.cc), the MEASURE pass accumulates extra_glyphs_needed (uint32) across multiple STCH groups in one buffer. The overflow-detected break exits only the inner per-group loop; the outer step loop continues to CUT, which walks all groups and writes the full (non-wrapped) number of entries into a buffer sized by the partial pre-overflow value. Result: heap OOB write.

Chromium is reachable because Blink feeds an entire Arabic script run to hb_shape() with no fragment cap (Firefox has MAX_SHAPING_LENGTH=32760).

Repro

Artifacts (this directory):

  • stch_of3.ttf – 844 B crafted font; stchbeh → [tile_f, tile_r]
  • poc.html@font-face loads the font, lays out 16,909,322 × BEH ALEF pairs in one RTL run.

Serve and point an ASan Chromium at the page:

python3 -m http.server 8899 &
ASAN_OPTIONS="log_path=/tmp/asan.log:handle_segv=1:allow_user_segv_handler=0:detect_leaks=0:symbolize=1" \
  ~/asan/asan-chromium/content_shell --no-sandbox --disable-hang-monitor \
  http://127.0.0.1:8899/poc.html

# takes 10-60s

Renderer SEGVs after page load; ASan log at /tmp/asan.log.<pid>.

Root cause

src/hb-ot-shaper-arabic.cc MEASURE block (pre-fix):

if (unlikely (hb_unsigned_mul_overflows (n_copies, n_repeating, &added_glyphs) ||
              hb_unsigned_add_overflows (extra_glyphs_needed, added_glyphs,
                                         &extra_glyphs_needed)))
  break;            // exits inner loop only

After the break, the outer if (step == MEASURE) { buffer->ensure (…); } uses the partial extra_glyphs_needed → small allocation → CUT OOB.

Credit

Matej Smycka

Impact analysis

Any website the victim visits can trigger this bug by serving a crafted font and some Arabic text. It reliably crashes the renderer tab on 64bit as the write lands far outside the process memory. 32bit would land into the process. The 64bit is unlikely to be exploited as controlled write, however it may be possible.


The cause

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

148.0.7750.0 [ASan content_shell, Linux x86_64]

No, it is not related to a crash.

Choose the type of vulnerability

Memory Corruption (in a sandboxed process)

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

Matej Smycka

View on issue tracker