Improper input validation in Mobile (CVE-2026-106414)
The 'Save Image' action in Chrome for iOS skips the usual re-encoding of untrusted web images when the URL ends in .gif, so raw image bytes reach Apple's ImageIO parser in the privileged browser process. An attacker could host a malformed image to trigger a memory-corruption bug in ImageIO, potentially escaping the sandbox and achieving remote code execution.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 6 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 go/chrome-ai-generated-security-bugs-faq for more information.
Overview: The 'Save Image' context menu action in Chrome for iOS fails to sanitize untrusted web images before parsing them. By serving an image with a .gif extension, an attacker can bypass client-side canvas extraction, causing the raw image bytes to be parsed directly by [UIImage imageWithData:] in the privileged browser process. This architectural flaw exposes the main Chrome process to potential memory corruption vulnerabilities within Apple's ImageIO framework.
Affected files:
ios/chrome/browser/shared/ui/util/image/image_saver.mmios/chrome/browser/web/model/image_fetch/resources/image_fetch.tsios/chrome/browser/context_menu/ui_bundled/context_menu_configuration_provider.mmios/chrome/browser/web/model/image_fetch/image_fetch_tab_helper.mm
Estimated timestamp from git blame: 2024-09-10
Description
Chrome for iOS implements a defense-in-depth architecture where untrusted image data obtained from the web should be re-encoded using web::JavaScriptImageTranscoder before being processed by native system APIs. This transcoding happens in a sandboxed WKWebView process, insulating the main browser process from potentially fatal parsing bugs in Apple's ImageIO framework.
While features like "Search Image with Lens" and "Gemini Remix" correctly utilize this transcoder (via ContextMenuConfigurationProvider::sanitizeImageData:), the "Save Image" action does not.
When a user selects "Save Image", the flow reaches ImageSaver::saveImageAtURL: which calls ImageFetchTabHelper::GetImageData. This helper attempts to extract the image via JavaScript. However, if the requested URL has a .gif extension, the injected script (image_fetch.ts) intentionally skips canvas extraction (getImageDataByCanvas returns null) to preserve animation frames. It falls back to an XMLHttpRequest (or a native network fetch if XHR fails), returning the raw, unadulterated bytes of the image.
These raw bytes are passed to ImageSaver::didGetImageData:, which attempts to validate the data by calling [UIImage imageWithData:data]. This synchronously invokes the ImageIO parser on the main thread of the highly privileged Chrome browser process. If the image container is malformed to exploit an ImageIO vulnerability, the memory corruption occurs within the browser process, leading to a complete sandbox escape and potential Remote Code Execution (RCE).
Potential Exploitation Steps
(Note: These are potential steps based on code analysis; a full working exploit has not been verified.)
- An attacker crafts a malicious image file (e.g., TIFF, HEIF, WebP) designed to exploit a known or zero-day vulnerability in Apple's ImageIO framework.
- The attacker hosts this file on a webpage, ensuring the URL ends with
.gif(e.g.,{{media:0}}) to bypass canvas-based sanitization in Chrome's injected scripts. - The attacker lures a victim to the webpage.
- The victim long-presses the malicious image and selects "Save Image" from the context menu.
- The raw payload is fetched and passed to
[UIImage imageWithData:]inImageSaver::didGetImageData:. - ImageIO parses the malformed container within the Chrome browser process, triggering the memory corruption and compromising the application.
Suggested Fix
Update ImageSaver::didGetImageData: (or the preceding logic in ContextMenuConfigurationProvider where the 'Save Image' block is defined) to pass the untrusted NSData through web::JavaScriptImageTranscoder before it is passed to [UIImage imageWithData:] or saved to the photo library. This ensures that only re-encoded, safe image data is parsed by native system frameworks within the browser process.
Evaluated with Chrome root at commit: 7353d249d9cacf9c7218e1d7b8a39cf39c72d646
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
The 'Save Image' path does not pass untrusted image data through the JavaScript image transcoder before calling the native image parser, and the .gif extension check causes the transcoder to be skipped entirely.
Impact
If a suitable ImageIO vulnerability exists, an attacker could cause memory corruption in the privileged browser process, leading to a complete sandbox escape and potential remote code execution; the report notes that a full working exploit has not been verified.
What the attacker needed
Victim uses Chrome for iOS; victim long-presses an image and taps Save Image; image URL ends in .gif; a working ImageIO vulnerability
The fix
The 'Save Image' path should pass untrusted image data through the JavaScript image transcoder before it reaches the native image parser or is saved to the photo library.
How it was found
- Craft a malicious image file designed to exploit a vulnerability in Apple's ImageIO framework.
- Host the file on a webpage with a URL ending in .gif to bypass canvas-based sanitisation.
- Lure the victim to the webpage.
- The victim long-presses the image and selects 'Save Image' from the context menu.
- The raw bytes are fetched and passed to the native image parser in the browser process.
- ImageIO parses the malformed container, triggering memory corruption.
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.
Chrome for iOS normally cleans up images from websites by re-encoding them in a separate, locked-down process before the main browser looks at them. This report says that when you choose 'Save Image' and the image address ends in .gif, that cleaning step is skipped, so the main browser parses the original file directly. If that file is crafted to break Apple's image-reading code, the attacker could take over the browser.
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.