Inappropriate implementation in Media Router (CVE-2026-17852)
A subframe's explicit presentation request could be overwritten by the top frame changing its default presentation request while the Cast dialog was open, because the route starter registered as an observer unconditionally. This could let a top frame spoof the origin shown in the Cast dialog and deliver a cross-origin PresentationConnection to the victim subframe.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 57 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: MediaRouteStarter unconditionally registers as an observer of WebContentsPresentationManager's default presentation requests. If a top-frame modifies its defaultRequest while a subframe's explicit StartPresentationContext is active, the starter's configuration is overwritten with the top-frame's URL/origin. This can potentially allow a top-frame to spoof the origin in the Cast dialog and inject a cross-origin PresentationConnection into the victim subframe.
Affected files:
chrome/browser/ui/media_router/media_route_starter.cccomponents/media_router/browser/presentation/start_presentation_context.cc
Estimated timestamp from git blame: 2022-04-07
Problem Description
There is a potential logical security vulnerability in the Chromium Media Router component where a subframe's explicit presentation request (initiated via PresentationRequest.start()) can be hijacked and retargeted by the parent/top frame.
When a subframe requests a presentation start, MediaNotificationService creates a MediaRouterUI controller with the subframe's StartPresentationContext. This, in turn, instantiates a MediaRouteStarter to manage the lifecycle of the route creation.
However, in chrome/browser/ui/media_router/media_route_starter.cc:
-
Unconditional Observer Registration: The constructor of
MediaRouteStarterregisters itself unconditionally as an observer of the top-frame's default presentation manager (WebContentsPresentationManager), regardless of whether it was initialized specifically for a subframe's explicitstart_presentation_context_:C++ // chrome/browser/ui/media_router/media_route_starter.cc:80-82 if (presentation_manager_) { presentation_manager_->AddObserver(this); } -
State Poisoning via Default Request Updates: If the top-frame changes its default request (by setting
navigator.presentation.defaultRequestwithout requiring a user gesture) while the Cast dialog is open,MediaRouteStarter::OnDefaultPresentationChangedis called. It lacks any check for whetherstart_presentation_context_is active and immediately overwritespresentation_request_and the query manager's presentation sources with the attacker-controlled top-frame request:C++ // chrome/browser/ui/media_router/media_route_starter.cc:264-285 void MediaRouteStarter::OnDefaultPresentationChanged( const content::PresentationRequest* presentation_request) { if (presentation_request) { ... presentation_request_ = *presentation_request; // Overwrites subframe's request! GetQueryResultManager()->SetSourcesForCastMode( MediaCastMode::PRESENTATION, sources, presentation_request_->frame_origin); } } -
Resulting Exploitation Paths:
- Origin Spoofing: The browser-drawn Global Media Controls (GMC) card origin label displays the victim subframe's origin (
victim.example) because it is set once on dialog creation and not refreshed whenOnDefaultPresentationChangedfires. However, clicking a Cast device launches the attacker's receiver URL. - PresentationConnection Injection: Once the route is established, the response is delivered to the subframe via
StartPresentationContext::HandleRouteResponse(components/media_router/browser/presentation/start_presentation_context.cc:49-59). Crucially, this path does not validate thatresult.presentation_url()is contained within the subframe's originalpresentation_request_.presentation_urlslist. Consequently, the victim subframe'sstart()promise resolves, establishing aPresentationConnectiontargeting the attacker's receiver.
- Origin Spoofing: The browser-drawn Global Media Controls (GMC) card origin label displays the victim subframe's origin (
Potential Attack Scenario / Reproduction Steps
Note: These are suggested/potential steps derived from code tracing; our tooling agent does not have the capability to run code to confirm.
-
An attacker hosts
https://attacker.examplewhich embeds an iframe pointing tohttps://victim.example/widgetwithallow="presentation". -
The user interacts with the
victim.exampleiframe, causing it to run:JavaScript new PresentationRequest(['https://victim.example/recv']).start(); -
This opens the browser-drawn GMC dialog displaying a Cast card with the labeled origin of
victim.example. -
While the dialog is open, the attacker top-frame executes:
JavaScript navigator.presentation.defaultRequest = new PresentationRequest(['https://attacker.example/recv']); -
Due to the observer bug,
MediaRouteStarter::OnDefaultPresentationChangedoverwrites its internal state with the attacker's URL and origin. -
The user clicks a Cast sink in the GMC device list.
-
The browser initiates a route to the attacker's receiver (
https://attacker.example/recv), but the route response is routed back to the subframe's callback. -
The
victim.examplesubframe receives aPresentationConnectionconnected tohttps://attacker.example/recvand may unknowingly transmit sensitive data (tokens, states) believing it is communicating with its own receiver.
Suggested Fix
There are two layers of defenses that should be applied to fully address this issue:
-
Guard state changes in
MediaRouteStarter: If theMediaRouteStarteris instantiated with an explicitstart_presentation_context_(meaning it is processing an explicit subframe request), it should ignore default presentation changes from the parent frame. For example, inOnDefaultPresentationChanged:C++ void MediaRouteStarter::OnDefaultPresentationChanged( const content::PresentationRequest* presentation_request) { if (start_presentation_context_) { return; } ... -
Validate returned URLs in
StartPresentationContext: Ensure thatStartPresentationContext::HandleRouteResponseverifies that the returnedresult.presentation_url()is a member of its originalpresentation_request_.presentation_urlsbefore invoking the success callback (mirroring the validation performed inControllerPresentationServiceDelegateImpl::OnPresentationResponse).
Evaluated with Chrome root at commit: 87214e6721f6c34afd9181b80769a24c0c601c50
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
Likely the route starter subscribed to default presentation changes without checking whether it was handling an explicit subframe request, and the response handler never checked the returned URL against the original request's allowed URLs.
Impact
The victim subframe could be given a PresentationConnection to an attacker-controlled receiver while the dialog showed the victim's origin, so it may send sensitive data to the attacker; the report notes the steps are derived from code tracing and were not run.
What the attacker needed
Attacker page embeds victim site in a frame; frame allows presentation; victim user interacts with the frame; user picks a Cast device
The fix
The route starter should ignore default presentation changes when it was created for an explicit subframe request, and the response handler should check the returned URL against the original request's allowed URLs.
How it was found
- An attacker page embeds the victim site in a frame that is allowed to use presentation.
- The user interacts with the victim frame, which starts an explicit presentation request and opens the Cast dialog.
- While the dialog is open, the top frame sets a new default presentation request pointing at the attacker's receiver.
- The route starter overwrites its stored request with the attacker's URL and origin.
- The user picks a Cast device, and the browser starts a route to the attacker's receiver.
- The victim frame's start promise resolves with a connection to the attacker's receiver.
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 web page can ask the browser to 'cast' content to another device, and the browser shows a dialog with the origin of the page making the request. Here a page containing another site in a frame could quietly change the request while that dialog was open, so the dialog still showed the inner site's name but the connection went to the attacker's address. The inner site could then send data to the attacker thinking it was talking to its own receiver.
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.