Insufficient validation of untrusted input in WebShare (CVE-2026-13939)
The Android Web Share API implementation did not validate the URL scheme supplied by the renderer, unlike the desktop version which only allows HTTP or HTTPS. A compromised renderer could inject arbitrary schemes such as javascript: or intent: into trusted browser UI and system share intents, leading to UI spoofing, clipboard injection, and unexpected behaviour in recipient apps.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 48 days
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: The Android implementation of the Web Share API fails to validate the URL scheme provided by the renderer in the browser process. This allows a compromised renderer to inject arbitrary schemes like 'javascript:' or 'intent:' into trusted browser UI components and system share intents.
Affected files:
components/browser_ui/webshare/android/java/src/org/chromium/components/browser_ui/webshare/ShareServiceImpl.javacomponents/browser_ui/share/android/java/src/org/chromium/components/browser_ui/share/ShareParams.javacomponents/browser_ui/share/android/java/src/org/chromium/components/browser_ui/share/ShareHelper.java
Estimated timestamp from git blame: 2020-09-24
Summary
The Android Java implementation of the blink.mojom.ShareService Mojo interface accepts renderer-supplied URLs without validating their scheme. This is inconsistent with the desktop C++ implementation, which enforces that shared URLs must be HTTP or HTTPS and terminates the calling renderer if this invariant is violated.
Root Cause Analysis
In the desktop implementation (chrome/browser/webshare/share_service_impl.cc), the following check is performed when a share request is received:
if (!share_url.is_empty() && !share_url.SchemeIsHTTPOrHTTPS()) {
std::move(callback).Run(blink::mojom::ShareError::PERMISSION_DENIED);
ReportBadMessageAndDeleteThis(
"Web Share URL scheme must be http or https.");
return;
}
However, the Android implementation in components/browser_ui/webshare/android/java/src/org/chromium/components/browser_ui/webshare/ShareServiceImpl.java lacks any equivalent validation. The raw URL string received from the Mojo call is passed directly into a ShareParams object and subsequently used by the browser UI and system share intents.
Potential Impact
A compromised renderer on Android could potentially cause the browser process to process arbitrary-scheme URLs (e.g., javascript:, file:, intent:, chrome:). While no immediate browser-process navigation was identified, this lack of validation has several consequences:
- UI Spoofing: The malicious URL is displayed in the Chrome-branded share sheet preview header. Because
UrlFormatter.formatUrlForSecurityDisplayfalls back to displaying the full string for non-standard schemes, an attacker can present arbitrary payloads in a trusted UI surface. - Clipboard Injection: If the user selects the 'Copy URL' action in the share sheet, the attacker-controlled string is written to the system clipboard.
- Intent Propagation: The URL is included as plain text in the
Intent.EXTRA_TEXTextra when sharing to third-party applications, potentially triggering unexpected behavior in the recipient apps. - QR Code Generation: The 'QR Code' sharing feature will encode the malicious string without further validation.
Suggested Reproduction Steps (Untested)
- From a compromised Android renderer, bind the
blink.mojom.ShareServiceMojo interface. - Send a
sharerequest with a non-HTTP(S) URL, for example:url = {url: "javascript:alert(document.domain)"}. - Observe that the Android share sheet is displayed and the renderer is NOT terminated (unlike desktop behavior).
- Verify that the
javascript:URL is visible in the share sheet preview and is forwarded as text in sharing actions (Copy, QR Code, or external Intents).
Proposed Fix
Implement a scheme check in org.chromium.components.browser_ui.webshare.ShareServiceImpl.share that mirrors the desktop implementation. If the provided URL is not empty and its scheme is not HTTP or HTTPS, the request should be rejected and the renderer should be reported for a bad message.
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 Android ShareServiceImpl passed the renderer-supplied URL string directly into ShareParams without checking that its scheme was HTTP or HTTPS, unlike the desktop implementation which rejects other schemes and reports a bad message.
What the attacker needed
Compromised Android renderer
The fix
The Android ShareServiceImpl should implement a scheme check mirroring the desktop implementation, rejecting non-HTTP(S) URLs and reporting the renderer for a bad message.
How it was found
- From a compromised Android renderer, bind the blink.mojom.ShareService Mojo interface.
- Send a share request with a non-HTTP(S) URL.
- Observe that the Android share sheet is displayed and the renderer is not terminated.
- Verify that the javascript: URL is visible in the share sheet preview and is forwarded as text in sharing actions.
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.
When a web page asks to share a link, the browser's sharing code receives a URL from the page. On desktop, Chrome checks that the URL starts with http or https before showing the share dialog. On Android, that check was missing, so a malicious page could pass a link like javascript:something, which would then appear in Chrome's share sheet and be copied or sent to other apps. This is a problem because the share sheet is trusted Chrome UI, and showing attacker-controlled text there can trick users.
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.