Security: protect EventsReceiver with signature-level permission#342
Security: protect EventsReceiver with signature-level permission#342jdickey1 wants to merge 1 commit into
Conversation
The EventsReceiver BroadcastReceiver was declared exported=true in the manifest without any permission protection. This allowed any app on the device to send forged ACTION_SENT/ACTION_DELIVERED intents to manipulate message delivery state in the database. Add a signature-level custom permission (me.capcom.smsgateway.permission.SMS_STATUS) to the receiver declaration so only the app itself (or apps signed with the same key) can send these intents. Also add explicit android:exported="false" to WebService which was missing the attribute. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughA custom permission with signature-level protection was introduced. The Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hello! Thank you for your PR. However, to exploit this vulnerability, you'll need access to the device to install an additional app. You'll then need to know the message ID and phone number for the spoofing. Marking a message as "Failed" won't trigger a DoS attack, as the app itself doesn't allow for retries. I'll review the PR in more detail later. |
|
This PR is stale because it has been open for 7 days with no activity. |
Summary
EventsReceiverto prevent message state spoofing by other appsandroid:exported="false"toWebServicedeclarationProblem
The
EventsReceiverBroadcastReceiver is declaredandroid:exported="true"without permission protection. Any app on the device can send forgedACTION_SENT/ACTION_DELIVEREDintents with arbitrarydataString(parsed as"$id|$phoneNumber") andresultCodeto:Fix
Declare a custom permission with
android:protectionLevel="signature"and apply it to the receiver. This ensures only the SMS Gateway app itself (or apps signed with the same certificate) can trigger delivery state updates.Test plan
ACTION_SENTintent is blocked by the permission🤖 Generated with Claude Code
Summary by CodeRabbit