Use after free in Base (CVE-2026-9883)
A process-global ICU number formatter is mutated without synchronisation, so concurrent calls from the UI thread and a background printer-capability thread can free internal formatting objects while another thread is using them. This could lead to a use-after-free in the unsandboxed browser process, potentially enabling remote code execution.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 33 days
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 without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: base::FormatDouble mutates a process-global ICU NumberFormat singleton without synchronization. Concurrent calls from different threads, such as during background printer capability fetching and UI updates, can cause ICU to free internal formatting objects while they are in use, leading to a potential Use-After-Free in the unsandboxed browser process.
Affected files:
base/i18n/number_formatting.ccchrome/common/printing/print_media_l10n.ccchrome/browser/ui/webui/print_preview/local_printer_handler_default.cc
Estimated timestamp from git blame: 2023-05-15
Summary
A potential Use-After-Free (UAF) vulnerability exists in the browser process due to a data race in base::FormatDouble. The function uses a process-global ICU NumberFormat instance wrapped in a LazyInstance, which it mutates without synchronization. Concurrent calls from the UI thread and background worker threads can lead to ICU freeing internal formatting objects while they are still being accessed, resulting in memory corruption.
Root Cause Analysis
In base/i18n/number_formatting.cc:69, base::FormatDouble accesses a global icu::NumberFormat instance:
LazyInstance<NumberFormatWrapper>::DestructorAtExit g_number_format_float =
LAZY_INSTANCE_INITIALIZER;
std::u16string FormatDouble(double number, int min_fractional_digits, int max_fractional_digits) {
icu::NumberFormat* number_format = g_number_format_float.Get().number_format.get();
// ...
number_format->setMaximumFractionDigits(max_fractional_digits);
// ...
number_format->format(number, ustr);
The LazyInstance ensures thread-safe initialization, but subsequent accesses to the underlying object are entirely unsynchronized.
When setMaximumFractionDigits is called with a new value, ICU's DecimalFormat implementation reconstructs its internal formatter (third_party/icu/source/i18n/decimfmt.cpp:1631). This invokes a move assignment (LocalizedNumberFormatter::operator=(LNF&& src)) which ultimately executes delete fCompiled; (third_party/icu/source/i18n/number_fluent.cpp:504). fCompiled is a heap-allocated NumberFormatterImpl object.
If Thread A changes the fraction digits (triggering delete fCompiled) while Thread B is concurrently executing number_format->format(), Thread B will dereference the deleted fCompiled object (third_party/icu/source/i18n/number_fluent.cpp:653). This leads to a virtual method call on the freed fMicroPropsGenerator (third_party/icu/source/i18n/number_formatimpl.cpp:78), resulting in an exploitable UAF. Because these pointers reside within the ICU library as raw C++ pointers, they are not protected by MiraclePtr (BackupRefPtr).
Reachability and Impact
This vulnerability is reachable when Out-of-Process (OOP) printing is disabled, forcing printer capability enumeration to occur in the browser process. This can happen on macOS or Linux if the enterprise policy OopPrintDriversAllowed is false, or if the EnableOopPrintDrivers feature flag is disabled.
When a user opens Print Preview, LocalPrinterHandlerDefault::StartGetCapability dispatches a task to a background base::ThreadPool worker. This worker ultimately calls base::FormatDouble through InfoForUnregisteredSize (chrome/common/printing/print_media_l10n.cc:773) to localize custom paper sizes.
Simultaneously, the UI thread frequently calls base::FormatDouble (often via ui::FormatBytes) for components like the Task Manager, Tab Hover Cards, and active Downloads.
Because the race condition occurs in the unsandboxed browser process, exploitation could lead to Remote Code Execution (RCE) and full system compromise.
Suggested Steps to Trigger
Note: These are potential steps as a full working proof-of-concept has not been developed.
- Use a macOS or Linux system configured with the
OopPrintDriversAllowedenterprise policy set tofalse. - Open the Chrome Task Manager and start a large file download. This ensures a steady stream of
base::FormatDoublecalls on the UI thread. - Open the Print Preview dialog (Cmd+P / Ctrl+P). This triggers capability enumeration on a background worker thread, which will also call
base::FormatDoubleif unregistered paper sizes are encountered. - The concurrent execution of
base::FormatDoubleacross the UI and worker threads triggers the data race, potentially leading to a crash or UAF.
Suggested Fix
To resolve this issue, the shared ICU formatter should not be mutated concurrently. Potential solutions include:
- Thread-Local Storage: Replace the global
LazyInstancewith abase::ThreadLocalOwnedPointerto ensure each thread has its own dedicated ICU formatter instance. - Synchronization: Protect the accesses to
g_number_format_floatwith abase::Lock, though this may introduce performance bottlenecks given the frequency of calls. - Local Instances: Avoid sharing instances altogether and instantiate a new
icu::NumberFormatlocally withinbase::FormatDouble, although this could incur significant performance overhead.
Evaluated with Chrome root at commit: a1e33f5848218e21d4a16ae2c1bc94e815c30c7f
Results 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 data race: a process-global ICU NumberFormat instance is mutated without synchronisation, and ICU's internal formatter is deleted and replaced during that mutation while other threads may still be using it.
Impact
Exploitation could lead to remote code execution and full system compromise because the race occurs in the unsandboxed browser process, though the report notes that a full working proof-of-concept has not been developed.
What the attacker needed
MacOS or Linux; OopPrintDriversAllowed policy set to false; user opens Print Preview; concurrent UI-thread formatting calls
The fix
The shared ICU formatter should not be mutated concurrently; possible fixes include giving each thread its own formatter, adding a lock, or creating a local formatter per call.
How it was found
- Use a macOS or Linux system with the OopPrintDriversAllowed enterprise policy set to false.
- Open the Chrome Task Manager and start a large file download to generate frequent FormatDouble calls on the UI thread.
- Open the Print Preview dialog to trigger printer capability enumeration on a background worker thread, which also calls FormatDouble for unregistered paper sizes.
- The concurrent calls from the UI and worker threads trigger the data race, potentially causing a crash or use-after-free.
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 number-formatting helper shared by the whole browser is changed by one thread while another thread is still reading it. That can make the program free memory that is still in use, which is called a use-after-free. Because this happens in the main browser process, which is not sandboxed, an attacker who can trigger the race might be able to run their own code.
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.