Skip to content

Commit 166d683

Browse files
committed
Make low storage notification PendingIntent immutable
Malicious apps, especially NotificationListeners can hijack such intents and grant themselves access to sensitive URIs by relying on the OS URI granting mechanism. This change mitigates the security issue and also adheres to the new enforcement requiring Android S+ targeting apps to explicitly specifiy a mutability flag. Test: Manual Bug: 153466381 Change-Id: If478386d68cf25c8f93c2685824700679e6b9ea9 (cherry picked from commit df9a44e1fb3968c6e3121aa76515a58f5e69fbee)
1 parent 5c2d5cd commit 166d683

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

services/core/java/com/android/server/storage/DeviceStorageMonitorService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ private void updateNotifications(VolumeInfo vol, int oldLevel, int newLevel) {
491491
com.android.internal.R.string.low_internal_storage_view_text);
492492
}
493493

494-
PendingIntent intent = PendingIntent.getActivityAsUser(context, 0, lowMemIntent, 0,
495-
null, UserHandle.CURRENT);
494+
PendingIntent intent = PendingIntent.getActivityAsUser(context, 0, lowMemIntent,
495+
PendingIntent.FLAG_IMMUTABLE, null, UserHandle.CURRENT);
496496
Notification notification =
497497
new Notification.Builder(context, SystemNotificationChannels.ALERTS)
498498
.setSmallIcon(com.android.internal.R.drawable.stat_notify_disk_full)

0 commit comments

Comments
 (0)