Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deny captureStream for cross-origin media by default #70

Closed
shhnjk opened this issue Feb 16, 2018 · 6 comments
Closed

Deny captureStream for cross-origin media by default #70

shhnjk opened this issue Feb 16, 2018 · 6 comments

Comments

@shhnjk
Copy link
Member

shhnjk commented Feb 16, 2018

Per spec, it is allowed to captureStream() cross-origin media contents. But I don't see much benefit from it. Instead, there are many risks. Media related APIs are growing and it's complicated for browsers to allow captureStream of cross-origin media yet deny leaking information. Stream can be passed from video <-> canvas, or to WebRTC peer, etc.

Chrome denies to captureStream for cross-origin media contents today. Where Firefox allows it.
I think we should stick to Chrome's behavior and change the spec.

Test
https://test.shhnjk.com/whycapture.html

@shhnjk
Copy link
Member Author

shhnjk commented Feb 21, 2018

CC: @mikewest @annevk @dveditz

@annevk
Copy link
Member

annevk commented Feb 21, 2018

As long as the <canvas> is tainted how is this different from drawImage() doing a similar thing?

@shhnjk
Copy link
Member Author

shhnjk commented Feb 21, 2018

This is media stream, so there's no requirement of canvas. It is similar to drawImage, but the spec doesn't have nice concept like "origin-clean flag". So any new media API that can retrieve data from stream (or streamTrack, and more) could potentially leak the data.

@shhnjk
Copy link
Member Author

shhnjk commented Feb 21, 2018

So in that sense, I don't have much problem with HTMLCanvasElement.captureStream() because UA can check "origin clean flag" of canvas. But I'm worried about HTMLMediaElement.captureStream().

@guest271314
Copy link

What are the risks with capturing cross-origin media content?

@shhnjk
Copy link
Member Author

shhnjk commented Mar 31, 2018

Potential of stealing cross-origin media file. But seems like there are more APIs that has ability to do it. So closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants