Mobile App Security
Mobile App Security
Mobile App Security
&
With ever-advancing mobile technology, mobile application security has become an important
topic that every major enterprise must consider and understand. Corporations nowadays leverage
mobile applications to distribute relevant, critical data to their workforce, partners, or customers.
Creating an App for your services can go a long way in increasing your internet presence. But what
if your mobile app is insecure? It can turn your efforts into a fiasco, to say the least. Therefore it
important to do a proper Mobile app security audit before releasing it to the public. A careful
mobile app security audit can go a long way in protecting your customer’s data.
This document guides Mobile app developers & customers that are running their business via
mobile apps on how to attain the maximum level of protection for their Mobile app framework and
the sensitive data stored within, by conducting an effective security audit. A vulnerability
assessment & penetration testing checklist for Android/iOS mobile app will ensure that you don't
miss any crucial area of your app services and ensure they are configured correctly with the
highest level of security.
1 Check all app components are identified and known to be needed. (Testing for
Insecure configuration of Instant Apps)
2 Check security controls are never enforced only on the client side, but on the
respective remote endpoints. (Implemented authentication verification)
3 Check for a high-level architecture for the mobile app and all connected remote
services has been defined and security has been addressed in that architecture.
4 Make sure the data considered sensitive in the context of the mobile app is
clearly identified.
5 Check if all the app components are defined in terms of the business functions
and/or security functions they provide. (Environmental information)
6 A threat model for the mobile app and the associated remote services has been
produced that identifies potential threats and countermeasures.
8 Check if there is an explicit policy for how cryptographic keys (if any) are
managed, and the lifecycle of cryptographic keys is enforced.
9 Check if all the app components are defined in terms of the business functions
and/or security functions they provide. (Environmental information)
10 Ensure a mechanism for enforcing updates of the mobile app exists. (To test
enforced updating)
11 Check if the security is addressed within all parts of the software development
lifecycle with SAST, DAST & manual validation checkpoints between phases.
13 Make sure the app should comply with privacy laws and regulations.
1 System credential storage facilities need to be used to store sensitive data, such
as PII, user credentials or cryptographic keys. (Testing local sensitive data)
4 Make sure no sensitive data is shared with third parties unless it is a necessary
part of the architecture.
5 Check if all the app components are defined in terms of the business functions
and/or security functions they provide. (Environmental information)
6 Make sure the keyboard cache is disabled on text inputs that process sensitive
data.
10 Make sure your app removes sensitive data from views when moved to the
background.
11 Make sure the app does not hold sensitive data in memory longer than
necessary, and memory is cleared explicitly after use.
13 Make sure no sensitive data is stored locally on the mobile device. Instead, data
is retrieved from a remote endpoint when needed and only be kept in memory.
15 Make sure the app’s local storage is wiped after an excessive number of failed
authentication attempts.
Cryptography
1 Make sure the app does not rely on symmetric cryptography with hardcoded
keys as a sole method of encryption. (Testing Key Management)
3 Make sure the app uses cryptographic primitives that are appropriate for the
particular use-case, configured with parameters that adhere to industry best
practices.
4 Make sure the app does not use cryptographic protocols or algorithms that are
widely considered deprecated for security purposes.
5 Make sure the app doesn't re-use the same cryptographic key for multiple
purposes.
6 Make sure that all the random values are generated using a sufficiently secure
random number generator.
1 Make sure if the app provides users access to a remote service, some form of
authentication, such as username/password authentication, is performed at
the remote endpoint.
2 Check if the stateful session management is used, the remote endpoint uses
randomly generated session identifiers to authenticate client requests without
sending the user's credentials.
4 Make sure the remote endpoint terminates the existing session when the user
logs out.
5 Make sure a password policy exists and is enforced at the remote endpoint.
9 Make sure a second factor of authentication exists at the remote endpoint and
the 2FA requirement is consistently enforced.
11 Make sure the the app informs the user of all sensitive activities with their
account. Users are able to view a list of devices, view contextual information (IP
address, location, etc.), and to block specific devices.
12 Make sure the authorization models should be defined and enforced at the
remote endpoint.
Network Communication
1 Check if the data is encrypted on the network using TLS. The secure channel
is used consistently throughout the app.
2 Make sure the TLS settings are in line with current best practices, or as close as
possible if the mobile operating system does not support the recommended
standards.
3 Make sure the app verifies the X.509 certificate of the remote endpoint when
the secure channel is established. Only certificates signed by a trusted CA are
accepted.
4 Make sure the app either uses its own certificate store, or pins the endpoint
certificate or public key, and subsequently does not establish connections with
endpoints that offer a different certificate or key, even if signed by a trusted CA.
5 Make sure the app doesn't rely on a single insecure communication channel
(email or SMS) for critical operations, such as enrollments and account
recovery.
6 Make sure that the app only depends on up-to-date connectivity and security
libraries.
Platform Interaction
1 Make sure the app only requests the minimum set of permissions necessary to
avoid fragment inject attacks.
2 Make sure the app does not export sensitive functionality via custom URL
schemes, unless these mechanisms are properly protected.
4 Check if the app does not export sensitive functionality through IPC facilities,
unless these mechanisms are properly protected.
5 If native methods of the app are exposed to a WebView, verify that the
WebView only renders JavaScript contained within the app package.
7 Make sure the app protects itself against screen overlay attacks. (Android only)
9 Make sure all the inputs from external sources and the user are validated and if
necessary sanitized. This includes data received via the UI, IPC mechanisms
such as intents, custom URLs, and network sources.
10 Check if the WebViews are configured to allow only the minimum set of
protocol handlers required (ideally, only https is supported). Potentially
dangerous handlers, such as file, tel and app-id, are disabled.
1 Make sure the app is signed and provisioned with a valid certificate, of
which the private key is properly protected.
2 Check if the app has been built in release mode, with settings appropriate for a
release build (e.g. non-debuggable).
3 Make sure the debugging symbols are removed from native binaries.
4 Check if the debugging code and developer assistance code (e.g. test code,
backdoors, hidden settings) are removed. The app does not log verbose errors
or debugging messages.
7 Check if all third party components used by the mobile app, such as libraries
and frameworks, are identified, and checked for known vulnerabilities.
9 Check if the error handling logic in security controls denies access by default.
10 Make sure that in the unmanaged code, memory is allocated, freed and
used securely.
11 Make sure that Free security features offered by the toolchain, such as
byte-code minification, stack protection, PIE support and automatic
reference counting, are activated.
Information Gathering
Privacy Breaches
Clipboard Separation
UI Security
WebView Security
Code Signing
Integer Overflows
Integer Underflows
Privacy Breaches
IPC Security
Clipboard Separation
UI Security
Tap Jacking
WebView Security
Code Signing
Integer Overflows
Integer Underflows
Authentication Flaws
Excessive Permissions
Keychain Resources
1. Tcpdump 1. Magisk
2. Wireshark 2. Xposed Module: Just Trust Me
3. Canape 3. Xposed Module: SSLUnpinning
4. Mallory 4. Cydia Substrate Modules
5. Burp Suite 5. Android-ssl-bypass
6. OWASP ZAP 6. Frida CodeShare
7. ProxyDroid
Security Libraries
1. PublicKey Pinning
2. Android Pinning
3. ProGuard
4. SQLCipher
5. RootBeer
6. Secure Preferences
7. Trusted Intents
1. otool
1. Filezila 2. Clutch
2. Cyberduck 3. Fridpa
3. iTunnel 4. Frida-iOS-Dump
4. iProxy 5. Bagback
5. iFunbox 6. HopperApp
7. XReSign
1. Cycript
1. Canape
2. iNalyzer
2. Mallory
3. Passionfruit
3. Burp Suite
4. Introspy-iOS
4. OWASP ZAP
5. keychaindumper
5. Charles Proxy
6. BinaryCookieReader
7. Apple configurator 2
Security audit
based on industry
leading practices
such as OWASP,
OSSTMM, WASC,
CREST, NIST etc.
Video PoCs, selenium scripts & collaboration with security team enables your
developers to fix the vulnerabilities in record time. With Astra Security, VAPT
takes 40% less time than other solutions.
hello@getastra.com fb.com/getAstra
www.getastra.com linkedin.com/company/getastra
References: 1) https://github.com/tanprathan/MobileApp-Pentest-Cheatsheet