Android security tags, read closely by Lightrion

CVE-2024-40661 AI-generated analysis

platform/packages/modules/Permission, PermissionController (admin runtime permission grant path, PermissionControllerServiceImpl / AdminRestrictedPermissionsUtils)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (6 corrections). Verify against the commit before relying on it.

AdminRestrictedPermissionsUtils.mayAdminGrantPermission now takes the permission group name and no longer returns true early when either the permission itself or any platform permission in its group is an admin-restricted sensor permission. This stops an admin without sensor-grant authority from granting into a sensor permission group through a permission that is not itself on the restricted list.

Root cause

In PermissionControllerServiceImpl (the grant-state handler around line 563), the PERMISSION_GRANT_STATE_GRANTED branch allowed the grant only if AdminRestrictedPermissionsUtils.mayAdminGrantPermission(perm.getName(), canAdminGrantSensorsPermissions, isManagedProfile, dpm) returned true. That method returned true early for any permission whose exact name was not in ADMIN_RESTRICTED_SENSORS_PERMISSIONS (location, camera, record audio, activity recognition, body sensors, plus the S and T additions), and it ignored the permission group. The grant then runs through the AppPermissionGroup (perm.setPolicyFixed(true) and group.grantRuntimePermissions(...)). So a permission in a restricted sensor group (for example android.permission-group.MICROPHONE) that was not itself on the list passed the check even when canAdminGrantSensorsPermissions was false.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to November 2024 · Findings