Use after free in Search (CVE-2026-113232)
A cache of raw search-engine object pointers in the settings search-engines controller was not cleared when the WebUI handler stopped observing the underlying service, so the pointers could dangle. An attacker controlling a renderer could then send a message for a deleted engine and cause the browser process to use freed memory.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 5 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 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: A potential Use-After-Free (UAF) vulnerability exists in the browser process because KeywordEditorController maintains a cache of raw TemplateURL pointers that can become dangling. This occurs when a WebUI handler stops observing the underlying service but fails to clear its pointer cache, allowing subsequent messages to dereference freed memory.
Affected files:
chrome/browser/ui/search_engines/keyword_editor_controller.ccchrome/browser/ui/search_engines/keyword_editor_controller.hchrome/browser/ui/webui/settings/search_engines_handler.cc
Estimated timestamp from git blame: 2026-03-26
Summary
A potential Use-After-Free vulnerability has been identified in the privileged browser process within the KeywordEditorController class. The issue arises from a lifecycle mismatch between the SearchEnginesHandler WebUI component and its internal pointer cache, which can lead to the dereference of a dangling TemplateURL pointer.
Root Cause Analysis
In chrome/browser/ui/search_engines/keyword_editor_controller.h, the KeywordEditorController maintains a mapping from TemplateURLID to bare TemplateURL* pointers:
// chrome/browser/ui/search_engines/keyword_editor_controller.h
absl::flat_hash_map<TemplateURLID, TemplateURL*> id_to_turl_;
This cache is populated in KeywordEditorController::Refresh() and queried in GetTemplateURL(id).
In chrome/browser/ui/webui/settings/search_engines_handler.cc, the SearchEnginesHandler manages the lifecycle of this controller. When the associated WebUI page is navigated away from or unloaded, OnJavascriptDisallowed() is called:
void SearchEnginesHandler::OnJavascriptDisallowed() {
scoped_url_service_observation_.Reset();
}
Resetting the observation stops the handler from receiving notifications when a TemplateURL is modified or deleted. However, the id_to_turl_ map in the list_controller_ member is not cleared.
If a TemplateURL is deleted (e.g., via OpenSearch autodiscovery, sync, or extension removal) while observation is inactive, the cache retains a dangling pointer. Because WebUIImpl can still dispatch messages to handlers after OnJavascriptDisallowed() has been called (but before the handler is destroyed), an attacker can trigger a dereference of this dangling pointer.
Potential Attack Vector
An attacker with control over a sandboxed renderer process (particularly a WebUI renderer) could potentially trigger this vulnerability by:
- Navigating a frame to
chrome://settings/searchEnginesto populate theKeywordEditorControllercache. - Triggering a navigation or page unload to invoke
OnJavascriptDisallowed(), which stops the observation of the search engine service. - Causing the deletion of a search engine through a separate web-reachable mechanism (like an OpenSearch description update).
- Sending a
removeSearchEngineMojo message to the browser-sideSearchEnginesHandlerfor the deleted engine ID. - The browser executes
HandleRemoveSearchEngine, retrieves the dangling pointer from the staleid_to_turl_map, and attempts to access the object (e.g., viaCanRemove(template_url)), resulting in a Use-After-Free.
Since id_to_turl_ uses bare TemplateURL* pointers rather than base::raw_ptr<T>, this path is not protected by MiraclePtr (BackupRefPtr).
Suggested Fix
The id_to_turl_ cache should be cleared whenever observation of the underlying service is stopped. In SearchEnginesHandler::OnJavascriptDisallowed(), a call to a new list_controller_.ClearCache() (or similar) should be added to ensure no stale pointers remain.
void SearchEnginesHandler::OnJavascriptDisallowed() {
scoped_url_service_observation_.Reset();
// Potential fix: Clear the controller's pointer cache
list_controller_.Clear();
}
Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e
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
The handler resets its service observation in OnJavascriptDisallowed() but leaves the controller's map of bare TemplateURL pointers populated, so later messages can dereference freed objects.
Impact
An attacker with control of a renderer could potentially cause a use-after-free in the privileged browser process, which may lead to memory corruption or code execution, though the report only describes the path as potential.
What the attacker needed
Control of a renderer process; ability to trigger engine deletion separately
The fix
The cache should be cleared whenever observation of the underlying service stops, for example by calling a clear method on the controller inside OnJavascriptDisallowed().
How it was found
- Navigate a frame to the settings search engines page so the controller cache is filled.
- Trigger a navigation or unload so the handler stops observing the search engine service.
- Cause a search engine to be deleted through another web-reachable route.
- Send a remove message for the deleted engine's identifier to the browser-side handler.
- The handler looks up the stale pointer and accesses the freed object.
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.
The browser keeps a list of search engines and a shortcut table of pointers to them. When the settings page goes away, the browser stops listening for changes to that list but forgets to empty the shortcut table, so some entries can point at objects that have since been deleted. If a message then asks about one of those deleted entries, the browser reads memory that no longer belongs to it, which can crash it or, in principle, let an attacker 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.