Improper input validation in WebShare (CVE-2026-113147)
The Android Sharing Hub in Chrome for Android decodes renderer-supplied image data in the unsandboxed browser process without a user activation check. A compromised renderer could exploit a memory corruption bug in a native image codec to achieve remote code execution in the browser process.
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.
Overview: A compromised renderer can trigger the Android Sharing Hub silently via the ShareService Mojo interface due to a missing user activation check. The browser process saves the supplied image and decodes it in-process using Android system APIs to generate a UI preview. This allows an attacker to exploit vulnerabilities in native system codecs (e.g., libwebp) to achieve remote code execution in the unsandboxed browser process.
Affected files:
components/browser_ui/webshare/android/java/src/org/chromium/components/browser_ui/webshare/ShareServiceImpl.javachrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ShareSheetBottomSheetContent.javacomponents/browser_ui/share/android/java/src/org/chromium/components/browser_ui/share/ShareImageFileUtils.javabase/android/java/src/org/chromium/base/ApiCompatibilityUtils.javacomponents/browser_ui/webshare/android/java/src/org/chromium/components/browser_ui/webshare/BlobReceiver.javachrome/android/java/src/org/chromium/chrome/browser/share/ShareDelegateImpl.javachrome/browser/chrome_browser_interface_binders.cc
Estimated timestamp from git blame: 2025-08-07
Summary
On Chrome for Android (specifically Android 13 and earlier), the Sharing Hub generates image previews by decoding renderer-supplied bytes directly within the browser process. This is accomplished using the Android framework's ImageDecoder. Decoding untrusted image data in a highly privileged process violates Chrome's "Rule of 2". A compromised renderer can potentially exploit this architectural flaw to achieve arbitrary code execution in the browser process, resulting in a full sandbox escape, by supplying malformed image bytes that trigger vulnerabilities in Android's native image codecs.
Technical Details
- Missing User Activation Check: The
blink.mojom.ShareServiceMojo interface is implemented inShareServiceImpl.javawithin the browser process. The implementation lacks a check for transient user activation (e.g.,RenderFrameHost::HasTransientUserActivation()). Consequently, a compromised renderer can trigger the sharing flow programmatically without any user interaction. - Unvalidated Data Persistence: When the renderer calls the Mojo
Sharemethod with a file,ShareServiceImplvalidates the file against an allowlist of extensions and MIME types. An attacker can easily spoof these (e.g., by sending a malformed WebP file disguised as animage/pngwith a.pngextension).BlobReceiver.javathen writes the renderer-supplied bytes verbatim to a temporary file in the browser's shared files directory. No safe out-of-process transcoding or content sniffing is performed. - Unsandboxed Decoding: To display the Sharing Hub bottom sheet,
ShareSheetBottomSheetContent.createPreview()is called to generate a thumbnail. For image MIME types, it invokesShareImageFileUtils.getBitmapFromUriAsync(), which delegates toApiCompatibilityUtils.getBitmapByUri(). On Android P and above, this callsandroid.graphics.ImageDecoder.decodeBitmap(). - Sandbox Escape:
ImageDecoder.decodeBitmap()inspects the magic bytes of the file, determines its actual format, and routes it to the corresponding native system codec (e.g.,libwebp,libheif). Because this system API is invoked directly by the browser process, the native codec executes in-process. Exploiting a memory corruption vulnerability within the system codec allows an attacker to hijack the execution flow of the unsandboxed browser process.
Suggested Exploitation Steps
Note: These are potential steps based on code analysis; a working proof-of-concept has not been executed.
- An attacker gains arbitrary code execution within the sandboxed renderer process.
- The compromised renderer connects to the
blink.mojom.ShareServiceinterface. - The attacker crafts a payload exploiting a known vulnerability in an Android native image codec (e.g., CVE-2023-4863 in
libwebp). - The payload is encapsulated in a
SharedFileobject, with its extension spoofed to.pngand MIME type spoofed toimage/pngto bypass initial validation inShareServiceImpl. - The renderer sends the
ShareIPC message. The lack of a user activation check permits this action to proceed silently. - The browser process saves the malformed file and attempts to generate a preview using
ImageDecoder.decodeBitmap(). - The Android system codec parses the malformed data in-process, triggering the vulnerability and granting the attacker RCE in the browser process.
Suggested Fix
- Enforce User Activation: Add a
HasTransientUserActivation()check in the browser process, either during the Mojo interface binding inForwardToJavaWebContentsor withinShareServiceImpl.share(), to ensure the sharing flow requires legitimate user interaction. - Isolate Image Decoding: Adhere to the "Rule of 2" by moving the decoding of untrusted images for the Sharing Hub preview into an isolated utility process, or rely on safely pre-decoded bitmaps passed from the renderer.
Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b
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 the browser process decodes untrusted image data from the renderer using Android's ImageDecoder without isolating it, and the ShareService Mojo interface lacks a user activation check.
Impact
A compromised renderer could achieve remote code execution in the unsandboxed browser process, resulting in a full sandbox escape.
What the attacker needed
Compromised renderer process; Android 13 or earlier; known codec vulnerability
The fix
The fix should enforce a user activation check in the browser process and isolate image decoding into a separate utility process or use safely pre-decoded bitmaps.
How it was found
- An attacker gains code execution in the sandboxed renderer process.
- The compromised renderer connects to the ShareService Mojo interface.
- The attacker crafts a malformed image exploiting a native codec vulnerability.
- The payload is sent as a SharedFile with spoofed extension and MIME type.
- The renderer sends the Share IPC message without user activation.
- The browser process saves the file and decodes it in-process, triggering the codec bug.
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 separates web pages into a sandboxed process, so a bug in a page cannot easily harm the whole browser. This report says a feature that shows a share preview takes image data from that sandboxed process and decodes it in the main browser process, which is not sandboxed. If the image decoder has a bug, an attacker who already controls the sandboxed process could use it to run code in the main browser process.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.