Safeguard
Application Security•

CWE-926 Improper Export of Android Application Components

Exported activities, services and content providers can be used by any app on the device. CWE-926 explained with the manifest settings that close the gap.

Safeguard Security Team
2 min read

CWE-926, Improper Export of Android Application Components, covers an Android app that exports a component for other apps but does not restrict which apps can launch it or reach its data. It is a common finding in mobile app reviews.

How it happens

What goes wrong depends on the component, as MITRE spells out:

  • An exported Activity that is not restricted can be launched by any app. A malicious app may reach sensitive information, change internal state, or trick the user into interacting with your app while thinking they are still in the malicious one.
  • An exported Service can be started and bound by any app. That can mean unauthorized actions, information exposure or corrupted state.
  • A Content Provider that is not restricted can let malicious apps read its data. MITRE notes that on Android before 4.2, a Content Provider is exported automatically unless explicitly declared as not exported.
<!-- Exposed to every app on the device -->
<service android:name=".SyncService" android:exported="true" />

<!-- Private to your app -->
<service android:name=".SyncService" android:exported="false" />

What an attacker gains

The consequences vary: other untrusted apps can launch the Activity, bind to the Service, or read and modify what the Content Provider offers. MITRE lists availability, integrity and confidentiality impacts, including crashes, instability, unexpected state and gaining privileges.

How to find it

MITRE notes SAST can find some instances by tracing data flow. A quick manual check: open the manifest and list every component with exported set to true, and every Content Provider that does not explicitly say it is not exported.

How to fix it

From the MITRE mitigations:

  1. If a component does not need to be shared, mark it with android:exported="false" in the manifest.
  2. If you only share components among your own apps, use android:protectionLevel="signature" so only apps signed by you can access them.
  3. Limit Content Provider read and write permissions as appropriate.

Quick check

What does protectionLevel signature do?

It restricts access to applications signed with your certificate.

Why did older Android versions make Content Providers riskier?

Before Android 4.2 they were exported automatically unless declared not exported.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.