Ambiguity in Risk of Exporting FirebaseMessagingService-type Services Without Permissions
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- android
- Lĩnh vực
- mobile-dev, security
Hướng nghiên cứu
Xem xét pull request #850, các khai báo FirebaseMessagingService trong manifest và các kiểm tra thời gian chạy được ghi lại, được tham chiếu trong issue. Xác nhận liệu một service được export mà không có quyền có gây ra rủi ro thực sự hay không, sau đó cập nhật sample hoặc tài liệu liên quan để cấu hình dự kiến và cơ sở bảo mật được nêu rõ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)?
- Ngôn ngữ chính
- Kotlin
- Star
- 9.3k
- Fork
- 7.4k
- Merge trung bình
- 7 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/quickstart-android
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
firebase/quickstart-android#2756 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
firebase/quickstart-android#2754 · 5 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
firebase/quickstart-android#2668 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
firebase/quickstart-android#2663 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
firebase/quickstart-android#1669 · 3 bình luận ·
Tất cả issue của firebase/quickstart-android
Issue tương tự
-
android:plan main:plan packages:learn
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ankidroid/Anki-Android#23453 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
afk-ok area:data-quality importer size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
enorm-labs/event-junkie#5278 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
bazel-contrib/rules_kotlin#1846 ·
Maintainer thường phản hồi trong vòng 2 ngày