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

Use after free in Fonts (CVE-2026-106373)

A data race in the Windows font fallback cache allows concurrent Web Workers to mutate a shared static cache, leading to a use-after-free of a StringImpl object. An attacker could potentially escalate this to a double-free and arbitrary code execution in the renderer process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 4 months

Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A data race in the Windows-specific font fallback logic allows Web Workers to concurrently mutate a process-wide shared static cache. This can lead to a Use-After-Free (UAF) of a StringImpl object in the BufferPartition. The UAF could potentially be escalated to a double-free and arbitrary code execution in the renderer process.

Affected files:

  • third_party/blink/renderer/platform/fonts/win/font_fallback_win.cc

Estimated timestamp from git blame: Unknown (Google3 checkout)

Root Cause

There is a potential data race in third_party/blink/renderer/platform/fonts/win/font_fallback_win.cc within GetFontFamilyForScript (and similar functions like GetColorEmojiFont).

The function utilizes a DEFINE_THREAD_SAFE_STATIC_LOCAL cache containing std::optional<AtomicString> objects:

C++
  struct AtomicFamilies {
    AtomicFamilies() : families(ScriptToFontMap::kSize) {}
    Vector<std::optional<AtomicString>> families;
  };
  DEFINE_THREAD_SAFE_STATIC_LOCAL(AtomicFamilies, families, ());
  std::optional<AtomicString>& family = families.families[script];
  if (family) {
    return *family;
  }
  // ...
  family.emplace((*script_font_map)[script].FirstAvailableFont(font_manager));
  return *family;

While the static initialization of the AtomicFamilies container is thread-safe, concurrent access to its internal elements is not synchronized. If this function is invoked simultaneously from multiple Web Worker threads (e.g., via OffscreenCanvasRenderingContext2D::fillText requesting fallback fonts), a data race occurs.

Vulnerability Mechanism

  1. Thread A and Thread B concurrently reach the if (family) check for an empty cache slot and bypass it.
  2. Thread A resolves the font, calls family.emplace(...) to store the new AtomicString, and returns a const AtomicString& reference.
  3. The reference bubbles up to GetFallbackFamilyNameFromHardcodedChoices (in font_cache_skia_win.cc), where it is copied: const AtomicString fallback_family = GetFallbackFamily(...). This copy requires reading the StringImpl* and calling AddRef().
  4. The Race: Concurrently, Thread B executes its own family.emplace(...). In C++, std::optional::emplace destroys the existing object before constructing the new one. This calls the destructor for Thread A's AtomicString, decrementing the StringImpl refcount to 0 and freeing it via operator delete.
  5. Thread A resumes its copy operation and executes AddRef() on the dangling StringImpl* pointer, resulting in a Use-After-Free (UAF).

Exploitation Path

Because scoped_refptr utilizes RAW_PTR_EXCLUSION, this UAF is not mitigated by MiraclePtr. The StringImpl is allocated within the WTF::BufferPartition.

An attacker could potentially exploit this by:

  1. Spawning multiple Web Workers to trigger the race condition reliably.
  2. Concurrently spraying the BufferPartition using JS APIs (e.g., fetch() with raw strings to create EncodedFormData vectors, or TextEncoder.encode) to overlap the freed StringImpl memory with an attacker-controlled buffer.
  3. Spoofing the ref_count_ field (offset 0) inside the sprayed buffer so that Thread A's delayed AddRef() increments it.
  4. When Thread A finishes using the copied string, it calls Release(), dropping the spoofed ref_count_ to 0. This triggers a second call to operator delete on the memory address.
  5. This results in a double-free of the attacker's sprayed buffer within the BufferPartition, a primitive that can typically be escalated to arbitrary read/write and Remote Code Execution (RCE) in the renderer process.

(Note: These are potential steps based on code analysis; our tooling agent does not run code to provide a working PoC.)

Suggested Fix

Cross-thread access to AtomicString instances is inherently unsafe as they rely on thread-local AtomicStringTable operations and unprotected refcounts. The code acknowledges this in a comment: // Try the AtomicString cache first. AtomicString must be per thread... but fails to enforce it.

The shared caches (families, emoji_font, math_font) should either:

  1. Be protected by a base::Lock to serialize access and avoid races during emplace, and avoid returning raw AtomicString references that can be copied without synchronization.
  2. Be migrated to use WTF::ThreadSpecific so that each Web Worker thread maintains its own independent cache, eliminating the cross-thread access entirely.

Evaluated with Chrome root at commit: 65b3256311f3ab6fb9870eaa522de7e6dd2663bb


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

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

The shared static cache of AtomicString objects is not synchronised across threads, so concurrent emplace calls can destroy an object while another thread is copying it.

Impact

The UAF could potentially be escalated to a double-free and arbitrary code execution in the renderer process, though the report notes these are potential steps based on code analysis and no working PoC was run.

What the attacker needed

Windows platform; Ability to run multiple Web Workers; Race condition triggered reliably

The fix

The shared caches should be protected by a lock or migrated to thread-specific storage so each worker has its own cache.

How it was found

  1. Spawn multiple Web Workers that request fallback fonts, for example via [redacted]::fillText.
  2. Two threads reach the empty cache check and both proceed to emplace a new AtomicString.
  3. One thread's emplace destroys the other thread's AtomicString, freeing the underlying StringImpl.
  4. The first thread then copies the dangling reference, calling AddRef on freed memory.
  5. Spray the BufferPartition with attacker-controlled strings to overlap the freed StringImpl.
  6. Spoof the refcount so that a later Release triggers a second free, yielding a double-free primitive.

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 use-after-free is a bug where a program keeps using memory after it has been freed, which can let an attacker control what happens next. Here, two Web Workers (background scripts in a browser) race to update a shared font cache, and one frees a string while the other is still copying it. The report suggests this could be turned into a double-free and possibly code execution, but no working exploit was demonstrated.

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.