The page asks for the user's location, camera, microphone or permission to notify
What it finds
Location, camera, microphone and notifications are powerful permissions. Asking for them, especially on load and not in reply to a user's action, is intrusive, gets denied and, once granted, exposes sensitive data to every script of the page.
Reported are calls of getCurrentPosition and watchPosition on navigator.geolocation, getUserMedia and getDisplayMedia on navigator.mediaDevices, and Notification.requestPermission.
From the rule's source, asks_device_permission.rs.
export function locate(done: (p: GeolocationPosition) => void) { navigator.geolocation.getCurrentPosition(done);tx0 reports: this asks for the user's location} Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/ts:asks-device-permission" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:asks-device-permission] reason="..."tx0 explain tx0/ts:asks-device-permission shows the same in the terminal. Found a false positive? Report it.