From ceb90c636ce0d766f80cfcd522bb27b37e6d37c9 Mon Sep 17 00:00:00 2001 From: Hall Liu Date: Thu, 20 Aug 2020 19:06:57 -0700 Subject: Fix exported broadcast receiver vulnerability CellBroadcastReceiver was declared as exported in the manifest and therefore allowed any app to send a MARK_AS_READ intent, even though it's only supposed to be called from an internal PendingIntent. Fix this by creating a new non-exported receiver and using that to handle the mark-as-read intent instead. Fixes: 162741784 Test: atest GoogleCellBroadcastReceiverUnitTests Change-Id: I03c8163c22a6fbc92613ca2ccd2ac191fc0084a4 Merged-In: I03c8163c22a6fbc92613ca2ccd2ac191fc0084a4 (cherry picked from commit e514bc6a01fdd36a519fd4fefffa45f166911c97) (cherry picked from commit db3208b69c1debcc0746df99a4c7cab02c3c52f0) (cherry picked from commit e2a3f5f51bf6723d54599e5fa81577f6b9465116) --- AndroidManifest.xml | 5 ++ AndroidManifest_Platform.xml | 5 ++ .../CellBroadcastAlertService.java | 13 ++--- .../CellBroadcastInternalReceiver.java | 56 +++++++++++++++++++ .../CellBroadcastReceiver.java | 6 ++- .../unit/CellBroadcastInternalReceiverTest.java | 63 ++++++++++++++++++++++ .../unit/CellBroadcastReceiverTest.java | 9 ---- 7 files changed, 140 insertions(+), 17 deletions(-) create mode 100644 src/com/android/cellbroadcastreceiver/CellBroadcastInternalReceiver.java create mode 100644 tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastInternalReceiverTest.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index d3c6ebe8c..0c01772e3 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -140,6 +140,11 @@ + + + + + + + +