A WebView grants location access to every page that asks
What it finds
onGeolocationPermissionsShowPrompt asks whether a page may read the device location. Answering callback.invoke(origin, true, ...) without looking at the origin hands the location to any site the web view loads.
From the rule's source, geolocation_granted.rs.
class Chrome : WebChromeClient() { override fun onGeolocationPermissionsShowPrompt(origin: String, callback: GeolocationPermissions.Callback) { callback.invoke(origin, true, false)tx0 reports: every origin is given the device location }} class CarefulChrome : WebChromeClient() { override fun onGeolocationPermissionsShowPrompt(origin: String, callback: GeolocationPermissions.Callback) { if (origin == TRUSTED) callback.invoke(origin, true, false) else callback.invoke(origin, false, false) }} Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/kotlin:geolocation-granted-to-every-origin" = "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/kotlin:geolocation-granted-to-every-origin] reason="..."tx0 explain tx0/kotlin:geolocation-granted-to-every-origin shows the same in the terminal. Found a false positive? Report it.