Mobile App Security: OWASP MASVS Checklist & Best Practices
A mobile app runs on an untrusted device you do not control. Here is the engineering guide and OWASP MASVS v2.1 mobile application security checklist we use to secure storage, OAuth 2.0 PKCE, TLS pinning, and hardware attestation on iOS and Android.

On this page

Mobile app security, also called mobile application security, is the engineering discipline of protecting user data, authentication tokens, cryptographic keys, and backend APIs when your software runs on hardware you don't own or control. When a team asks us for a mobile app security checklist, we start at Idealogic by dropping web-server assumptions. An iOS IPA or Android APK sits on a phone you'll never see. A determined attacker can pull the binary off that phone, decompile it, attach a runtime debugger, and inspect every file written to disk.
You don't need proprietary cryptography or a worse user experience to build a resilient iOS or Android product. You need defense in depth across the client binary, the hardware security module in the OS, the transport layer, and the API gateway. This guide covers that architecture and the OWASP Mobile Application Security Verification Standard (MASVS) v2.1 checklist our engineers run before shipping consumer, enterprise, fintech, and healthtech mobile applications.
The short version
- Assume the client device is compromised: An attacker can decompile your APK with
jadx, inspect your iOS binary with Ghidra, and hook methods at runtime with Frida. Never ship a secret in the client binary that would compromise other users if extracted. - Keep secrets in hardware-backed storage: Store tokens and cryptographic keys in the iOS Keychain (
kSecAttrAccessibleWhenUnlockedThisDeviceOnly, with Secure Enclave keys for signing and biometric-gated secrets) and the Android Keystore (StrongBox-backed where the device supports it), never inNSUserDefaults,SharedPreferences, or plainAsyncStorage. - Bind biometrics to a cryptographic key: A short Frida script on a rooted device can bypass a
true/falsebiometric callback. Require the biometric sensor to unlock a hardware-bound key viaSecAccessControlorBiometricPrompt.CryptoObject. - Use OAuth 2.0 with PKCE and FIDO2 Passkeys: Public mobile clients can't keep a
client_secretconfidential. Enforce Proof Key for Code Exchange (RFC 7636) on every OAuth flow and adopt FIDO2 Passkeys to eliminate SMS OTP phishing. - Save certificate pinning for high-risk apps, and ship backup pins: Require TLS 1.2 or higher everywhere and prefer TLS 1.3 on the server. When you do add pinning, pin the SHA-256 hash of the Subject Public Key Info (SPKI) along with an off-CA backup key so certificate rotation never bricks your install base.
- Verify client integrity at the API boundary: The backend API is the real security perimeter. Enforce object-level authorization on every request and verify hardware attestation tokens from Apple App Attest and the Google Play Integrity API.
Why mobile app security differs fundamentally from web security
Teams moving over from backend or web work often misjudge the mobile threat model. On the web, your backend code executes inside a cloud VPC you control, your environment variables stay on your server, and the browser interacts only through remote HTTP requests.
In mobile app development, you package your compiled code, assets, native libraries, and configuration files into a signed archive (.ipa for iOS, .aab or .apk for Android) and hand it directly to the outside world. Once that archive lands on a physical device or an emulator, the attacker has physical and administrative root access to the execution environment.
During security audits at Idealogic, our first pass on a release build takes less than two minutes:
- Pull the installed APK off a test Android device using
adb shell pm pathandadb pull. - Decompile DEX bytecode and resources with
jadx-gui, or unpack an iOS.ipapayload to inspect Mach-O binaries and React Native Hermes bundles. - Run
strings,ripgrep, and entropy scanners acrossresources.arsc,Info.plist,BuildConfig.java, assets, and native.solibraries. - Launch the app on a rooted device running
frida-serverandmitmproxyto inspect every SQLite write, Keychain read, and HTTPS payload in real time.
If a team placed an AWS secret, a Stripe secret key, or an admin API token inside a .env file compiled into the binary, jadx or a memory dump exposes it immediately. An attacker also doesn't need your UI to talk to your backend. Once they've seen your network calls, they can replay modified requests from a script.
That gives you the core rule of mobile app security architecture: client-side controls protect a single user's local data when their phone is lost, stolen, or infected, while server-side controls protect your platform and every other user from a hostile client.
The OWASP Mobile Top 10 (2024) mapped to engineering controls
The OWASP Mobile Top 10 (2024 release) catalogues the vulnerability classes that cause breaches in production iOS and Android software. The table maps each category to the architectural mistake behind it and the engineering control that prevents it.
Improper Credential Usage (M1) is the number-one risk in the 2024 list. Third-party AI, mapping, and payment APIs make it easy for a team under deadline pressure to drop an API key into a client configuration file and assume that compiling the app hides the string. It doesn't. Any key that bills your account or reaches cross-user data belongs on your backend server, never inside the mobile client.
Layer 1: Hardware-backed data storage and cryptography (MASVS-STORAGE & MASVS-CRYPTO)
A recurring high-severity finding in mobile penetration tests is sensitive data sitting in plaintext inside the application sandbox, which is why insecure data storage is M9 on the OWASP list. The OS sandbox stops other non-privileged apps from reading your files during normal operation. It doesn't protect data pulled out through a cloud backup or a device-to-device transfer, data on a lost phone that gets rooted or jailbroken, or the unmasked screenshot the OS captures for the multitasking switcher as the user backgrounds a sensitive screen.
Mobile app encryption only helps if the key itself is hardware-bound, so we treat storage and cryptography as one problem.
Securing credentials on iOS: Keychain Services and the Secure Enclave
iOS app security starts with where you put credentials. On iOS app development builds written in Swift, UserDefaults (NSUserDefaults) writes an unencrypted .plist file inside the app container, protected only by the file's Data Protection class. Session tokens, refresh tokens, PIN hashes, and PII don't belong there.
Store credentials in Apple Keychain Services and configure accessibility and access control flags explicitly:
- Accessibility class: Set
kSecAttrAccessibleWhenUnlockedThisDeviceOnly(orkSecAttrAccessibleAfterFirstUnlockThisDeviceOnlyonly if a background worker strictly requires token access while locked). TheThisDeviceOnlysuffix prevents the Keychain item from migrating to an attacker-controlled device when a backup is restored. - Secure Enclave key generation: Create an elliptic curve P-256 key (
kSecAttrKeyTypeECSECPrimeRandom, 256-bit) withkSecAttrTokenIDSecureEnclave, combined withSecAccessControlCreateWithFlagsusing.privateKeyUsageand.biometryCurrentSet. Using.biometryCurrentSet(rather than.biometryAny) invalidates the Keychain item immediately if a new fingerprint or Face ID appearance is enrolled on the device.
Securing credentials on Android: Android Keystore and StrongBox
Android app security has the same weak spot. On Android app development builds written in Kotlin, standard SharedPreferences writes plaintext XML files to disk. To protect credentials, rely on the Android Keystore System:
- Hardware-backed key generation: Generate AES-256-GCM master keys or ECDSA signing keys inside the Android Keystore, which executes cryptographic operations inside a Trusted Execution Environment (TEE) or a separate StrongBox KeyMint secure subsystem (
setIsStrongBoxBacked(true)with TEE fallback; checkFEATURE_STRONGBOX_KEYSTOREfirst). - Modern encrypted storage: The Jetpack
security-cryptolibrary (EncryptedSharedPreferences) is deprecated. Use the Android Keystore directly, or Google Tink (AndroidKeysetManager) withandroid-keystore://master key URIs on top of JetpackDataStore. For relational data on either platform, encrypt SQLite databases using SQLCipher (via Room'sSupportFactoryon Android or GRDB/SQLCipher on iOS) with a 256-bit random key wrapped by the hardware keystore.
Eliminating side-channel leaks: backups, snapshots, clipboard, and logs
Even when your database and token store are encrypted, data leaks out through OS convenience features if you don't lock them down in your mobile app architecture:
- Disable OS cloud backups for sensitive files: On Android, set
android:allowBackup="false"inAndroidManifest.xml, or define<backup-rules>and<data-extraction-rules>excluding databases and preferences. On iOS, setURLResourceValues.isExcludedFromBackup = trueand enableNSFileProtectionComplete. - Blank the app switcher snapshot: In
applicationWillResignActiveon iOS, overlay a privacy splash view; on Android, applyWindowManager.LayoutParams.FLAG_SECUREon screens displaying payment cards, balances, or clinical records. - Expire clipboard data and strip release logs: On iOS, use
UIPasteboard.general.setItems(_:options:)with.localOnly: trueand a 60-second.expirationDate. Enforce an R8 rule (-assumenosideeffects class android.util.Log { *; }) on Android and compiler flags on iOS so debug logs never ship in production.
Layer 2: Phishing-resistant authentication and session lifecycle (MASVS-AUTH)
Authentication on mobile has two failure modes: weak protocol design between the client and the identity provider, and weak local session binding on the handset.
OAuth 2.0 with PKCE (RFC 7636) for public mobile clients
A mobile app is an OAuth 2.0 public client because it can't keep a static client_secret confidential. To stop malicious apps on the same handset from intercepting authorization codes via custom URL schemes, RFC 8252 and RFC 9700 (the OAuth 2.0 Security BCP) require public clients to use Proof Key for Code Exchange (PKCE), defined in RFC 7636:
- Before login, the app generates a high-entropy random
code_verifier(43 to 128 characters). - The app hashes the
code_verifierwith SHA-256 (S256) to produce thecode_challengeand sends only the challenge to the authorization endpoint via a system browser session (ASWebAuthenticationSessionon iOS or Android Custom Tabs, never an embeddedWebView). - When the authorization server redirects back with an authorization code, the app sends the original
code_verifierover TLS to the token endpoint. Always pair PKCE with verified Universal Links (iOS) and Android App Links over HTTPS.
FIDO2 Passkeys and cryptographic biometric binding
SMS one-time passwords (OTPs) are a restricted authenticator in modern identity standards, including the NIST SP 800-63B-4 Digital Identity Guidelines, because SIM swapping and real-time phishing proxies defeat them. In 2026, the strongest mainstream option for mobile authentication is passkeys, built on the FIDO2 and WebAuthn standards. Using ASAuthorizationController on iOS and CredentialManager on Android, the device generates an asymmetric key pair bound to your relying party domain (rpId). The platform credential manager (iCloud Keychain or Google Password Manager) stores the private key, and your server never sees it. Synced passkeys can move between a user's devices, so only device-bound credentials stay inside hardware.
The same rule applies to local step-up authentication ("Scan Face ID to approve transfer"). Don't branch on a simple boolean callback:
- The vulnerable pattern (Event-Bound Biometrics): Calling
LAContext.evaluatePolicyorBiometricPrompt.authenticate(promptInfo)without a cryptographic object and executingif (success) { sendTransfer() }. On a rooted phone, an attacker attaches Frida, hooksonAuthenticationSucceeded, and fires the callback themselves. - The secure pattern (Cryptographic-Bound Biometrics): Generate a private signing or encryption key inside the Secure Enclave or Android Keystore with
setUserAuthenticationRequired(true)and pass it viaBiometricPrompt.CryptoObjectorSecAccessControl(.biometryCurrentSet). The hardware refuses to sign or decrypt the payload unless the biometric sensor verifies the user inside the trusted execution environment.
If a biometric check in your mobile app only flips a boolean in application memory, an attacker with Frida can bypass it. Bind the biometric sensor to a cryptographic key inside the Secure Enclave or StrongBox so the hardware itself guards the secret.
Layer 3: Network transport security and certificate pinning with SPKI hashes (MASVS-NETWORK)
Certificate pinning is a client-side check that trusts only specific public keys for your backend instead of every system root CA. It matters because every byte travelling between a handset and your backend crosses untrusted networks, including public Wi-Fi or an attacker's laptop running mitmproxy or Burp Suite.
Lock down the OS network configuration first so no developer or third-party SDK can introduce cleartext HTTP calls: keep NSAppTransportSecurity (ATS) strict in Info.plist on iOS, and set <base-config cleartextTrafficPermitted="false"> inside res/xml/network_security_config.xml on Android. ATS requires TLS 1.2 or higher by default. Neither platform has a setting that forces TLS 1.3, so prefer 1.3 in your server configuration.
Standard TLS trusts every root Certificate Authority (CA) in the system store, and an attacker on a rooted or instrumented device can add a proxy CA (mitmproxy-ca-cert.pem) to that store to read HTTPS traffic. Since Android 7, apps ignore user-installed CAs by default, which is why the attacker needs root or Frida. High-risk apps counter this with certificate pinning, but naive leaf-certificate pinning is a common cause of self-inflicted outages when certificates rotate. Follow three rules based on the OWASP Mobile Application Security Testing Guide (MASTG):
- Pin the SPKI public key hash, not the leaf certificate: Pin the Base64-encoded SHA-256 hash of the Subject Public Key Info (SPKI) so routine renewals using the same key pair or intermediate CA remain valid.
- Always include at least one off-CA backup pin: Configure
NSPinnedDomainson iOS and<pin-set>in Androidnetwork_security_config.xmlwith your primary SPKI hash plus a backup SPKI hash from an independent backup Certificate Authority. - Set an expiration date on Android pin sets: Use
<pin-set expiration="YYYY-MM-DD">so older app versions fall back to OS system trust instead of losing connectivity for good. iOSNSPinnedDomainshas no documented expiry key, so ship backup pins there and keep a release path to rotate them.
Certificate pinning is not a substitute for server-side authorization. It protects the channel on one device, and an attacker who controls that device can still switch it off.
Layer 4: Device integrity, binary attestation, and code hardening (MASVS-RESILIENCE & MASVS-CODE)
Hardware attestation is cryptographic proof, produced by the device's secure hardware and checked on your server, that a request comes from a genuine build of your app on a genuine device. You need it because TLS and certificate pinning can't stop an attacker with root access on their own test phone. Frida or Objection (objection -g <package> explore --startup-command "android sslpinning disable") hooks the TLS library in memory and switches pinning off on that handset. Once they can see your API structure, they'll try to automate credential stuffing, scrape data, or submit modified payloads. Code resilience (MASVS-RESILIENCE) and hardware-backed device attestation are your two defenses at that stage.
Hardware attestation: Apple App Attest and Google Play Integrity API
Client-side root or jailbreak checks (such as checking whether /Applications/Cydia.app or /system/xbin/su exists) are easily patched out of the binary. Modern mobile app security moves integrity verification to a cryptographic challenge-response between the device's secure hardware and your backend server:
- On iOS (Apple App Attest): Using
DCAppAttestServiceinDeviceCheck, the Secure Enclave generates a hardware-bound key and Apple certifies that the key belongs to a valid instance of your app (your App ID, including the Team ID) on a genuine Apple device. For sensitive API requests, your backend sends a one-time challenge nonce, and the app signs an assertion (generateAssertion) over the request payload with that attested key. - On Android (Google Play Integrity API): Using
StandardIntegrityManager, your app requests an integrity verdict token signed by Google, based on device and app signals that include hardware-backed attestation where available. Your backend verifiesappRecognitionVerdict(PLAY_RECOGNIZED),deviceRecognitionVerdict(MEETS_DEVICE_INTEGRITYorMEETS_STRONG_INTEGRITY;MEETS_BASIC_INTEGRITYis the weaker tier), andrequestHash(binding the token to the SHA-256 hash of the specific request payload).
Binary obfuscation and cross-platform considerations
Whether you build native apps or use cross-platform frameworks (compared in our native vs cross-platform guide and React Native vs Flutter breakdown), harden the release binary so static analysis is expensive:
- Native Android & iOS: Enable
isMinifyEnabled = trueandisShrinkResources = truewith R8 on Android, which has run in full mode by default since Android Gradle Plugin 8.0, and enableSTRIP_INSTALLED_PRODUCT = YESandSTRIP_SWIFT_SYMBOLS = YESin Xcode release builds. - React Native app development & Flutter app development: Compile JavaScript to Hermes bytecode (
.hbc) with stripped source maps in React Native, and compile Flutter release builds ahead-of-time (AOT) with--obfuscate --split-debug-info=/<symbol-directory>so Dart class and function names are stripped fromlibapp.so. Keep that symbol directory, because you need it to symbolicate crash reports.
Complete OWASP MASVS v2.1 pre-launch checklist
Before any release candidate ships to App Store Connect or the Google Play Console, run through this verification matrix covering all eight control groups of OWASP MASVS v2.1. We build these checks into our how to build a mobile app delivery pipeline, so they're done well before launch week.
Regulated products need the evidence too. In fintech, PCI MPoC covers mobile payment acceptance, PCI DSS v4.0.1 covers cardholder data, and PSD2 Strong Customer Authentication applies. In healthtech it's the HIPAA Security Rule and GDPR Article 32 on security of processing, which our HIPAA compliant software development guide covers in more detail. Archive the test evidence from this table per MASVS control, and compliance auditors get traceable proof that each one was enforced. Put this verification work into your initial mobile app development cost estimate, because it prevents expensive post-launch rewrites.
Mobile app security testing: CI/CD gates and pre-release penetration tests
Mobile app security testing combines static analysis of the source, analysis of the compiled binary, and dynamic testing on a real device. A checklist only protects users if you test what the compiled binary does on a physical phone. What the source code intended doesn't count.
1. Automated CI/CD security pipeline (every pull request)
Every commit in a professional mobile app development repository should pass three automated gates before merge:
- Secret and SAST scanning: Run
gitleaksto catch accidental secret commits, paired with Semgrep mobile rulesets targeting Swift, Kotlin, and TypeScript/Dart patterns. - Binary analysis with MobSF: Run Mobile Security Framework (MobSF) in headless Docker mode against compiled
.apkand.ipaartifacts in CI to check permissions, compiler hardening flags (PIE, ARC, R8 obfuscation), and high-entropy strings. - Software Composition Analysis (SCA): Run
osv-scanner, Dependabot, or Snyk against lockfiles to catch vulnerable third-party SDKs (M2).
2. Manual mobile app penetration testing against OWASP MASTG (pre-release)
Before launch, run a structured manual test on a physical rooted/jailbroken test handset using OWASP MASTG v2, which is organized into tests, demos, techniques, and tools:
- Filesystem inspection: Install the release build, execute core workflows, and inspect
/data/data/<package>(Android) or/var/mobile/Containers/Data/Application/<UUID>(iOS) to confirm zero plaintext tokens or unencrypted PII exist in SQLite databases, plists, caches, or logs. - Runtime instrumentation: Attach Frida and Objection to attempt Keychain/Keystore dumps, hook biometric callbacks, and inspect memory for lingering secrets after logout.
- Network interception and Backend BOLA testing: Route traffic through Burp Suite or mitmproxy with a custom root CA installed. Confirm that pinned endpoints reject the proxy certificate, then bypass pinning via Frida to test every backend endpoint for Broken Object Level Authorization (BOLA), rate-limit bypasses, and missing App Attest or Play Integrity verification. Our analysis of 2026 mobile app development trends covers how hardware attestation and passkeys are becoming baseline defenses against automated API abuse.
If you'd rather have an outside team run all of this as a mobile app security audit before launch, that's the review we offer below.

