rspec/rules/S4507/xml/rule.adoc

73 lines
2.8 KiB
Plaintext
Raw Normal View History

Development tools and frameworks usually have options to make debugging easier for developers. Although these features are useful during development, they should never be enabled for applications deployed in production.
2020-06-30 12:49:37 +02:00
In the application manifest element of an android application, setting ``https://developer.android.com/guide/topics/manifest/application-element#debug[android:debuggable]`` property to ``++"true"++`` makes the application debuggable.
2021-02-02 15:02:10 +01:00
This introduces a security risk as it makes it easy for an attacker to reverse engineer the application and eventually steal the user's secrets.
2020-06-30 12:49:37 +02:00
== Ask Yourself Whether
* The development of the app is completed and the ``++debuggable++`` property is set to _true_
* The app is distributed to end users with the ``++debuggable++`` property set to _true_
2020-06-30 12:49:37 +02:00
There is a risk if you answered yes to any of those questions.
2020-06-30 12:49:37 +02:00
== Recommended Secure Coding Practices
2021-02-16 11:54:08 +01:00
It is not recommended to release debuggable application. Avoid hardcoding the debug mode in the manifest because the build tool will add the property automatically and assign the correct value depending on the build type.
2020-06-30 12:49:37 +02:00
== Sensitive Code Example
2021-02-11 16:56:46 +01:00
In ``++AndroidManifest.xml++`` the android debuggable property is set to ``++true++``:
[source,xml]
2020-06-30 12:49:37 +02:00
----
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:debuggable="true"
android:theme="@style/AppTheme">
</application> <!-- Sensitive -->
----
== Compliant Solution
2021-02-11 16:56:46 +01:00
In ``++AndroidManifest.xml++`` the android debuggable property is set to ``++false++``:
2022-02-04 17:28:24 +01:00
[source,xml]
2020-06-30 12:49:37 +02:00
----
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:debuggable="false"
android:theme="@style/AppTheme">
</application> <!-- Compliant -->
----
== See
* https://owasp.org/Top10/A05_2021-Security_Misconfiguration/[OWASP Top 10 2021 Category A5] - Security Misconfiguration
* https://mobile-security.gitbook.io/masvs/security-requirements/0x12-v7-code_quality_and_build_setting_requirements[Mobile AppSec Verification Standard] - Code Quality and Build Setting Requirements
* https://owasp.org/www-project-mobile-top-10/2016-risks/m10-extraneous-functionality[OWASP Mobile Top 10 2016 Category M10] - Extraneous Functionality
* https://cwe.mitre.org/data/definitions/215[MITRE, CWE-215] - Information Exposure Through Debug Information
2020-06-30 12:49:37 +02:00
* https://developer.android.com/studio/publish/preparing[developer.android.com] - Prepare for release
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]