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

[Feature Request] spoof label in MediaDeviceInfo #370

Closed
h6a8ke1k opened this issue May 13, 2020 · 3 comments
Closed

[Feature Request] spoof label in MediaDeviceInfo #370

h6a8ke1k opened this issue May 13, 2020 · 3 comments

Comments

@h6a8ke1k
Copy link

h6a8ke1k commented May 13, 2020

I think it is useful to fake MediaDeviceInfo.label, which contains the name of device after permission is granted. It could leak info about the audio driver and language.

Sometimes I have to grant permission to use microphone on some websites. So faking it can be more useful than completely disable media devices.

MediaDeviceInfo is returned in an array by navigator.mediaDevices.enumerateDevices() after resolving the Promise. I do not know if there are other ways to get this object. (But I believe it is the only way.)

Spoofing the name will not cause websites to malfunction because choosing a device depends only on MediaDeviceInfo.deviceId. It is also unnecessary to spoof other properties of MediaDeviceInfo such as the id because deviceId and groupId are arbitrary values and will change after cleaning cookies and restart.

I am not sure what is best to replace the original string. It is undefined if permission is not granted, so maybe keep the label to be undefined is fine. Or we can use general names depending on MediaDeviceInfo.kind, e.g. Webcam for "videoinput", Microphone for "audioinput", and Speaker for "audiooutput". Or using real common names (e.g. "Microphone (Common Audio Driver)").

A potential downside of this spoof is that we can only see identical names for different devices if the website offers options for us to choose a device. But for me, I only have at most one microphone and one webcam, so it is not a problem. For people having multiple input devices, they can disable excessive ones in the system configuration; or turn off this spoof. So I think there are few negative effects by this spoof. (If there is a problem by having identical labels, then we can add a number after the same kind of device. e.g. "Webcam 1", "Webcam 2", ... But I am not sure if it makes users easier to be identified. Another option is to keep at most one device per category to avoid this problem and prevent users to be identified by the number of devices. But I have not tested if it is possible to infer default device from the list returned by enumerateDevices.)

@sereneblue
Copy link
Owner

Hi @h6a8ke1k,

Nice request! This seems simple to implement. I suppose the names would vary depending on the browser profile being used? Ex. Macs have a specific audio device, iOS devices, PCs, etc. I'll have to collect some info first.

@sereneblue
Copy link
Owner

@h6a8ke1k

Just a quick update.

I am able to spoof the labels. I'm currently collecting values from different platforms to properly spoof the values. This feature should be available in Chameleon soon.

@sereneblue
Copy link
Owner

@h6a8ke1k This feature has been added to v0.20.22. It only spoofs the audio input/video input. There are some edge case scenarios. For example, using an Android profile, you'd usually have 1 mic, and 2 cameras. It'll still spoof the camera label, but there should be 2 cameras (front/back). This should be a "good enough" solution for users who want to use it. You can test it out here.

This issue was closed.
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

2 participants