CTO and Co-founder at Idealogic. Directing engineering, systems architecture, security, and full-stack delivery across web, mobile, and blockchain.
Frequently asked questions
Mobile app security is the engineering discipline of protecting application data, cryptographic keys, authentication flows, and business logic when the compiled binary runs on hardware you don't control. Unlike a web backend inside your cloud VPC, an iOS IPA or Android APK is downloaded directly to a user's or attacker's phone, where anyone with jadx and Frida can inspect local files, hook runtime functions, and forge API requests.
The OWASP Mobile Top 10 (updated in 2024) is a high-level awareness list of the ten most common risk categories affecting mobile software, such as improper credential usage (M1) and insecure data storage (M9). The OWASP Mobile Application Security Verification Standard (MASVS v2.1) is the actionable engineering framework underneath it, organizing testable security controls across storage, cryptography, authentication, networking, platform APIs, code quality, resilience, and privacy.
Don't store tokens or keys in Android SharedPreferences, iOS NSUserDefaults, React Native AsyncStorage, or unencrypted SQLite files. On iOS, keep credentials in the Keychain with kSecAttrAccessibleWhenUnlockedThisDeviceOnly, and use Secure Enclave keys for signing and biometric-gated secrets. On Android, generate keys inside the Android Keystore, StrongBox-backed where the device supports it, and persist encrypted values with Tink and Jetpack DataStore or SQLCipher.
No. Every app should require TLS 1.2 or higher, prefer TLS 1.3 on the server, and block cleartext traffic. Reserve certificate pinning for high-risk apps in fintech, healthtech, or enterprise identity, where attackers actively try man-in-the-middle interception on compromised devices. If you do pin, don't pin the leaf certificate. Pin the SHA-256 hash of the Subject Public Key Info (SPKI) along with at least one backup SPKI hash from an independent certificate authority.
The check is event-bound when it should be bound to a cryptographic key. If your code calls LocalAuthentication on iOS or BiometricPrompt on Android and branches on a true or false callback, an attacker running Frida on a rooted device can hook that callback and force it to return true. Pass a CryptoObject or a SecAccessControl flag so the hardware has to unlock a key.
Attackers can extract API endpoints from your binary and replay requests from Python scripts or modified APKs, so your backend needs proof that a request came from a genuine build of your app on a genuine device. Apple App Attest signs each sensitive request with a hardware-backed key that Apple has attested. The Google Play Integrity API returns a Google-signed verdict about the app and the device. Your API gateway checks both against a server challenge or request hash before it honors sensitive mutations.
Cross-platform apps share the exact same OS sandboxes and hardware keystores as native apps when configured properly using native bridges like react-native-keychain or flutter_secure_storage. The main difference lies in reverse-engineering ergonomics. React Native ships Hermes bytecode and Flutter compiles Dart ahead-of-time (AOT) into libapp.so, but plain JavaScript bundle strings or unstripped Dart symbols are easy to extract if developers hardcode secrets in client configuration files.
In our experience, setting up an automated static and dynamic baseline scan with MobSF, Semgrep, and dependency auditing takes one to two days, and it should then run in CI/CD on every pull request. A full manual mobile app penetration test against the OWASP Mobile Application Security Testing Guide (MASTG), covering binary decompilation, Frida runtime hooking, certificate pinning bypass attempts, and API object-level authorization testing, typically takes five to ten engineering days for one app on one platform with test accounts. A second platform, deeper API testing, and a retest all add time.
MobSF, Semgrep, and gitleaks cover the automated side in CI. For manual work you need a rooted or jailbroken test phone, Frida and Objection for runtime hooking, and Burp Suite or mitmproxy for traffic. OWASP MASTG v2 supplies the test cases.
More from the journal

Anrok vs Avalara in 2026: SaaS Sales Tax, VAT & Stripe Tax
Engineering and 36-month TCO teardown of Anrok vs Avalara vs Stripe Tax in 2026: SaaS and AI token taxability, HRIS physical nexus, EU VIES reverse charge, PostgreSQL tax ledgers, and $18M ARR math.

Knock vs Novu vs Courier in 2026: Notification Infrastructure & TCO
Engineering and 36-month TCO teardown of Knock vs Novu vs Courier in 2026: event vs per-message billing traps, MongoDB self-hosting overhead, PostgreSQL 17 FORCE RLS digest batching, and multi-channel fan-out math.

Sendbird vs Stream in 2026: Chat SDKs, PCC & 36-Month TCO
Engineering and 36-month TCO teardown of Sendbird vs Stream in 2026 alongside CometChat, PubNub, and Ably: Peak Concurrent Connection cliffs, Go/RocksDB edge latency, Redis Streams plus PostgreSQL 17 chat ledgers, and owned messaging math.