Android allows the attribute android:debuggable
to be set to true
in the manifest, so that the app can be debugged. By default this attribute is disabled, i.e., it is set to false
, but it may be set to true
to help with debugging during development of the app. However, an app should never be released with this attribute set to true
as it enables users to gain access to details of the app that should be kept secure. With the attribute set to true
, users can debug the app even without access to its source code.
Noncompliant Code Example
This noncompliant code example shows an app that has the android:debuggable
attribute set to true
being accessed to reveal sensitive data.
...
Clearly, with the android:debuggable
attribute set to true
, sensitive date related to the app can be revealed to any user.
Compliant Solution
Ensure that the android:debuggable
attribute is set to false
before the app is released:
...
Note that some development environments (including Eclipse/ADT and Ant) automatically set android:debuggable
to true
for incremental or debugging builds but set it to false
for release builds.
Risk Assessment
Releasing an app with its android:debuggable
attribute set to true
can leak sensitive information.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
DRD10-J | High | Probable | Low | P18 | L1 |
Automated Detection
Automatic detection of the setting of the android:debuggable
attribute is straightforward. It is not feasible to automatically determine whether any data that might be revealed by debugging the app is sensitive.
Bibliography
[TBD] |
...