The goal of this control is to ensure that basic security coding practices are followed in developing the app, and that "free" security features offered by the compiler are activated.
The app is signed and provisioned with a valid certificate, of which the private key is properly protected.
The app has been built in release mode, with settings appropriate for a release build (e.g. non-debuggable).
Debugging symbols have been removed from native binaries.
Debugging code and developer assistance code (e.g. test code, backdoors, hidden settings) have been removed. The app does not log verbose errors or debugging messages.
All third party components used by the mobile app, such as libraries and frameworks, are identified, and checked for known vulnerabilities.
The app catches and handles possible exceptions.
Error handling logic in security controls denies access by default.
In unmanaged code, memory is allocated, freed and used securely.
Free security features offered by the toolchain, such as byte-code minification, stack protection, PIE support and automatic reference counting, are activated.
The OWASP Mobile Security Testing Guide provides detailed instructions for verifying the requirements listed above.
Android: Testing Code Quality and Build Settings - https://github.com/OWASP/owasp-mstg/blob/master/Document/0x05i-Testing-Code-Quality-and-Build-Settings.md
iOS: Testing Code Quality and Build Settings - https://github.com/OWASP/owasp-mstg/blob/master/Document/0x06i-Testing-Code-Quality-and-Build-Settings.md
For more information, see also:
OWASP Mobile Top 10: M7 (Poor Code Quality) - https://www.owasp.org/index.php/Mobile_Top_10_2016-M7-Poor_Code_Quality
CWE 119 (Improper Restriction of Operations within the Bounds of a Memory Buffer) - https://cwe.mitre.org/data/definitions/119.html
CWE 89 (Improper Neutralization of Special Elements used in an SQL Command) - https://cwe.mitre.org/data/definitions/89.html
CWE 388 (7PK - Errors) - https://cwe.mitre.org/data/definitions/388.html
CWE 489 (Leftover Debug Code) - https://cwe.mitre.org/data/definitions/489.html