Skip to content

Commit

Permalink
Insecure Register Receiver Flag
Browse files Browse the repository at this point in the history
  • Loading branch information
elyousfi5 committed Jan 22, 2024
1 parent efad24f commit f317d9a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The application calls the registerReceiver method with the argument flags set to RECEIVER_EXPORTED, which can be exploitable as it exposes the BroadcastReceiver to external applications, potentially leading to unauthorized access and security vulnerabilities.

=== "Java"
```java
context.registerReceiver(broadcastReceiver, intentFilter, RECEIVER_EXPORTED);
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"risk_rating": "medium",
"short_description": "The application calls the registerReceiver method with the argument flags set to RECEIVER_EXPORTED.",
"references": {
"Shared Preferences (Android Developer)": "https://developer.android.google.cn/about/versions/13/features#runtime-receivers"
},
"title": "Insecure Register Receiver Flag",
"privacy_issue": false,
"security_issue": true,
"categories": {
"OWASP_MASVS_L1": [
"MSTG_PLATFORM_4"
],
"OWASP_MASVS_L2": [
"MSTG_PLATFORM_4"
],
"GDPR": [
"ART_32"
],
"PCI_STANDARDS":[
"REQ_2_2",
"REQ_6_2",
"REQ_6_3",
"REQ_11_3"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
To mitigate risks associated with exporting receivers in Android applications, export only when essential. Additionally, ensure the exported BroadcastReceiver is protected with the necessary permissions to minimize potential security vulnerabilities.

=== "XML"
```xml
<receiver android:name=".MyReceiver" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.ACTION1" />
<action android:name="android.intent.action.ACTION2" />
</intent-filter>
</receiver>
```

0 comments on commit f317d9a

Please sign in to comment.