Insufficient validation of untrusted input in Web Share (CVE-2026-11128)
A logic flaw in the Web Share API lets an HTTPS page set its base URL to a file:// scheme, bypassing renderer-side scheme checks. The browser process then fails to validate the shared URL's scheme, so on macOS the native share sheet can treat a file:// URL as a local file and attach its contents when the user shares it.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 54 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.
Overview: A logic flaw in the Web Share API allows an HTTPS page to bypass URL scheme restrictions by setting the document's <base href> to a file:/// URL. The browser process subsequently fails to validate the shared URL's scheme before passing it to the operating system. On macOS, this can result in the native share sheet treating the URL as a local file, potentially leading to file exfiltration if the user interacts with the share dialog.
Affected files:
third_party/blink/renderer/modules/webshare/navigator_share.ccchrome/browser/webshare/share_service_impl.ccthird_party/blink/renderer/core/dom/document.cccontent/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mmchrome/browser/webshare/mac/sharing_service_operation.mmchrome/browser/webshare/win/share_operation.cc
Estimated timestamp from git blame: 2026-03-03
Description
A vulnerability exists in the Web Share API where the renderer-side validation of the shared URL's scheme can be bypassed using a <base href> element. This is compounded by a lack of independent scheme validation in the browser process.
In third_party/blink/renderer/modules/webshare/navigator_share.cc, the CanShareInternal() function validates the scheme of the URL provided to navigator.share(). It explicitly allows non-HTTP(S) schemes if the URL's protocol matches the document's base URL protocol: url.Protocol() == window.document()->BaseURL().Protocol().
The document's base URL is derived from the <base href> element. In third_party/blink/renderer/core/dom/document.cc, Document::ProcessBaseElement() blocks data: and javascript: schemes but does not explicitly block file: schemes from being set as the base URL. Therefore, an HTTPS page can include <base href="file:///">, which sets the document's BaseURL().Protocol() to "file". Consequently, a call to navigator.share({url: 'file:///etc/passwd'}) will successfully bypass the renderer-side check.
When the renderer sends the share request via the blink.mojom.ShareService::Share IPC, the browser-side implementation in chrome/browser/webshare/share_service_impl.cc fails to validate the share_url's scheme against the process's security policy. It does not invoke RenderProcessHostImpl::FilterURL or check ChildProcessSecurityPolicy to ensure the renderer is authorized to request file: URLs. The URL is passed verbatim to the platform-specific share handler.
On macOS 13+, RenderWidgetHostNSViewBridge::ShowSharingServicePicker converts the GURL to a file: scheme NSURL. The macOS NSSharingServicePicker treats file: scheme NSURL items as local file references. If a user is tricked into sharing the item (e.g., via Mail or AirDrop), the operating system will read the local file contents (e.g., /etc/passwd) and attach it to the shared content. The attacker can control the title field to mask the actual URL in the share preview.
Note: These are potential steps and impacts, based on static code analysis.
Suggested Reproduction Steps
- Host a webpage over HTTPS containing the following content:
HTML <!doctype html> <base href="file:///"> <button id="shareBtn">Click to Share</button> <script> shareBtn.onclick = () => { navigator.share({ title: 'Important Document', url: 'file:///etc/passwd' }); }; </script> - On macOS 13+, click the button to trigger
navigator.share()(requires transient user activation). - When the macOS system share picker appears, select a target like 'Mail'.
- Observe that the contents of
/etc/passwdare attached to the resulting email draft.
Suggested Fix
- Renderer Check: Update
CanShareInternal()innavigator_share.ccto validate the shared URL's scheme against the document's Security Origin scheme (or explicitly require HTTP/HTTPS), rather than relying on the mutable Base URL protocol. - Browser Validation: Introduce robust scheme validation in the browser process (
ShareServiceImpl). Theshare_urlshould be validated against theChildProcessSecurityPolicyto ensure the originating renderer process is authorized to access the provided scheme (preventing sandboxed renderers from passingfile:,chrome:, or other privileged URLs).
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 renderer validates the shared URL's scheme against the mutable document base URL protocol, and the browser process does not independently check the scheme against the renderer's security policy.
Impact
On macOS 13 and later, a user who interacts with the share dialog could have a local file's contents attached to shared content, potentially leading to file exfiltration; the report notes these are potential steps based on static code analysis.
What the attacker needed
MacOS 13 or later; victim clicks a share button; victim picks a share target
The fix
The renderer should validate the shared URL's scheme against the document's security origin rather than the base URL, and the browser process should check the scheme against the renderer's security policy.
How it was found
- Host an HTTPS page that sets a file:// base URL and calls navigator.share with a file:// URL when a button is clicked.
- On macOS 13 or later, click the button to trigger the share dialog, which requires a recent user action.
- Choose a share target such as Mail in the system share picker.
- Observe that the local file's contents are attached to the email draft.
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.
Web pages can ask the operating system to share a link using a feature called the Web Share API. This report says a page can trick that feature into sharing a local file instead of a web link, because the browser checks the link's type in the page but not again in the more trusted browser process. If the user then picks an app like Mail, the file's contents could be attached.
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.