New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 899745 link

Starred by 4 users

Issue metadata

Status: Duplicate
Merged: issue 901383
Owner: ----
Closed: Nov 8
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

CORS error when attempting to load an audio element that gets redirected (302) into an audio context

Reported by dhein...@gmail.com, Oct 29

Issue description

Chrome Version       : 71.0.3578.20
URLs (if applicable) :
Other browsers tested:
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari: OK 12.0 (13606.2.11)
    Firefox: OK 62.0.3
       Edge: OK 41.16299.726.0

What steps will reproduce the problem?
(1) Create an audio element where the source is on the same origin as the current page, but does a 302 redirect to a different origin to load the actual audio file
(2) Attach the audio element to an audio context using createMediaElementSource

What is the expected result?
The audio file is loaded and can be played.

What happens instead?
The audio file cannot be played due to a CORS restriction (MediaElementAudioSource outputs zeroes due to CORS access restrictions for ...)


Please provide any additional information below. Attach a screenshot if
possible.

This only seems to happen if there is a redirect.  If I set the source of the audio element to the remote origin directly, it loads without error.  Setting or not setting the crossorigin attribute of the audio element does not seem to have any impact.

Page origin: audiotest.localhost
Audio source: audiotest.localhost -> audiotest-cdn.localhost # CORS error!
Audio source: audiotest-cdn.localhost # OK
Audio source: audiotest-cdn.loaclhost -> audiotest-othercdn.localhost # CORS error!

In addition to the other browsers tested, verified this error does not occur in Chrome v70.

Sample program and screenshot attached

 
audio-redirect-screenshots.docx
297 KB Download
Simple repro of this issue: https://github.com/djh-od/chrome-audio-302-test
Labels: Needs-Triage-M71
Cc: swarnasree.mukkala@chromium.org
Labels: Needs-Feedback Triaged-ET
Tried testing the issue on reported chrome version #71.0.3578.20 using Surface Pro Windows 10 by following below steps.

Steps:
=====
1.Launched chrome.
2.Downloaded and extracted the file from "https://github.com/djh-od/chrome-audio-302-test".
3.Started a localhost:8000.
4.Opened "audio-302.htm" file and clicked on the Play button, observed that audio being played.
5.Under console tab observed no errors. 

Attached screencast for reference.
@reporter: Could you please review the attached screencast and let us know if anything is being missed here and request you to specify the OS in which issue is seen.
Thanks.!
899745.mp4
2.4 MB View Download
The issue occurs when the source of the audio element is redirected (see https://github.com/djh-od/chrome-audio-302-test/blob/master/README.md for more description of the scenarios where it works and where it does not).  Attached is a screen shot that shows the error that occurs when there is a redirect and that it works when there is no redirect.  
chrome-audio-redirect-bug.mp4
343 KB View Download
Project Member

Comment 5 by sheriffbot@chromium.org, Nov 5

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: yhirano@chromium.org
Components: Blink>SecurityFeature>CORS
Mergedinto: 901383
Status: Duplicate (was: Unconfirmed)
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/657a055a66492e996b296d7bb999e3c8551eed23

commit 657a055a66492e996b296d7bb999e3c8551eed23
Author: Yutaka Hirano <yhirano@chromium.org>
Date: Fri Nov 09 00:52:55 2018

[media] Treat cross-origin redirect as TAINTED only for no-cors requests

With https://crrev.com/a9cbaa7a40e2b2723cfc2f266c42f4980038a949,
WebMediaPlayer blindly treats a resource experiencing cross-origin
redirects as TAINTED. In fact, it should be treated as TAINTED only
when its request mode is "no-cors".

The added tests are provided by hongchan@chromium.org.

Bug:  899745 ,  901383 
Change-Id: Idb66407552085b053818f3e4a9d8d5ff3ddeaf45
Reviewed-on: https://chromium-review.googlesource.com/c/1325281
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: Fredrik Hubinette <hubbe@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606681}
[modify] https://crrev.com/657a055a66492e996b296d7bb999e3c8551eed23/media/blink/multibuffer_data_source.cc
[modify] https://crrev.com/657a055a66492e996b296d7bb999e3c8551eed23/media/blink/multibuffer_data_source.h
[modify] https://crrev.com/657a055a66492e996b296d7bb999e3c8551eed23/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/657a055a66492e996b296d7bb999e3c8551eed23/media/blink/webmediaplayer_impl.h
[add] https://crrev.com/657a055a66492e996b296d7bb999e3c8551eed23/third_party/WebKit/LayoutTests/external/wpt/webaudio/js/worklet-recorder.js
[add] https://crrev.com/657a055a66492e996b296d7bb999e3c8551eed23/third_party/WebKit/LayoutTests/external/wpt/webaudio/resources/4ch-440.wav
[add] https://crrev.com/657a055a66492e996b296d7bb999e3c8551eed23/third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/cors-check.https.html
[add] https://crrev.com/657a055a66492e996b296d7bb999e3c8551eed23/third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/no-cors.https.html

