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

Out of bounds read in Fonts (CVE-2026-7904)

An out-of-bounds read in Chromium's text rendering occurs when a custom web font uses multiple substitution to map one character to several glyphs, causing a cluster position to be advanced per glyph instead of per cluster. This can lead to reading adjacent heap memory, potentially disclosing information from web content.

c6eed09fc8b174b0f3eebedcceb1e792 Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 54 days

OOB read in ShapeResultView::ForEachGraphemeClusters via multi-glyph cluster skip logic

Summary

An out-of-bounds read in the Chromium renderer can be triggered from JavaScript on all platforms. The function ShapeResultView::ForEachGraphemeClusters advances the cluster_start position once per glyph instead of once per cluster when skipping glyphs outside the drawing range. When a custom web font uses OpenType GSUB Multiple Substitution to map a single character to multiple glyphs, the skip loop over-advances cluster_start past the actual character boundary. This corrupted position is then used to construct a StringView that extends beyond the underlying text buffer. The subsequent NumGraphemeClusters call iterates over this out-of-bounds view, reading adjacent heap memory. In release builds, SECURITY_DCHECK is a no-op and the OOB read proceeds silently, making this exploitable as an information disclosure primitive from web content.

Bisect

Introducing Commit: 2ef8b65de690c3a2d83bd6b991763359a7c1f3d6

The bug was introduced in the original ShapeResult::ForEachGraphemeClusters API and then copied into ShapeResultView::ForEachGraphemeClusters in commit a365a8203ccd7 (2018-10-31). Both copies contain the same flaw.

Root Cause

ShapeResultView::ForEachGraphemeClusters iterates over glyphs and maintains a cluster_start variable to track the character offset of the current cluster. When a glyph falls outside the [from, to) drawing range, the function skips it and adjusts cluster_start:

C++
// shape_result_view.cc — skip path for out-of-range glyphs
if ((rtl && current_character_index >= to) ||
    (!rtl && current_character_index < from)) {
  advance_so_far += glyph_data.advance.ToFloat();
  rtl ? --cluster_start : ++cluster_start;  // BUG: per-glyph, not per-cluster
  continue;
}

The increment/decrement is executed once for each glyph in the skip region. This is correct when every character produces exactly one glyph, but incorrect for multi-glyph clusters. With GSUB Multiple Substitution (lookup type 2), a single input character can produce an arbitrary number of output glyphs, all sharing the same character_index. In that case, the skip loop runs N times for N glyphs, advancing cluster_start by N when it should advance by 1.

After the skip loop, when the function encounters the first in-range cluster, it computes cluster_end from the next character boundary and constructs a StringView to count grapheme clusters:

C++
// shape_result_view.cc — StringView construction with corrupted cluster_start
graphemes_in_cluster = NumGraphemeClusters(
    cluster_end >= cluster_start
        ? StringView(text, cluster_start, cluster_end - cluster_start)
        : StringView(text, cluster_end, cluster_start - cluster_end));

With cluster_start over-advanced, the arguments to StringView produce a view that starts at or beyond the end of the text buffer. The StringView range constructor guards this with SECURITY_DCHECK:

C++
// string_view.h — the only protection
SECURITY_DCHECK(offset <= view.length());
SECURITY_DCHECK(length <= view.length() - offset);

SECURITY_DCHECK is compiled to a fatal check only when ADDRESS_SANITIZER is defined or DCHECK_IS_ON() is true. In production release builds, both conditions are false and the macro expands to ((void)0), so the out-of-bounds StringView is silently created. NumGraphemeClusters then creates an ICU CharacterBreakIterator over this view, iterating past the text buffer and reading heap memory that follows the StringImpl allocation.

A concrete trigger uses a two-character 16-bit string "\u0100B" with a web font whose ccmp feature decomposes U+0100 into three glyphs. When the Selection API selects only the second character (range [1,2)), PaintSelectedText calls ForEachGraphemeClusters with from=1, to=2. The skip loop runs three times for the three glyphs of U+0100, pushing cluster_start from 0 to 3. When processing the glyph for 'B', cluster_end is 2, and the function constructs StringView(text, 2, 1) on a text of length 2, which is one code unit past the end.

The same bug also exists in ShapeResult::ForEachGraphemeClusters in shape_result.cc.

Reproduce

Tested on commit d0f83d769eeed (macOS arm64).

Build:

autoninja -C ~/chromium/src/out/asan-release chrome

Run:

