Improper input validation in Themes (CVE-2026-95276)
The NtpBackgroundService does not validate the scheme of server-provided background image URLs, allowing an attacker who can spoof network responses to inject data: or chrome: URLs. These URLs are forwarded to the privileged Customize Chrome WebUI and rendered via the cr-auto-img element, bypassing the secure SanitizedImageSource out-of-process decoding and forcing the privileged renderer to decode arbitrary image data directly.
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 potential vulnerability exists where NtpBackgroundService does not validate the scheme of server-provided background image URLs. This allows an attacker capable of spoofing network responses to provide data: or chrome: URLs, which are forwarded to the privileged 'Customize Chrome' WebUI. When rendered via the <img is="cr-auto-img"> custom element, these schemes bypass the secure SanitizedImageSource out-of-process decoding mechanism and decode directly in the privileged WebUI renderer.
Affected files:
components/themes/ntp_background_data.cccomponents/themes/ntp_background_service.ccchrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_page_handler.cc
Estimated timestamp from git blame: 2022-12-07
Summary
A potential security validation bypass exists where NtpBackgroundService fails to validate the protocol scheme of server-supplied background image URLs. If an attacker is able to manipulate network responses from the Backdrop wallpaper service, they can inject malicious data: or chrome: URLs. When the "Customize Chrome" side panel is opened, these unvalidated URLs are forwarded via Mojo to the privileged WebUI (chrome://customize-chrome-side-panel.top-chrome/) and rendered using the <img is="cr-auto-img"> custom element. This bypasses the secure SanitizedImageSource out-of-process decoding layer, forcing the privileged WebUI renderer process to decode arbitrary image data directly.
Root Cause & Code Analysis
In components/themes/ntp_background_data.cc, AddOptionsToImageURL performs string concatenation on incoming image URL strings without verifying the scheme:
GURL AddOptionsToImageURL(const std::string& image_url,
const std::string& image_options) {
return GURL(image_url + ((image_url.find('=') == std::string::npos)
? image_options
: std::string("")));
}
If the server response contains a data: URI (e.g. data:image/png;base64,...) or a parameterized chrome: URL (e.g. chrome://favicon2/?pageUrl=...), the raw string is parsed into a GURL directly without validation.
The NtpBackgroundService parses collections and images from Google's Backdrop service via SimpleURLLoader and populates the preview_image_url fields utilizing this function (components/themes/ntp_background_service.cc lines 211, 272). These GURLs are later passed directly to the CustomizeChromePageHandler which maps them to Mojo objects without additional validation (chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_page_handler.cc lines 799, 838):
collection->preview_image_url = GURL(info.preview_image_url);
...
image->preview_image_url = info.thumbnail_image_url;
In the WebUI, the previewImageUrl is bound as an attribute to the custom <img is="cr-auto-img"> element (chrome/browser/resources/side_panel/customize_chrome/categories.html.ts lines 64-68).
In ui/webui/resources/cr_elements/cr_auto_img/cr_auto_img.ts (lines 93-96), the custom element explicitly allows data: and chrome: URLs to be set directly to the underlying this.src attribute to support internal resources:
if (url.protocol === 'data:' || url.protocol === 'chrome:') {
this.src = url.href;
return;
}
By doing so, it exits early and bypasses the secure fallback routing that would prepend chrome://image?... to direct the download and decoding to the isolated SanitizedImageSource mechanism (which executes image decoding in a highly sandboxed, low-privilege data_decoder utility process).
Potential Exploitation Path
The following outlines a potential scenario of how an attacker might trigger this path (noting that this sequence has not been executed dynamically and our testing tools do not currently have the capability to run code):
- The attacker gains control over network responses (e.g. via a compromised network process).
- The attacker intercepts the outbound request to the Backdrop wallpaper API and returns a malicious protobuf response.
- In the response, the attacker sets a collection's or image's preview URL to a
data:URL containing a malformed base64-encoded image. - When the user opens the "Customize Chrome" side panel, the WebUI frontend requests and receives the collections via Mojo.
- The WebUI binds the
data:URL to a<img is="cr-auto-img">element. - The
cr-auto-imgelement assigns thedata:URL directly tothis.src, bypassing thechrome://imageproxy. - Blink's image decoder parses and decodes the malformed image directly within the privileged WebUI renderer process context instead of the isolated utility process. Any memory-corruption bug in the decoder would trigger in the privileged WebUI context.
Suggested Fix
We suggest adding strict scheme validation on the C++ side. NtpBackgroundService should only accept image URLs that use cryptographic schemes (e.g. SchemeIsCryptographic() or SchemeIsHTTPOrHTTPS()). Any incoming URLs that violate this check should be discarded or replaced with empty URLs.
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 NtpBackgroundService fails to validate the URL scheme of server-supplied image URLs before passing them to the privileged WebUI, where the cr-auto-img element allows data: and chrome: schemes to bypass the secure SanitizedImageSource decoding path.
Impact
If an attacker can spoof network responses, a memory-corruption bug in the image decoder could be triggered in the privileged WebUI renderer context, potentially leading to code execution with elevated privileges; however, the report notes that this sequence has not been executed dynamically.
What the attacker needed
Attacker can spoof network responses; victim opens Customize Chrome side panel
The fix
The NtpBackgroundService should validate the scheme of incoming image URLs and only accept cryptographic or HTTP/HTTPS schemes, discarding or replacing any URLs that violate this check.
How it was found
- The attacker gains control over network responses (e.g. via a compromised network process).
- The attacker intercepts the outbound request to the Backdrop wallpaper API and returns a malicious protobuf response.
- In the response, the attacker sets a collection's or image's preview URL to a data: URL containing a malformed base64-encoded image.
- When the user opens the 'Customize Chrome' side panel, the WebUI frontend requests and receives the collections via Mojo.
- The WebUI binds the data: URL to a <img is="cr-auto-img"> element.
- The cr-auto-img element assigns the data: URL directly to this.src, bypassing the chrome://image proxy.
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 browser component that fetches wallpaper images from a server does not check what kind of link the server sends back. If an attacker can tamper with that server's response, they can make the browser load a specially crafted image directly inside a highly privileged page instead of a safe, isolated process. This could let a malformed image exploit a bug in the image decoder and run code with extra privileges.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.