Project Member

Comment 9 by bugdroid1@chromium.org, Nov 9

Labels: merge-merged-3578
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c3aa434fe1fc3c69fd86b03267c7cae747c9440b

commit c3aa434fe1fc3c69fd86b03267c7cae747c9440b
Author: Yutaka Hirano <yhirano@chromium.org>
Date: Fri Nov 09 16:47:20 2018

[media] Treat cross-origin redirect as TAINTED only for no-cors requests

With https://crrev.com/a9cbaa7a40e2b2723cfc2f266c42f4980038a949,
WebMediaPlayer blindly treats a resource experiencing cross-origin
redirects as TAINTED. In fact, it should be treated as TAINTED only
when its request mode is "no-cors".

The added tests are provided by hongchan@chromium.org.

TBR=yhirano@chromium.org

(cherry picked from commit 657a055a66492e996b296d7bb999e3c8551eed23)

Bug:  899745 ,  901383 
Change-Id: Idb66407552085b053818f3e4a9d8d5ff3ddeaf45
Reviewed-on: https://chromium-review.googlesource.com/c/1325281
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: Fredrik Hubinette <hubbe@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#606681}
Reviewed-on: https://chromium-review.googlesource.com/c/1329801
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/branch-heads/3578@{#613}
Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034}
[modify] https://crrev.com/c3aa434fe1fc3c69fd86b03267c7cae747c9440b/media/blink/multibuffer_data_source.cc
[modify] https://crrev.com/c3aa434fe1fc3c69fd86b03267c7cae747c9440b/media/blink/multibuffer_data_source.h
[modify] https://crrev.com/c3aa434fe1fc3c69fd86b03267c7cae747c9440b/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/c3aa434fe1fc3c69fd86b03267c7cae747c9440b/media/blink/webmediaplayer_impl.h
[add] https://crrev.com/c3aa434fe1fc3c69fd86b03267c7cae747c9440b/third_party/WebKit/LayoutTests/external/wpt/webaudio/js/worklet-recorder.js
[add] https://crrev.com/c3aa434fe1fc3c69fd86b03267c7cae747c9440b/third_party/WebKit/LayoutTests/external/wpt/webaudio/resources/4ch-440.wav
[add] https://crrev.com/c3aa434fe1fc3c69fd86b03267c7cae747c9440b/third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/cors-check.https.html
[add] https://crrev.com/c3aa434fe1fc3c69fd86b03267c7cae747c9440b/third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/no-cors.https.html

Labels: Merge-Merged-71-3578
The following revision refers to this bug: 
https://chromium.googlesource.com/chromium/src.git/+/c3aa434fe1fc3c69fd86b03267c7cae747c9440b

Commit: c3aa434fe1fc3c69fd86b03267c7cae747c9440b
Author: yhirano@chromium.org
Commiter: yhirano@chromium.org
Date: 2018-11-09 16:47:20 +0000 UTC

[media] Treat cross-origin redirect as TAINTED only for no-cors requests

With https://crrev.com/a9cbaa7a40e2b2723cfc2f266c42f4980038a949,
WebMediaPlayer blindly treats a resource experiencing cross-origin
redirects as TAINTED. In fact, it should be treated as TAINTED only
when its request mode is "no-cors".

The added tests are provided by hongchan@chromium.org.

TBR=yhirano@chromium.org

(cherry picked from commit 657a055a66492e996b296d7bb999e3c8551eed23)

Bug:  899745 ,  901383 
Change-Id: Idb66407552085b053818f3e4a9d8d5ff3ddeaf45
Reviewed-on: https://chromium-review.googlesource.com/c/1325281
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: Fredrik Hubinette <hubbe@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#606681}
Reviewed-on: https://chromium-review.googlesource.com/c/1329801
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/branch-heads/3578@{#613}
Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034}
Cc: susan.boorgula@chromium.org
 Issue 911179  has been merged into this issue.

Sign in to add a comment