This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25245 - Specify "access" in the context of getMediaDevices
Summary: Specify "access" in the context of getMediaDevices
Status: RESOLVED FIXED
Alias: None
Product: WebRTC Working Group
Classification: Unclassified
Component: Media Capture and Streams (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Stefan Hakansson LK
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-03 07:41 UTC by Harald Alvestrand
Modified: 2014-09-25 13:36 UTC (History)
8 users (show)

See Also:


Attachments

Description Harald Alvestrand 2014-04-03 07:41:01 UTC
The description of getMediaDevices says:

Collects information about the user agents available media input and output devices; for example a web camera or a headset. The method must only return information that the script is authorized to access (TODO expand authorized).

Expansion is needed.
Comment 1 Harald Alvestrand 2014-04-03 07:46:41 UTC
My understanding of previous discussions:

- All Web pages may enumerate devices; in the deviceInfoList returned, the "id" and "kind" fields are populated. I think this category also includes the "group".

- For any device where the JS would get access without an user prompt ("trusted" script, stored permissions or previously granted access), the "label" field will be populated.

I also believe we have decided that "deviceId" should be different for pages from different origins, so that one page cannot tell another page about devices (information leakage). This also hasn't been captured in the spec, as far as I can tell.
Comment 2 Ian 'Hixie' Hickson 2014-04-07 15:57:56 UTC
This is a fingerprinting vulnerability (it provides previously-unavailable unique bits to identify the user), and thus should be considered in a privacy context.

This is a potential abuse vulnerability (combined with other APIs, it allows the author to send content to remote speakers without the user's consent).

As a user, I would not want a Web page to be able to enumerate any devices I have without my explicit opt-in.
Comment 3 Martin Thomson 2014-04-07 17:08:27 UTC
(In reply to Ian 'Hixie' Hickson from comment #2)
> This is a fingerprinting vulnerability (it provides previously-unavailable
> unique bits to identify the user), and thus should be considered in a
> privacy context.

There has been a lot of thought put into this from a privacy perspective.  The actual exposure is limited to a count of devices of each type, plus, if we include "group" correlation of matched devices.

There's a tension here between usability and privacy.  I expect browsers to include controls that allow a user to control this exposure.
Comment 4 Jan-Ivar Bruaroey [:jib] 2014-04-09 15:49:15 UTC
(In reply to Martin Thomson from comment #3)
> There's a tension here between usability and privacy.

Perhaps a refresh of the usability would be helpful?
Comment 5 Martin Thomson 2014-04-09 16:48:10 UTC
The best usability argument I have to hand is this:

A user frequents a site that uses gUM, but does not provide persistent permissions (maybe because they use the peerIdentity constraint exclusively).  The site is able to use the device identifier, which is stable, to ensure that the same device is used every time.

The site is able to detect when that device is not available and use the device identifiers to provide predictable fallback behaviour.
Comment 6 Jan-Ivar Bruaroey [:jib] 2014-04-09 17:35:44 UTC
(In reply to Martin Thomson from comment #5)

That seems doable without this feature. gUM({sourceId:x}) fails == n/a detected.
Comment 7 Martin Thomson 2014-04-09 17:57:20 UTC
(In reply to Jan-Ivar Bruaroey [:jib] from comment #6)
> (In reply to Martin Thomson from comment #5)
> 
> That seems doable without this feature. gUM({sourceId:x}) fails == n/a
> detected.

True, for this case.  As long as you make it fail hard, gUM won't trigger the user prompt.  That's not true of some of the other use cases.  I know that I shouldn't have trouble summoning the details, but I am.  I'll have to get back to this.

"group" allows an application to select a paired camera and microphone.  It also prevents cases where audio output is directed to one set of headphones, and input is derived from the same.
Comment 8 Harald Alvestrand 2014-06-30 13:18:14 UTC
Suggested resolution:

Add a new section under 9.2 MediaDevices, called "Access control model".
Content:

The access to media device information depends on whether or not permission has been granted to the page's origin for use of any media devices.

If no such access has been granted, the MediaDeviceInfo dictionary will contain the deviceId, the kind and the groupId.

If access has been granted for any media device, the MediaDeviceInfo dictionary will contain the deviceId, the kind, the label and the groupId.

Add to the definition of "deviceId":

The unique id is valid for the page's origin only.
Comment 9 Jan-Ivar Bruaroey [:jib] 2014-08-26 17:04:34 UTC
Are we supposed to take it on faith that there are use-cases that require this feature?
Comment 10 Stefan Hakansson LK 2014-09-16 14:12:59 UTC
Pull request #8 addresses part of this.
Comment 11 Dominique Hazael-Massieux 2014-09-16 15:41:38 UTC
(In reply to Stefan Hakansson LK from comment #10)
> Pull request #8 addresses part of this.

I've updated PR 8 to add the missing bits, and fixing an incorrect understanding of when mediadeviceinfo gets exposed.
Comment 12 Stefan Hakansson LK 2014-09-25 13:36:02 UTC
Fixed in http://w3c.github.io/mediacapture-main/archives/20140924/getusermedia.html