Ambiguity in Risk of Exporting FirebaseMessagingService-type Services Without Permissions
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 文档
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- android
- 领域
- mobile-dev, security
调研方向
检查 pull request #850、FirebaseMessagingService 的 manifest 声明,以及 issue 中引用的已记录运行时检查。确认没有权限的导出 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 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 个 reaction ·
-
难度 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 天内回复
-
Needs Triage
难度 2/5 1-3 小时 新手友好度 72/100
ankidroid/Anki-Android#23453 ·
维护者通常 1 天内回复
-
afk-ok area:data-quality importer size:S
难度 2/5 1-3 小时 新手友好度 78/100
enorm-labs/event-junkie#5278 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
bazel-contrib/rules_kotlin#1846 ·
维护者通常 2 天内回复