Changeset 236961 in webkit
- Timestamp:
- Oct 9, 2018, 8:10:17 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/gtk/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (modified) (3 diffs)
-
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (modified) (2 diffs)
-
Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp (modified) (5 diffs)
-
Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r236957 r236961 1 2018-10-09 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] Stealing cross-origin video pixel with HLS 4 https://bugs.webkit.org/show_bug.cgi?id=190003 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 * platform/gtk/TestExpectations: Unflag now-passing test. 9 1 10 2018-10-08 Devin Rousso <drousso@apple.com> 2 11 -
trunk/LayoutTests/platform/gtk/TestExpectations
r236954 r236961 3496 3496 webkit.org/b/187770 media/no-fullscreen-when-hidden.html [ Failure ] 3497 3497 webkit.org/b/187994 compositing/backing/backing-store-attachment-fill-forwards-animation.html [ Failure ] 3498 webkit.org/b/187996 http/tests/security/canvas-remote-read-remote-video-hls.html [ Failure ]3499 3498 3500 3499 webkit.org/b/188098 webanimations/accelerated-animation-with-delay.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r236959 r236961 1 2018-10-09 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] Stealing cross-origin video pixel with HLS 4 https://bugs.webkit.org/show_bug.cgi?id=190003 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 Report the SecurityOrigin of downloaded adaptivedemux (HLS, DASH, 9 SmoothStreaming) fragments as tainted if their origin differs from 10 the manifest SecurityOrigin. SecurityOrigins are stored in the 11 CachedResourceStreamingClient implemented in the internal 12 GStreamer HTTP(S) source element. 13 14 The implementation is not ideal yet because the fragments download 15 is performed by the WebProcess, until bug 189967 is fixed. When 16 this bug is fixed, the m_hasTaintedOrigin member variable should 17 be removed and all checks be done unconditionally to the 18 webkithttpsrc element which will manage the download of the 19 manifests and fragments. 20 21 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 22 (WebCore::MediaPlayerPrivateGStreamer::loadFull): Reset the m_hasTaintedOrigin value. 23 (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Get the 24 fragment URL from the adaptivedemux stats message and check if its 25 origin is tainted. 26 (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const): 27 Initial implementation by checking the m_hasTaintedOrigin member 28 variable value. 29 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 30 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: 31 (CachedResourceStreamingClient::responseReceived): Store the 32 resource origin internally so it can be checked later on by 33 webKitSrtcWouldTaintOrigin(). 34 (webKitSrcWouldTaintOrigin): Check given origin against cached 35 origins. This implementation is similar to Cocoa's 36 WebCoreNSURLSession implementation. 37 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: 38 1 39 2018-10-09 Antti Koivisto <antti@apple.com> 2 40 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r236721 r236961 290 290 m_volumeAndMuteInitialized = false; 291 291 m_durationAtEOS = MediaTime::invalidTime(); 292 m_hasTaintedOrigin = std::nullopt; 292 293 293 294 if (!m_delayingLoad) … … 1330 1331 gst_structure_free(responseHeaders); 1331 1332 } 1333 } else if (gst_structure_has_name(structure, "adaptive-streaming-statistics")) { 1334 if (WEBKIT_IS_WEB_SRC(m_source.get())) 1335 if (const char* uri = gst_structure_get_string(structure, "uri")) 1336 m_hasTaintedOrigin = webKitSrcWouldTaintOrigin(WEBKIT_WEB_SRC(m_source.get()), SecurityOrigin::create(URL(URL(), uri))); 1332 1337 } else 1333 1338 GST_DEBUG("Unhandled element message: %" GST_PTR_FORMAT, structure); … … 2649 2654 } 2650 2655 2656 std::optional<bool> MediaPlayerPrivateGStreamer::wouldTaintOrigin(const SecurityOrigin&) const 2657 { 2658 // Ideally the given origin should always be verified with 2659 // webKitSrcWouldTaintOrigin() instead of only checking it for 2660 // adaptive-streaming-statistics. We can't do this yet because HLS fragments 2661 // are currently downloaded independently from WebKit. 2662 // See also https://bugs.webkit.org/show_bug.cgi?id=189967. 2663 return m_hasTaintedOrigin; 2664 } 2665 2666 2651 2667 } 2652 2668 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r235846 r236961 110 110 111 111 bool hasSingleSecurityOrigin() const override; 112 std::optional<bool> wouldTaintOrigin(const SecurityOrigin&) const override; 112 113 113 114 void loadStateChanged(); … … 287 288 #endif 288 289 virtual bool isMediaSource() const { return false; } 290 291 std::optional<bool> m_hasTaintedOrigin { std::nullopt }; 289 292 }; 290 293 } -
trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
r236396 r236961 31 31 #include "ResourceRequest.h" 32 32 #include "ResourceResponse.h" 33 #include "SecurityOrigin.h" 33 34 #include <cstdint> 34 35 #include <gst/app/gstappsrc.h> … … 43 44 CachedResourceStreamingClient(WebKitWebSrc*, ResourceRequest&&); 44 45 virtual ~CachedResourceStreamingClient(); 46 47 const HashSet<RefPtr<WebCore::SecurityOrigin>>& securityOrigins() const { return m_origins; } 48 45 49 private: 46 50 void checkUpdateBlocksize(uint64_t bytesRead); … … 64 68 GRefPtr<GstElement> m_src; 65 69 ResourceRequest m_request; 70 HashSet<RefPtr<WebCore::SecurityOrigin>> m_origins; 66 71 }; 67 72 … … 788 793 789 794 GST_DEBUG_OBJECT(src, "Received response: %d", response.httpStatusCode()); 795 796 auto origin = SecurityOrigin::create(response.url()); 797 m_origins.add(WTFMove(origin)); 790 798 791 799 auto responseURI = response.url().string().utf8(); … … 995 1003 } 996 1004 1005 bool webKitSrcWouldTaintOrigin(WebKitWebSrc* src, const SecurityOrigin& origin) 1006 { 1007 WebKitWebSrcPrivate* priv = src->priv; 1008 1009 auto* cachedResourceStreamingClient = reinterpret_cast<CachedResourceStreamingClient*>(priv->resource->client()); 1010 for (auto& responseOrigin : cachedResourceStreamingClient->securityOrigins()) { 1011 if (!origin.canAccess(*responseOrigin)) 1012 return true; 1013 } 1014 return false; 1015 } 1016 997 1017 #endif // ENABLE(VIDEO) && USE(GSTREAMER) -
trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h
r226973 r236961 25 25 namespace WebCore { 26 26 class MediaPlayer; 27 class SecurityOrigin; 27 28 } 28 29 … … 52 53 void webKitWebSrcSetMediaPlayer(WebKitWebSrc*, WebCore::MediaPlayer*); 53 54 bool webKitSrcPassedCORSAccessCheck(WebKitWebSrc*); 55 bool webKitSrcWouldTaintOrigin(WebKitWebSrc*, const WebCore::SecurityOrigin&); 54 56 55 57 G_END_DECLS
Note:
See TracChangeset
for help on using the changeset viewer.