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.ccthird_party/blink/renderer/platform/fonts/shaping/shape_result_view.ccthird_party/blink/renderer/platform/fonts/shaping/shape_result.ccthird_party/blink/renderer/platform/fonts/shaping/glyph_data.hthird_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
-
Non-Monotonic Cluster Indices: In
third_party/blink/renderer/platform/fonts/shaping/shape_result.cc,ShapeResultRun::LimitNumGlyphsprocesses glyphs returned by HarfBuzz. It usesstd::upper_boundon the cluster indices, which assumes they are monotonically increasing. A maliciously crafted font can violate this assumption, resulting in a selected range where aglyph.clusteris less than thestart_clusterof the run. -
Integer Underflow: In
ShapeResult::ComputeGlyphPositions, the relative character index is calculated asconst uint16_t character_index = glyph.cluster - start_cluster;. Becauseglyph.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 theHarfBuzzRunGlyphDatabitfield. -
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 >= tofor LTR text. Since our corrupted index is a large positive number, it passes this check. -
8-bit Fast Path Bypass: For 8-bit (Latin-1) text,
ForEachGraphemeClusterstakes a fast path that skips safeStringViewbounds checking (which relies onbase::span). Instead, it directly invokes theAddEmphasisMarkToBloberizercallback with the out-of-bounds index. -
OOB Read via SECURITY_DCHECK: The callback accesses the string using
text[character_index].StringView::operator[](string_view.h) relies onSECURITY_DCHECK(i < length()). In standard release builds,SECURITY_DCHECKis a no-op, leading to a raw pointer dereference inside anUNSAFE_BUFFERSblock that reads out-of-bounds PartitionAlloc heap memory. -
Information Oracle: The OOB byte is passed to
Character::CanReceiveTextEmphasis, which returnsfalsefor ~67 specific byte values (like control characters) andtruefor others. Iftrue, 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.
- 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.
- Trigger Text-Emphasis: Apply the font to a short Latin-1 text node and set the CSS property
text-emphasis-style: dot. - Heap Grooming: Groom the PartitionAlloc heap to place sensitive target data (e.g., pointers) immediately following the text string buffer.
- Observe the Oracle: Force a layout/paint. Use the Canvas 2D API (
getImageData) orgetBoundingClientRect()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
- 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; } - Harden StringView: Upgrade the
SECURITY_DCHECKinStringView::operator[]to aCHECKorSECURITY_CHECKto ensure bounds are strictly enforced in release builds. - Validate Monotonicity: Add robust checks in
LimitNumGlyphsto 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.
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
- Load a crafted font that returns out-of-order cluster indices.
- Apply the font to short Latin-1 text and set text-emphasis-style: dot.
- Groom the heap to place sensitive data after the text buffer.
- 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.