Race condition in ReadAloud (CVE-2026-78934)
A shared phrase-segmentation model in Reading Mode is accessed from unsequenced background threads, and the underlying TFLite interpreter is not thread-safe. Concurrent use, or a model update on the main thread during inference, could corrupt memory and cause a heap use-after-free or out-of-bounds write.
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. 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 potential concurrency race condition exists in the Reading Mode phrase segmentation code. Multiple ReadAloudAppModel instances in the same renderer process can concurrently access the process-wide DependencyParserModel singleton via unsequenced ThreadPool tasks. Because the underlying TfLiteEngine and tflite::Interpreter are not thread-safe, concurrent operations can result in a heap Use-After-Free or out-of-bounds write.
Affected files:
chrome/renderer/accessibility/read_anything/read_aloud_app_model.ccchrome/renderer/accessibility/phrase_segmentation/dependency_parser_model.ccchrome/renderer/accessibility/read_anything/read_aloud_app_model.hchrome/renderer/accessibility/phrase_segmentation/dependency_parser_model.h
Estimated timestamp from git blame: 2024-12-18
Description
A potential concurrency race condition has been identified in the phrase segmentation logic of the Reading Mode feature.
In chrome/renderer/accessibility/read_anything/read_aloud_app_model.cc, the process-wide DependencyParserModel singleton is retrieved via a static base::NoDestructor instance in GetDependencyParserModel_():
DependencyParserModel& GetDependencyParserModel_() {
static base::NoDestructor<DependencyParserModel> instance;
return *instance;
}
When ReadAloudAppModel::CalculatePhrases is invoked, it schedules the inference task asynchronously using base::ThreadPool::PostTaskAndReplyWithResult on an unsequenced task runner:
base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&GetDependencyHeads, phrase_tokens),
base::BindOnce(&ReadAloudAppModel::UpdatePhraseBoundaries,
weak_ptr_factory_.GetWeakPtr(), phrase_tokens));
Although ReadAloudAppModel uses an instance-level boolean guard (is_calculating_phrases) to prevent concurrent re-entry within a single instance, it does not prevent concurrent calculations across different instances in the same process.
When multiple Reading Mode side panels or tabs are consolidated into a single renderer process (such as when the browser process limit is reached), different ReadAloudAppModel instances can post tasks concurrently. Because the ThreadPool runner is unsequenced, these tasks run concurrently on separate background worker threads.
Concurrency Races on tflite::Interpreter
Both background threads will concurrently execute GetDependencyHeads(), which directly accesses the shared DependencyParserModel singleton and its underlying tflite::Interpreter:
auto* interpreter = dependency_parser_model_->interpreter();
interpreter->ResizeInputTensor(0, {1, static_cast<int>(input.size())});
TfLiteTensor* input_tensor = interpreter->input_tensor(0);
...
input_buffer.WriteToTensor(input_tensor, /*new_shape=*/nullptr);
interpreter->AllocateTensors();
interpreter->Invoke();
As documented, tflite::Interpreter is not thread-safe. Concurrent execution of ResizeInputTensor, AllocateTensors, and Invoke on separate worker threads will cause data races, corrupt the internal allocator structures, and lead to a heap Use-After-Free or heap Out-of-Bounds write when the interpreter references freed/invalidated tensor arena blocks.
Main Thread vs. Worker Thread Race
An additional race exists when the browser process sends an updated model file to the renderer via Mojo. ReadAnythingAppController::UpdateDependencyParserModel is executed on the main thread, which calls DependencyParserModel::UpdateWithFile(). This method re-initializes the interpreter:
dependency_parser_model_ = std::move(tflite_engine);
If this re-initialization occurs on the main thread while a ThreadPool worker thread is concurrently running interpreter->Invoke(), the underlying TfLiteEngine object is destroyed from under the running thread, leading to a severe use-after-free.
Note: These are potential steps based on source code analysis; our automated tooling does not currently have the capability to run code or compile a live proof-of-concept.
Suggested Potential Reproduction Steps
- Enable the
ReadAnythingReadAloudPhraseHighlightingfeature flag. - Open multiple tabs to force renderer process consolidation so that subsequent Reading Mode instances share the same renderer process.
- Simultaneously trigger phrase calculations in multiple instances (e.g., starting Read Aloud on different documents).
- Under ASan/TSan, this is expected to yield a heap Use-After-Free or a data race warning within the TFLite interpreter.
Recommended Fix
To resolve this issue, access to the shared DependencyParserModel must be serialized.
- Avoid executing
GetDependencyHeadson an unsequenced ThreadPool runner. Instead, define a sequenced task runner specifically for the process-wide dependency parser model operations, ensuring all inference tasks run sequentially on the same sequence:
scoped_refptr<base::SequencedTaskRunner> GetModelTaskRunner() {
static base::NoDestructor<scoped_refptr<base::SequencedTaskRunner>> runner(
base::ThreadPool::CreateSequencedTaskRunner(
{base::MayBlock(), base::TaskPriority::BEST_EFFORT}));
return *runner;
}
- Ensure both
CalculatePhrasestask posting andUpdateWithFilemodel updates are synchronized or dispatched onto this same sequenced task runner.
Evaluated with Chrome root at commit: 5133b93d189b383c37805b1cf3a9d2dbfe8d7379
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.
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 process-wide DependencyParserModel singleton and its non-thread-safe TFLite interpreter are used from unsequenced ThreadPool tasks, with no serialisation across instances or against main-thread model updates.
Impact
Concurrent inference could corrupt the interpreter's memory and cause a heap use-after-free or out-of-bounds write in the renderer, though the report is a source-code analysis and no working exploit was demonstrated.
What the attacker needed
Feature flag enabled; several Reading Mode instances in one process; simultaneous phrase calculations
The fix
Access to the shared model should be serialised by running all inference and model updates on one dedicated sequenced task runner.
How it was found
- Enable the phrase highlighting feature flag.
- Open multiple tabs so Reading Mode instances share one renderer process.
- Start Read Aloud in several instances at once to trigger phrase calculations.
- Observe the result under memory and thread sanitisers.
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.
Reading Mode splits text into phrases using a machine-learning model that is shared by every Reading Mode panel in the same browser process. That model was not built to be used by two things at once, so if two panels ask it to work at the same time, its internal memory can get muddled and the browser may read or write memory it should not. The report is based on reading the code, not on running an exploit.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.