🐛 [firebase_messaging] Pentest finding - Push notifications persisted in plain text on Android #7512
Labels
platform: android
Issues / PRs which are specifically for Android.
plugin: messaging
type: bug
Something isn't working
Bug report
When pentesting our Flutter app a finding was reported that the Android app stores all push notifications including the full payload in plain text on the file system at
<appId>/shared_prefs/io.flutter.plugins.firebase.messaging.xml
. Checking the plugin code I can see that all push notifications are passed through theFlutterFirebaseMessagingReceiver
so that theFlutterFirebaseMessagingStore
can store the 20 most recent usingSharedPreferences
. I can also see that they are only removed from storage whenFlutterFirebaseMessagingPlugin::getInitialMessage
is called, cannot find a message in memory and has to retrieve it from the persisted store (which seems to happen rarely).Steps to reproduce
Steps to reproduce the behavior:
adb shell run-as io.flutter.plugins.firebase.messaging.example cat shared_prefs/io.flutter.plugins.firebase.messaging.xml
to see the contents of the persisted messaging store.Expected behavior
I'm not sure about the best solution to remediate this issue but I see a couple of possibilities:
Sample project
See the example app of the firebase_messaging plugin.
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: