Trac: Summary: Investigate updated device orientation codeI for possible information leaks to Investigate updated device orientation code for possible information leaks
We do have fingerprinting protection for "screen orientation" and related events, but in fact we never introduced specific protection for "device orientation" events. We did, however, disable device sensor readings in general in #15758 (moved) by setting "device.sensors.enabled" to false. These sensors may include:
In TBB 7.0a3's JS console, I see four relevant APIs:
DeviceLightEvent
DeviceMotionEvent
DeviceOrientationEvent
DeviceProximityEvent
Despite the presence of these interfaces, the Mozilla code appears to suggest that disabling "device.sensors.enabled" should result in no such events being generated from sensor hardware, because sensor observers are never registered. Unfortunately I don't currently have a laptop with such sensors (do these exist?) so I can't do a manual test. Maybe we can find a hook for simulating sensor data.
Also, this should be a particularly useful thing to examine on Orfox. Ideally these sensors would be behind a permission that is requested if a content script calls, for example, addEventListener("deviceorientation", ...).
I have changed the title to cover all device sensor code.
Trac: Cc: mcs, brade to mcs, brade, arthuredelstein Summary: Investigate updated device orientation code for possible information leaks to Investigate device sensor code for possible information leaks
On a MacBook Pro, devicelight events are generated but only after I changed device.sensors.enabled to true and restarted the browser. deviceorientation events are not generated; I think those require an accelerometer.
There is a Boolean pref device.sensors.test.events that you can set to true to cause a fake sensor event to be generated (that happens the first time a sensor-related event listener is registered). This also has no effect if device.sensors.enabled = false.
On a Lenovo convertible laptop running Windows 10 (which supports rotation to all four screen orientations) I could not generate either event, even when in tablet mode. In Chrome I see one deviceorientation event but it does not contain useful data.
I am confident that all of these events are disabled by device.sensors.enabled = false. Search for mEnabled within dom/system/nsDeviceSensors.cpp.
I looked at the code in dom/system/nsDeviceSensors.cpp agree with mcs that these events are disabled by device.sensors.enabled = false. So I think we can close this ticket without any additional patch.
Trac: Status: new to needs_review Keywords: TorBrowserTeam201705 deleted, TorBrowserTeam201705R added