Ambiguity in Risk of Exporting FirebaseMessagingService-type Services Without Permissions
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- android
- 領域
- mobile-dev, security
調査の方向性
Pull request #850、FirebaseMessagingService の manifest 宣言、および issue で参照されているドキュメント化された実行時チェックを確認してください。権限のない exported service が実際のリスクになるかどうかを確認し、そのうえで、想定される構成とセキュリティ上の根拠が明確になるよう、該当するサンプルまたはドキュメントを更新してください。
索引モデルが issue の本文から書いたものです。
説明
I have a general question.
This pull request: https://github.com/firebase/quickstart-android/pull/850
explicitly disables the export of the sample FirebaseMessaging Service, i.e.
<service
android:name=".java.MyFirebaseMessagingService"
android:exported="false">
because, and it says, "Set FirebaseMessagingServices to exported="false" to explicitly
prevent other apps from being able to send messages to it."
This is a good practice, but other documentation (see e.g. https://stackoverflow.com/a/43991861) notes that runtime checks (in the FCM code) prevent other applications from calling into this Service arbitrarily.
Experimentally, this seems to be the case:
- Create some app that extends the FirebaseMessaging class, and notes the following block in its manifest
<service android:name=".java.MyFirebaseMessagingService">
<service
android:name=".java.MyFirebaseMessagingService"">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
which was the default before the noted PR.
-
Set a breakpoint on the extended class's onMessageReceived method, in e.g. Android Studio
-
Run the application under Debug, foreground it, and issue the following ADB command (with suitably replaced options) to start the Service with an intent
adb shell am startservice -n com.test.android.app/com.foo.java.MyFirebaseMessagingService -a com.google.firebase.MESSAGING_EVENT
- Notice that your breakpoint is not hit, even though the Intent was sent successfully
This was repeated with various intent extras, as well. And with runtime method hooking of onMessageReceived with https://www.frida.re/, to log if it is called.
So, just wondering if someone could clear up this ambiguity-- is it actually a risk to export said service (i.e. com.google.firebase.messaging.FirebaseMessagingService and classes that extend it) without permissions (as the PR implies), or is it not (as the noted documentation states)?
- 主要言語
- Kotlin
- スター
- 9.3k
- フォーク
- 7.4k
- 平均マージ
- 7日 9時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/quickstart-android のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
firebase/quickstart-android#2756 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
firebase/quickstart-android#2754 · コメント 5 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
firebase/quickstart-android#2668 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
firebase/quickstart-android#2663 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
firebase/quickstart-android#1669 · コメント 3 件 ·
firebase/quickstart-android の issue をすべて見る
似ている issue
-
android:plan main:plan packages:learn
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
afk-ok area:data-quality importer size:S
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
enorm-labs/event-junkie#5278 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
LeanBitLab/LeanType#864 ·
メンテナーはふだん 1 日以内に返信
-
Comment NEW RI+MC+RR
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100