CVE-2025-43480
Overview
Background
- Opaque source (loadedFromOpaqueSource)
- Marks a cross-origin response so its contents and detailed timing are hidden from script, per the same-origin policy.
- MediaResourceLoader
- Loads media resources for HTMLMediaElement, including HLS playlists and their sub-resources.
- CORS mode (m_crossOriginMode)
- Whether the media element requested cross-origin access with CORS; null means no CORS, so cross-origin data must stay opaque.
- Resource Timing
- A performance API that can expose per-resource load timing, which must be coarsened/withheld for opaque cross-origin resources.
Root Cause Analysis
MediaResourceLoader loads media resources (e.g. HLS playlists and their segment/sub-resources) for a <video>/<audio> element. Whether a response is treated as an opaque cross-origin resource – which prevents script from observing its data and detailed timing – is controlled by loaderOptions.loadedFromOpaqueSource.
Pre-patch, cross-origin media sub-resources fetched after the main resource were not consistently marked opaque, so a cross-origin media stream loaded without CORS could leak data/timing (for example via Resource Timing entries or otherwise observable response state), i.e. cross-origin information disclosure.
The fix adds tracking of whether the main resource has loaded (m_wasMainResourceLoaded) and, in requestResource, marks a request opaque when it is cross-origin and uncredentialed by CORS: if (!m_document->securityOrigin().isSameOriginAs(SecurityOrigin::create(request.url())) && m_crossOriginMode.isNull() && m_wasMainResourceLoaded) loaderOptions.loadedFromOpaqueSource = Yes; else if (!m_wasMainResourceLoaded) m_wasMainResourceLoaded = true;. In other words, the first (main) resource load flips the flag, and subsequent cross-origin, non-CORS sub-resource loads are forced to opaque so their contents/timing are not exposed.
The restored invariant is that cross-origin media sub-resources without CORS are treated as opaque, closing the cross-origin data/timing leak.
The added tests cover cross-origin media resource-timing with and without CORS.
Attack Path
- Point media at a cross-origin stream Load a <video>/<audio> whose src is a cross-origin HLS playlist (or similar) that references sub-resources, without proper CORS.
- Let sub-resources load After the main playlist loads, the media engine fetches cross-origin segments/sub-resources through MediaResourceLoader.
- Observe non-opaque responses Pre-patch, those cross-origin sub-resource loads were not marked loadedFromOpaqueSource, so their data/timing were observable (e.g. Resource Timing).
- Exfiltrate cross-origin info Read the leaked cross-origin response data/timing – a same-origin-policy / information-disclosure bypass in WebContent.
Impact Assessment
Changed Functions
| Function | Change | Notes |
|---|---|---|
MediaResourceLoader::requestResourceSource/WebCore/loader/MediaResourceLoader.cpp |
modified | Marks a request loadedFromOpaqueSource when it is cross-origin, CORS mode is null, and the main resource already loaded; the first load sets m_wasMainResourceLoaded. |
MediaResourceLoader::m_wasMainResourceLoadedSource/WebCore/loader/MediaResourceLoader.h |
modified | New flag distinguishing the initial main resource load from subsequent (sub-)resource loads. |
Files Changed
LayoutTests/http/tests/media/resources/hls/.htaccessLayoutTests/http/tests/performance/performance-resource-timing-cross-origin-media-expected.txtLayoutTests/http/tests/performance/performance-resource-timing-cross-origin-media-with-cors-expected.txtLayoutTests/http/tests/performance/performance-resource-timing-cross-origin-media-with-cors.htmlLayoutTests/http/tests/performance/performance-resource-timing-cross-origin-media.htmlLayoutTests/platform/glib/TestExpectationsLayoutTests/platform/win/TestExpectationsSource/WebCore/loader/MediaResourceLoader.cppSource/WebCore/loader/MediaResourceLoader.h
Audit Directions
- Other loadedFromOpaqueSource gapsgrep WebCore/loader and media for loadedFromOpaqueSource and confirm every cross-origin non-CORS load path sets it.
- Media sub-resource originsAudit HLS/DASH/playlist sub-resource fetching for consistent same-origin checks against the document origin, not just the manifest origin.
- Timing exposureReview Resource Timing / server-timing exposure for media resources to ensure opaque responses are coarsened.