Regression: cross origin attribute not working for non-cached video
Reported by
mifli...@gmail.com,
Aug 21 2016
|
|||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36 Example URL: https://jsfiddle.net/sv7uoure/4/ Steps to reproduce the problem: 1. Open https://jsfiddle.net/sv7uoure/4/ 2. Open Console (in DevTools) 3. Notice errors about tainted canvas even though video with crossorigin attribute. Script couldn't make screenshot from video. What is the expected behavior? No errors about tainted canvas. Script could make screenshot from video. What went wrong? Sometimes you see in console that there is very little time when canvas is not tainted and with real image from video. Considering this, maybe this bug caused by additional requests with range. Did this work before? Yes Definitely worked in Chrome 49, also tested in Chromium 50-51 and it's working Is it a problem with Flash or HTML5? HTML5 Does this work in other browsers? Yes Chrome version: 52.0.2743.116 Channel: stable OS Version: 10.0 Flash Version: Shockwave Flash 22.0 r0 I tested in Chromium 54.0.2824.2 - bug still exists.
,
Aug 22 2016
Able to reproduce the issue for chrome version 54.0.2836.0 on Windows 7, MAC 10.11.6, Ubuntu 14.04. Issue is a non regression seen from M24 - 24.0.1300.0. Issue is not observed on FF browser. Untriaging it so that it gets addressed.
,
Aug 22 2016
,
Aug 22 2016
> Issue is a non regression seen from M24 - 24.0.1300.0. It is working for me (no issue) in Chrome 49 and Chromium 49. Screenshot in attachment.
,
Aug 23 2016
,
Aug 23 2016
When I run this in debug mode, I get the following error: [1:1:0823/164557:FATAL:multibuffer_data_source.cc(249)] Check failed: init_cb_.is_null() && reader_.get(). Initialize() must complete before calling HasSingleOrigin() #0 0x7fe7fd92fdbe base::debug::StackTrace::StackTrace() #1 0x7fe7fd99631f logging::LogMessage::~LogMessage() #2 0x7fe7e7b86380 media::MultibufferDataSource::HasSingleOrigin() #3 0x7fe7e7bc6055 media::WebMediaPlayerImpl::hasSingleSecurityOrigin() #4 0x7fe7e42bbcc7 blink::HTMLMediaElement::hasSingleSecurityOrigin() #5 0x7fe7e42af1e0 blink::HTMLMediaElement::isMediaDataCORSSameOrigin() #6 0x7fe7e43182a8 blink::HTMLVideoElement::wouldTaintOrigin() #7 0x7fe7e4341258 blink::CanvasRenderingContext::wouldTaintOrigin() #8 0x7fe7e221ea7b blink::CanvasRenderingContext2D::wouldTaintOrigin() #9 0x7fe7e2209948 blink::BaseRenderingContext2D::drawImage() #10 0x7fe7e2209ae7 blink::BaseRenderingContext2D::drawImage() #11 0x7fe7e28682f9 blink::CanvasRenderingContext2DV8Internal::drawImage2Method() #12 0x7fe7e2866ecf blink::CanvasRenderingContext2DV8Internal::drawImageMethod() #13 0x7fe7e2857b75 blink::CanvasRenderingContext2DV8Internal::drawImageMethodCallback() #14 0x7fe7f397999c v8::internal::FunctionCallbackArguments::Call() #15 0x7fe7f3a24def v8::internal::(anonymous namespace)::HandleApiCallHelper<>() #16 0x7fe7f3a23c35 v8::internal::Builtin_Impl_HandleApiCall() #17 0x7fe7f3a2393e v8::internal::Builtin_HandleApiCall() #18 0x0fe7fd8063a7 <unknown> I think we really need to re-design the tait/hassingleorigin call. Since the origin can become tainted at any point, polling it is not going to work very well. Especially not before we've even started the http request. Perhaps this tainting should be attached to the video frames instead?
,
Aug 24 2016
> Since the origin can become tainted at any point, polling it is not going to work very well. If I understand correctly, video can't become tainted "in the middle" if it's loaded with "crossorigin" attribute. For example if you are loading video with "crossorigin" attribute and there is no "Access-Control-Allow-Origin" in response then video just doesn't loads. Live example https://jsfiddle.net/sv7uoure/6/ (you can see that video stops loading after "error" event).
,
Aug 24 2016
That's true, and I still need to figure out what is actually going wrong here. I was just pointing out that the way we poll the hasSingleSecurityOrigin() is flawed.
,
Aug 24 2016
Hmm, not sure what's going on yet, the network layer and buffering code all reports a single security origin.
,
Aug 24 2016
Bug found, fix on the way.
,
Aug 25 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5f8b274cdab547c8afff5429110a97d15353c19c commit 5f8b274cdab547c8afff5429110a97d15353c19c Author: hubbe <hubbe@chromium.org> Date: Thu Aug 25 00:28:59 2016 Bugfix for cross-origin check The code is mistaking a missing reader for an error, but readers are now destroyed and re-created on demand. Adding a new variable to explicitly track failures fixes the problem. BUG= 639690 Review-Url: https://codereview.chromium.org/2271313002 Cr-Commit-Position: refs/heads/master@{#414218} [modify] https://crrev.com/5f8b274cdab547c8afff5429110a97d15353c19c/media/blink/multibuffer_data_source.cc [modify] https://crrev.com/5f8b274cdab547c8afff5429110a97d15353c19c/media/blink/multibuffer_data_source.h [modify] https://crrev.com/5f8b274cdab547c8afff5429110a97d15353c19c/media/blink/multibuffer_data_source_unittest.cc
,
Aug 25 2016
Thank you for the fast fix :-)
,
Aug 26 2016
The crash from #6 is still occurring for me even with the patch from comment #11, I have a reproducible test case for it but it's at an internal URL. hubbe@, I'll send you the link separately.
,
Aug 26 2016
FYI, my test page works normally if I just comment out the failing DCHECK in HasSingleOrigin, but that's of course not suitable as a real fix.
,
Aug 26 2016
,
Aug 26 2016
#6 is really a separate problem and should have it's own bug.
,
Aug 26 2016
[Automated comment] Less than 2 weeks to go before stable on M53, manual review required.
,
Aug 26 2016
M53 is VERY close to Stable launch and bar is very high. We can take this change only if it is critical, well baked/verified in Canary and safe to merge. Please confirm. Thank you.
,
Aug 26 2016
The CL is small, simple and safe. It's been in canary for a day. I'd say the risk is very low. I'm not entirely sure how critical it is, as the use case is somewhat rare (video element data readback through a canvas where the video is cross-origin). Since I don't know how common a use case it is, but the risk is low, I would argue that we should merge the fix instead of risking a lot more bug reports later, but obviously the decision is up to you.
,
Aug 26 2016
Approving merge to M53 branch 2785 based on comment #19. Please merge ASAP. Merge has to happen before 4:00 PM PT Monday in order to make into the desktop Stable final build cut.Thank you.
,
Aug 26 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9e81a357b3656f2eed03c9bbfda106eb892d9ae8 commit 9e81a357b3656f2eed03c9bbfda106eb892d9ae8 Author: Fredrik Hubinette <hubbe@google.com> Date: Fri Aug 26 21:43:15 2016 Cherrypick Bugfix for cross-origin check The code is mistaking a missing reader for an error, but readers are now destroyed and re-created on demand. Adding a new variable to explicitly track failures fixes the problem. Original commit: https://crrev.com/5f8b274cdab547c8afff5429110a97d15353c19c BUG= 639690 Review URL: https://codereview.chromium.org/2283153002 . Cr-Commit-Position: refs/branch-heads/2785@{#766} Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382} [modify] https://crrev.com/9e81a357b3656f2eed03c9bbfda106eb892d9ae8/media/blink/multibuffer_data_source.cc [modify] https://crrev.com/9e81a357b3656f2eed03c9bbfda106eb892d9ae8/media/blink/multibuffer_data_source.h [modify] https://crrev.com/9e81a357b3656f2eed03c9bbfda106eb892d9ae8/media/blink/multibuffer_data_source_unittest.cc
,
Aug 30 2016
Verified this issue on Windows-10, Mac OS 10.11.6 and Ubuntu 14.04 using chrome latest Dev M54-54.0.2840.0 by following steps mentioned in the original comment. No errors are seen under console as mentioned in the comment #1 and all the screenshot displays true as expected. Hence adding TE-Verified label.
,
Aug 31 2016
Verified this issue on Windows-10, Mac OS 10.11.6 and Ubuntu 14.04 using chrome latest Beta M53-53.0.2785.89. As mentioned in the comment #22 no errors are seen under console and all the screenshot displays true as expected. Hence adding TE-Verified label.
,
Aug 31 2016
I have cross verified the fix on Win 7 and compared to current stable channel i.e., 52.0.2743.116 with 53.0.2785.89, there are no error in M53(53.0.2785.89).
,
Sep 12 2016
|
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by mifli...@gmail.com
, Aug 21 2016