Insufficient validation of untrusted input in Cast (CVE-2026-8007)
The ReconnectPresentation method in Chromium's Cast implementation fails to validate the presentation URL, allowing a compromised renderer to inject a malicious URN that triggers full-screen or cross-tab capture without the user-consent desktop picker. An attacker who already controls a renderer and has an active tab-mirroring session could silently escalate to capturing the entire screen or other tabs.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 41 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A compromised renderer can initiate unauthorized desktop or cross-tab capture by sending a malicious URN to ControllerPresentationServiceDelegateImpl::ReconnectPresentation. Because this method lacks URL validation, it allows the attacker to silently escalate an active tab-mirroring session into a full-screen capture session. This bypasses the user-consent UI (desktop_picker_->Show()) normally required for such capture.
Affected files:
components/media_router/browser/presentation/controller_presentation_service_delegate_impl.cccontent/browser/presentation/presentation_service_impl.ccchrome/browser/media/router/mojo/media_router_desktop.cccomponents/media_router/common/media_source.ccchrome/browser/media/router/providers/cast/cast_activity_manager.cc
Estimated timestamp from git blame: 2024-11-06
Description
A potential vulnerability exists in the implementation of ReconnectPresentation that allows a compromised renderer to initiate unauthorized desktop or cross-tab capture without user consent via the desktop picker UI.
The issue resides in ControllerPresentationServiceDelegateImpl::ReconnectPresentation (in components/media_router/browser/presentation/controller_presentation_service_delegate_impl.cc). Unlike StartPresentation, which correctly calls IsValidPresentationUrl to enforce protocol restrictions (e.g., blocking urn: schemes), ReconnectPresentation fails to validate the presentation_urls parameter.
Because GURL accepts urn: as a valid scheme and MediaSource stores the URL spec directly as its ID, an attacker can inject a malicious URN such as urn:x-org.chromium.media:source:desktop:screen:0:0 (for full-screen capture) or urn:x-org.chromium.media:source:desktop:web-contents-media-stream://<pid>:<fid> (for cross-tab capture).
When a ReconnectPresentation request is sent with presentation_id="auto-join" and a malicious URN, MediaRouterDesktop::JoinRoute processes it. If the user is already mirroring a tab to a Cast device, the CAST provider reuses the existing sink and launches a new mirroring activity via CastActivityManager::JoinSession. The MirroringActivity then extracts the attacker-controlled DesktopStreamId from the URN and passes it to the capture service.
Crucially, this JoinRoute path bypasses the desktop_picker_->Show() call, which is the normal user-consent gate for desktop capture and is only present in the CreateRoute path.
Potential Impact
This represents a privilege escalation from tab-mirroring to full-screen or cross-tab capture. While the captured stream is sent to the local Cast sink (e.g., a TV), it constitutes an unauthorized capture of sensitive information from the user's desktop or other open tabs without their knowledge or the required picker UI prompt.
Preconditions
- The attacker must compromise a renderer process.
- The user must be actively Cast-mirroring a tab from that compromised renderer.
Suggested Reproduction Steps (Conceptual)
Note: These are potential steps as the AI agent cannot execute code to verify a working PoC.
- The user visits an attacker-controlled page and initiates Cast tab-mirroring to a local device.
- The attacker exploits a separate bug (e.g., in V8) to compromise the renderer process.
- The compromised renderer constructs a malicious presentation URL for full-screen capture:
urn:x-org.chromium.media:source:desktop:screen:0:0. - The renderer bypasses Blink's JavaScript validation and directly sends a
blink.mojom.PresentationService.ReconnectPresentationMojo IPC message to the Browser process. The message uses the malicious URN and setspresentation_id="auto-join". - In the Browser process,
ControllerPresentationServiceDelegateImpl::ReconnectPresentationreceives the request. Lacking validation, it passes the URN toMediaRouterDesktop::JoinRoute. - The request routes to
CastActivityManager::JoinSession. Becausepresentation_idisauto-joinand the default action policy for the newly created desktop source iskCreateSession, it looks up the active sink for the tab. CastActivityManagerseamlessly terminates the tab-mirroring session and callsLaunchSessionto start a new full-screen capture session to the same sink using the malicious URN.MirroringActivityparses the stream ID (screen:0:0), initializes aDesktopCaptureDevice, and begins streaming the user's entire screen without ever showing the desktop picker UI.
Suggested Fix
Add a call to IsValidPresentationUrl() within ControllerPresentationServiceDelegateImpl::ReconnectPresentation (in components/media_router/browser/presentation/controller_presentation_service_delegate_impl.cc) to validate the provided presentation_urls before processing them, mirroring the logic used in StartPresentation:
if (presentation_urls.empty()) {
// ... error handling ...
return;
}
if (!std::ranges::all_of(presentation_urls, IsValidPresentationUrl)) {
std::move(error_cb).Run(
PresentationError(PresentationErrorType::NO_PRESENTATION_FOUND,
"Invalid presentation URL."));
return;
}
Evaluated with Chrome root at commit: 0eb4855bda702feaaa8b899336664f97e3df88b8
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. Please feel free to reach out to me if you have concerns or feedback.
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 ReconnectPresentation function does not call IsValidPresentationUrl to reject non-http(s) schemes such as urn:, unlike StartPresentation, so attacker-controlled URNs reach the Cast session-joining logic.
Impact
A compromised renderer could escalate an active tab-mirroring session to full-screen or cross-tab capture without the user-consent picker, sending sensitive desktop or other-tab content to the local Cast sink.
What the attacker needed
Attacker compromises a renderer process; user is actively Cast-mirroring a tab from that renderer
The fix
The fix should add a call to IsValidPresentationUrl within ReconnectPresentation to validate the presentation_urls before processing them, mirroring the logic used in StartPresentation.
How it was found
- The user visits an attacker-controlled page and starts Cast tab-mirroring to a local device.
- The attacker exploits a separate bug to compromise the renderer process.
- The compromised renderer sends a ReconnectPresentation IPC message with a malicious URN and presentation_id set to auto-join.
- The browser process passes the unvalidated URN to JoinRoute, which reuses the existing Cast sink.
- CastActivityManager launches a new mirroring session using the malicious URN, and MirroringActivity starts capturing the desktop without showing the picker.
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 renderer is the part of the browser that turns web page code into what you see; if an attacker can run their own code there, they can try to trick the browser's internal messaging. Here, a message meant to reconnect an existing screen-sharing session did not check what kind of screen was being requested, so the attacker could ask for the whole desktop instead of just one tab. Normally the browser shows a picker asking the user to choose what to share, but this path skipped that prompt.
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.