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

Out of bounds memory access in Layout (CVE-2026-13873)

A crafted font can cause out-of-bounds heap reads in Blink's text-emphasis rendering, leaking 1 bit of information per read via a visual oracle. This could aid in ASLR bypass.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 months

Project Fortify, an experimental security project, has identified the following potential security issue.

Overview: A potential 1-bit heap information leak exists in the Blink renderer's text-emphasis rendering path. By providing a crafted font that produces out-of-range HarfBuzz cluster indices, an attacker can bypass asymmetric bounds checks and read adjacent heap memory. This out-of-bounds read acts as an oracle to classify renderer heap contents, aiding in ASLR bypass.

Affected files:

  • third_party/blink/renderer/platform/fonts/shaping/shape_result_bloberizer.cc
  • third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc
  • third_party/blink/renderer/platform/fonts/shaping/shape_result.cc
  • third_party/blink/renderer/platform/fonts/shaping/glyph_data.h
  • third_party/blink/renderer/platform/wtf/text/string_view.h

Estimated timestamp from git blame: 2026-03-18

Summary

An out-of-bounds (OOB) heap read vulnerability potentially exists in the Blink renderer when painting CSS text-emphasis marks. The issue stems from a combination of improper handling of non-monotonic font cluster indices, an integer underflow, an asymmetric bounds check, and the reliance on SECURITY_DCHECK in release builds. This allows an attacker to read up to ~32KB past an 8-bit string buffer on the PartitionAlloc heap and leak information via a 1-bit visual oracle.

Vulnerability Details

  1. Non-Monotonic Cluster Indices: In third_party/blink/renderer/platform/fonts/shaping/shape_result.cc, ShapeResultRun::LimitNumGlyphs processes glyphs returned by HarfBuzz. It uses std::upper_bound on the cluster indices, which assumes they are monotonically increasing. A maliciously crafted font can violate this assumption, resulting in a selected range where a glyph.cluster is less than the start_cluster of the run.

  2. Integer Underflow: In ShapeResult::ComputeGlyphPositions, the relative character index is calculated as const uint16_t character_index = glyph.cluster - start_cluster;. Because glyph.cluster < start_cluster, this underflows, creating a large positive index (up to 32,767). DCHECKs designed to catch this compile out in release builds, allowing the corrupt index to be stored in the HarfBuzzRunGlyphData bitfield.

  3. Asymmetric Bounds Check: During painting, ShapeResultView::ForEachGraphemeClusters (shape_result_view.cc) iterates over the glyphs. For Left-to-Right (LTR) text, it employs an asymmetric bounds check:

    C++
    if ((rtl && current_character_index >= to) ||
        (!rtl && current_character_index < from)) {
        continue;
    }
    

    It fails to check if current_character_index >= to for LTR text. Since our corrupted index is a large positive number, it passes this check.

  4. 8-bit Fast Path Bypass: For 8-bit (Latin-1) text, ForEachGraphemeClusters takes a fast path that skips safe StringView bounds checking (which relies on base::span). Instead, it directly invokes the AddEmphasisMarkToBloberizer callback with the out-of-bounds index.

  5. OOB Read via SECURITY_DCHECK: The callback accesses the string using text[character_index]. StringView::operator[] (string_view.h) relies on SECURITY_DCHECK(i < length()). In standard release builds, SECURITY_DCHECK is a no-op, leading to a raw pointer dereference inside an UNSAFE_BUFFERS block that reads out-of-bounds PartitionAlloc heap memory.

  6. Information Oracle: The OOB byte is passed to Character::CanReceiveTextEmphasis, which returns false for ~67 specific byte values (like control characters) and true for others. If true, an emphasis mark is painted. This creates a 1-bit visual oracle.

Suggested Attacker Steps

Note: These are potential steps based on code analysis; our tooling agent does not currently have the capability to run a live Proof of Concept.

  1. Load a Crafted Font: The attacker embeds a malicious web font (e.g., WOFF2) designed to return out-of-order HarfBuzz cluster indices during shaping.
  2. Trigger Text-Emphasis: Apply the font to a short Latin-1 text node and set the CSS property text-emphasis-style: dot.
  3. Heap Grooming: Groom the PartitionAlloc heap to place sensitive target data (e.g., pointers) immediately following the text string buffer.
  4. Observe the Oracle: Force a layout/paint. Use the Canvas 2D API (getImageData) or getBoundingClientRect() to detect if an emphasis mark was rendered for the anomalous glyph. This reveals 1 bit of information about the OOB byte, which can be repeated to bypass ASLR.

Suggested Fix

  1. Fix Asymmetric Bounds Check: In ShapeResultView::ForEachGraphemeClusters, ensure both lower and upper bounds are checked regardless of text direction:
    C++
    if (current_character_index < from || current_character_index >= to) { continue; }
    
  2. Harden StringView: Upgrade the SECURITY_DCHECK in StringView::operator[] to a CHECK or SECURITY_CHECK to ensure bounds are strictly enforced in release builds.
  3. Validate Monotonicity: Add robust checks in LimitNumGlyphs to handle or reject fonts that produce non-monotonic cluster indices safely.

Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33


Results from so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

The original report as published on the Chromium issue tracker. 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 a missing upper-bound check for left-to-right text combined with an integer underflow from non-monotonic font cluster indices, and a debug-only bounds check that is disabled in release builds.

Impact

An attacker could read out-of-bounds heap memory and use a 1-bit visual oracle to leak information, potentially aiding in ASLR bypass.

What the attacker needed

Victim loads a crafted font; text-emphasis-style is set; heap grooming

The fix

The asymmetric bounds check should be corrected to check both lower and upper bounds, StringView bounds checks should be enforced in release builds, and font cluster monotonicity should be validated.

How it was found

  1. Load a crafted font that returns out-of-order cluster indices.
  2. Apply the font to short Latin-1 text and set text-emphasis-style: dot.
  3. Groom the heap to place sensitive data after the text buffer.
  4. Force layout/paint and detect if an emphasis mark was rendered.

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 web browser uses fonts to draw text. A malicious font can trick the browser into reading memory it shouldn't, and the browser then draws a tiny mark depending on what it read. By checking for that mark, an attacker can learn a little about the memory layout, which helps defeat a security defence called ASLR.

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