DP-3T / dp3t-sdk-android

The DP3T-SDK for Android
Mozilla Public License 2.0
242 stars 94 forks source link

Whats the goal of listening to the EXPOSURE_NOTIFICATION_SETTINGS broadcast? #171

Closed albertovecina closed 4 years ago

albertovecina commented 4 years ago

Google is reporting us to remove the receiver action for this broadcast. I don't understand what's the goal for this and I don't know when this broadcast is emitted because I can't find It in the docs.

https://github.com/DP-3T/dp3t-sdk-android/blob/a59b4b563b4cd26637eaa8de85a277c21f8c0d75/dp3t-sdk/sdk/src/main/AndroidManifest.xml#L34 https://github.com/DP-3T/dp3t-sdk-android/blob/e721c62f08e91f0eaee39f3521d9cae26bd8ff5b/dp3t-sdk/sdk/src/main/java/org/dpppt/android/sdk/internal/nearby/ExposureNotificationBroadcastReceiver.java#L52

fbzli commented 4 years ago

This appears to be an error, since ACTION_EXPOSURE_NOTIFICATION_SETTINGS is not a broadcast action, but the action to open the Exposure Notifications settings screen.

Thanks for bringing this up. We're going to remove this from the broadcast receiver.

albertovecina commented 4 years ago

Thanks. In addition, a security report told us to review this exported param in the receiver registration:

https://github.com/DP-3T/dp3t-sdk-android/blob/a59b4b563b4cd26637eaa8de85a277c21f8c0d75/dp3t-sdk/sdk/src/main/AndroidManifest.xml#L30

I think is not necessary because that exported value is already managed by the permission. May I be wrong?

Thanks.

fbzli commented 4 years ago

The receiver has to be exported so it can be called by the EN system. Though it is exported by default, since it has an intent-filter, so the exported="true" is not required, but we'll leave it to make it explicit.

From a security standpoint the receiver is protected by the permission, so no other app can spoof it.