exported_component_without_permission
Reports an Android component that any app on the device can start. Stop exporting it, or protect it with a permission.
- Kind
- project-file check
- Tier
- advisory
- Host
- command-line program only (
assay project-files) - Lowest preset
- every preset (on unless switched off)
- Fix
- none
- Security class
- CWE-926 · mobile risk M8 (security misconfiguration) · severity 5.3
What it reports
Section titled “What it reports”An Android component that any app on the device can start, in a manifest a release build is made of: android/app/src/main/AndroidManifest.xml or android/app/src/release/AndroidManifest.xml.
- a
<service>,<receiver>or<provider>writtenandroid:exported="true"with noandroid:permission, with or without a filter of intents. A provider must also have noandroid:readPermissionand noandroid:writePermission. - an
<activity>or<activity-alias>writtenandroid:exported="true"with noandroid:permissionand no<intent-filter>.
The result stands at android:exported="true" and names the component:
- “The service .Sync is exported with no permission: any app on the device can start it or bind to it.”
- “The broadcast receiver .Boot is exported with no permission: any app on the device can send it a broadcast.”
- “The content provider .Orders is exported with no permission: any app on the device can read and change its data.”
- “The activity .Admin is exported with no permission and no filter of intents: any app on the device can start it by its name.”
It does not report:
- an activity with a filter of intents, such as Flutter’s
MainActivity, which the launcher starts by its filter; - a media service or receiver that other apps’ media controllers reach (see Details);
- a component with no
android:exportedat all, or withandroid:exported="false"; - a component covered by
android:permissionon<application>; - the manifests of the
debugandprofilesource sets.
A receiver whose filter names only a broadcast that the system alone sends, such as android.intent.action.BOOT_COMPLETED, is reported: a receiver that is not exported still receives the system’s broadcasts, so write false. Another component that the platform’s callers need exported, such as a widget receiver that a launcher’s host updates, is reported like any other: keep it in the baseline. The main and the release manifest are each judged as written, so a release manifest that changes a component of the main one does not silence its result.
An exported component is an entry point every app on the device can reach: another app can open the activity with any extras, start or bind to the service and call it, send the receiver forged broadcasts, or query and change the provider’s data. Without a permission, the component has to check every caller itself, which it rarely does. A component that only your app starts needs no export; one that your other apps start needs a permission of the signature level.
Example
Section titled “Example”<service android:name=".SyncService" android:exported="true"/><service android:name=".SyncService" android:exported="false"/>or, where other apps of yours start it, with a permission they hold:
<permission android:name="com.example.shop.permission.SYNC" android:protectionLevel="signature"/><service android:name=".SyncService" android:exported="true" android:permission="com.example.shop.permission.SYNC"/>Configuration
Section titled “Configuration”Under assay.project_files of the project’s root analysis_options.yaml:
| Key | Default | Effect |
|---|---|---|
enabled |
true |
false (or the short form exported_component_without_permission: false) switches the check off. |
exclude |
[] |
Path globs, from the project root, where the check places no result. |
How to run it
Section titled “How to run it”assay project-files runs it with the other project-file checks, and assay project-files exported_component_without_permission runs it alone. The gate and the baseline commands run it too, as an advisory result that never fails the gate (see Project-file checks). assay check does not.
Keeping a result
Section titled “Keeping a result”No suppression comment applies. Keep in the baseline a component that other apps must reach with no permission, and that checks its callers itself, if it is not one of the media components the check leaves alone.
Details
Section titled “Details”All cases
What it does not report in full
Section titled “What it does not report in full”-
An activity with a filter of intents. It is exported to work: the launcher starts the main activity by its filter, a deep link reaches one by its filter. Flutter’s template exports its
MainActivitythis way. -
A media service or receiver that other apps’ media controllers reach. Every filter of intents must name at least one action, and only these:
- for a service:
android.media.browse.MediaBrowserService,androidx.media3.session.MediaSessionService,androidx.media3.session.MediaLibraryService,android.intent.action.MEDIA_BUTTON; - for a receiver:
android.intent.action.MEDIA_BUTTON.
The system’s media controls, Google Assistant, Bluetooth devices, watches and cars reach these, and none holds a permission the app could ask for. Android’s media guides (“Building a media browser service”, “Responding to media buttons”, Media3’s “Background playback with a MediaSessionService”) declare them exported and have the app choose its callers in the session (
onGetRoot,MediaSession.ControllerInfo.isTrusted()). A filter that adds an action of the app’s own, a second filter that does, or a filter with no action, is reported. - for a service:
-
No
android:exportedat all, the platform’s default. A component with no filter is not exported, and for apps that target Android 12 and later, as current Flutter apps do, the build refuses one with a filter and no value. -
A permission of the application:
android:permissionon<application>applies to each component that has none of its own. -
a component that a build-tools marker removes from the merged manifest,
tools:node="remove"or"removeAll"; -
android:exported="false", or a value that refers to a resource; -
the manifests of the
debugandprofilesource sets.
Security class
Section titled “Security class”In SARIF, the check’s descriptor carries the tags security, external/cwe/cwe-926 and external/owasp-mobile-2024/m8, and the security-severity 5.3. No other report changes.