ASAN_OPTIONS=detect_odr_violation=0 ~/chromium/src/out/asan-release/Chromium.app/Contents/MacOS/Chromium \
  --no-sandbox --disable-gpu \
  --user-data-dir=/tmp/poc-$(date +%s) \
  issue_find021/poc.html

The renderer process crashes immediately on paint. No user interaction required.

[26598:93931928:0313/193828.315734:FATAL:third_party/blink/renderer/platform/wtf/text/string_view.h:401] Security DCHECK failed: length <= view.length() - offset.
0   libbase.dylib                       0x0000000102eacd88 base::debug::CollectStackTrace(base::span<void const*, 18446744073709551615ul, void const**>) + 28
1   libbase.dylib                       0x0000000102e62580 base::debug::StackTrace::StackTrace() + 80
2   libbase.dylib                       0x0000000102b40e3c logging::LogMessage::Flush() + 652
3   libbase.dylib                       0x0000000102b42aac logging::LogMessageFatal::~LogMessageFatal() + 12
4   libbase.dylib                       0x0000000102b42ad0 logging::LogMessageFatal::~LogMessageFatal() + 0
5   libblink_platform.dylib             0x000000014a6edbcc blink::ShapeResultView::ForEachGraphemeClusters(blink::StringView const&, float, unsigned int, unsigned int, unsigned int, void (*)(void*, unsigned int, float, unsigned int, float, blink::CanvasRotationInVertical), void*) const + 3756
6   libblink_platform.dylib             0x000000014a6d665c blink::ShapeResultBloberizer::FillTextEmphasisGlyphsNG::FillTextEmphasisGlyphsNG(blink::FontDescription const&, blink::StringView const&, unsigned int, unsigned int, blink::ShapeResultView const*, blink::GlyphData const&) + 1600
7   libblink_platform.dylib             0x000000014a5c494c blink::Font::DrawEmphasisMarks(cc::PaintCanvas*, blink::TextFragmentPaintInfo const&, blink::AtomicString const&, gfx::PointF const&, cc::PaintFlags const&) const + 560
8   libblink_platform.dylib             0x000000014a99f380 blink::GraphicsContext::DrawEmphasisMarks(blink::Font const&, blink::TextFragmentPaintInfo const&, blink::AtomicString const&, gfx::PointF const&, blink::AutoDarkMode const&) + 420
9   libblink_core.dylib                 0x00000001522f06c0 blink::TextPainter::Paint(blink::TextFragmentPaintInfo const&, blink::TextPaintStyle const&, int, blink::AutoDarkMode const&, blink::TextPainter::ShadowMode) + 2016
10  libblink_core.dylib                 0x00000001522f1afc blink::TextPainter::PaintSelectedText(blink::TextFragmentPaintInfo const&, unsigned int, unsigned int, blink::TextPaintStyle const&, blink::TextPaintStyle const&, blink::LineRelativeRect const&, int, blink::AutoDarkMode const&) + 1512
11  libblink_core.dylib                 0x0000000152116c10 blink::BoxFragmentPainter::PaintTextItem(blink::InlineCursor const&, blink::PaintInfo const&, blink::PhysicalFixedOffset<blink::FixedPoint<6u, int>> const&, blink::PhysicalFixedOffset<blink::FixedPoint<6u, int>> const&) + 916

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.

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 skip loop in ShapeResultView::ForEachGraphemeClusters advances cluster_start once per glyph instead of once per cluster when skipping glyphs outside the drawing range, which is incorrect for multi-glyph clusters produced by GSUB Multiple Substitution.

Impact

In release builds, the out-of-bounds read proceeds silently, making this exploitable as an information disclosure primitive from web content.

What the attacker needed

Victim visits a malicious page; page uses a custom web font; font uses GSUB Multiple Substitution

How it was found

  1. Create a web font that uses OpenType GSUB Multiple Substitution to map a single character to multiple glyphs.
  2. Use a two-character string where the first character is decomposed into multiple glyphs by the font.
  3. Select only the second character using the Selection API.
  4. Trigger painting of the selected text, which calls ForEachGraphemeClusters with a range that skips the first character's glyphs.
  5. The skip loop over-advances cluster_start, leading to an out-of-bounds StringView and a crash under ASAN.

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.

When a web page uses a special font, the browser sometimes draws one character using several glyphs (shapes). A bug in how the browser counts characters during text selection can make it look past the end of the text, reading nearby memory. This could let a malicious page see data it should not.

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