Cloud & app security

Mobile App Security Best Practices: A 2026 Guide for Teams

A phone is a hostile environment for your code: the binary can be pulled apart and the network watched. These practices keep your app safe anyway.

Cysoro Security TeamPublished · 9 min read
CLOUD & APP Mobile App Security Best practices mapped to OWASP MASVS 2.1.0. cysoro.com SECURE APP ✓ MASVS · TLS · Keystore
Quick answer

The best mobile app security practices are to keep secrets and authorisation on the server, store tokens in the iOS Keychain or Android Keystore, use TLS with proper certificate validation, enforce permissions on the server rather than the client, minimise the data cached on the device, and test the signed release build against OWASP MASVS before it ships.

Key takeaways

  • Treat the device, the app binary and the network as hostile, and keep anything that matters on the server.
  • Store tokens in the platform keystore, never ship secrets in the app, and use TLS everywhere.
  • Test the signed release build against OWASP MASVS 2.1.0, not just the debug build.

A mobile app runs on a device you do not control, on networks you do not trust, with its binary available to anyone who downloads it. These best practices, mapped to the OWASP Mobile Application Security Verification Standard (MASVS), show how to build an app that stays safe in that environment.

What is mobile app security?

Mobile app security is the practice of protecting an app, its data and its backend on devices the developer does not control. It covers how the app stores data, talks to servers, handles logins, uses platform features and resists tampering.

The core idea is simple: assume the device, the app binary and the network are all hostile. Anything inside the binary can be extracted, and ordinary files on a phone can be read by whoever controls it. So security comes from three moves: keep authority on the server, minimise what the device holds, and verify what you ship.

Our guide to mobile app security testing tools covers the scanners and testers that check these practices for you.

The three moves of mobile app security1Server decidesauthorisation, pricingand entitlements2Device holds littleshort-lived tokensno passwords cached3Verify the buildtest the signed releaseagainst MASVSIllustration by Cysoro.
Three moves that carry most of mobile app security. Illustration by Cysoro.

Why do mobile apps need their own standard?

Mobile apps need their own standard because the threats are different from web apps: the binary ships to the attacker, the device may be rooted or jailbroken, and the app talks to the operating system, other apps and sensors. OWASP MASVS is that standard, and it is the one your testers, auditors and developers can all share.

MASVS version 2.1.0, released in January 2024, organises its requirements into eight control groups and 24 controls. The companion testing guide, MASTG, reached version 2.0.0 in June 2026, and MASWE, the weakness catalogue, reached version 1.0.0 in August 2026 with 78 enumerated weaknesses. Together they form the OWASP Mobile Application Security project.

The eight groups are MASVS-STORAGE, MASVS-CRYPTO, MASVS-AUTH, MASVS-NETWORK, MASVS-PLATFORM, MASVS-CODE, MASVS-RESILIENCE and MASVS-PRIVACY. Every app should meet the core groups. The resilience controls are a risk decision: they matter most for apps that handle money, valuable accounts or licensed content.

MASVS groupFocusControlsRelated Mobile Top 10 risk
MASVS-STORAGESensitive data at rest2M9 Insecure Data Storage
MASVS-CRYPTOCorrect cryptography2M10 Insufficient Cryptography
MASVS-AUTHAuthentication and sessions3M1, M3 Credential and auth flaws
MASVS-NETWORKSecure network traffic2M5 Insecure Communication
MASVS-PLATFORMSafe OS interaction3M4, M8 Input and misconfiguration
MASVS-CODECode quality and dependencies4M2, M4 Supply chain and input
MASVS-RESILIENCEAnti-tamper resistance4M7 Insufficient Binary Protections
MASVS-PRIVACYData minimisation and control4M6 Inadequate Privacy Controls

One thing older guides get wrong: MASVS no longer defines the L1, L2 and R verification levels itself. They were reworked as MAS profiles — MAS-L1 Essential Security, MAS-L2 Advanced Security, MAS-R Resilient Security and MAS-P Baseline Privacy — and now live in MASTG. If a guide still frames your app with the old levels, it is based on an old edition.

How should apps store data and secrets?

Keep secrets out of the binary and tokens in the platform keystore. Anything shipped in the app package can be extracted, so do not embed cloud keys, admin tokens or third-party API secrets. Instead, have the backend broker access, issuing short-lived, narrowly scoped tokens to authenticated users.

On Android, generate keys in the Android Keystore, hardware-backed or StrongBox where available, and use them to encrypt local data. Never store tokens in plain SharedPreferences. On iOS, store tokens in the Keychain with an accessibility class such as kSecAttrAccessibleWhenUnlockedThisDeviceOnly, so they do not migrate in backups.

Keep sensitive data out of logs, crash reports, screenshots, the clipboard and backups. Disable screenshots on sensitive screens, and exclude sensitive files from cloud backup. A secret that leaks into a log is already public, because logs leave the device in crash reports and support bundles.

Do not invent cryptography. Use current standard algorithms such as AES-GCM with proper random number generation, and let the platform libraries do the work. Home-grown ciphers and hardcoded keys are the two fastest ways to fail MASVS-CRYPTO.

How should authentication and sessions work?

Authenticate on the server and authorise every request there. The app only asks; the server decides. Biometrics unlock a key on the device and do not count as a login by themselves, and a permission check that only runs in the app can be bypassed by anyone who modifies the app.

Use OAuth 2.0 with PKCE for native apps, as RFC 8252 requires for public clients. PKCE stops another app from redeeming an intercepted authorisation code, which matters on a phone where apps share the same redirect channels. Keep tokens short-lived, rotate refresh tokens, and terminate sessions properly on logout and password change.

On Android, declare BIOMETRIC_STRONG, which means a Class 3 biometric, when you bind a key to biometrics. On iOS, use the LocalAuthentication framework with a key that requires user presence. And add step-up authentication — a fresh login or biometric check — for sensitive actions such as payments, password changes and account deletion.

For the login side of your product, our best password manager with 2FA guide covers how teams store the credentials behind these flows.

How do you secure the network traffic?

Use TLS for every connection and leave the platform defaults switched on. That means no cleartext HTTP, no App Transport Security exceptions on iOS, and a strict network security configuration on Android. Every connection, including analytics and third-party SDK traffic, must use TLS with proper certificate validation.

Certificate pinning is a deliberate decision, not a default. Pinning protects against compromised certificate authorities and hostile networks, but a pinned app breaks when a certificate rotates, so you need a tested rotation plan and a way to ship an update fast. Document the decision either way, and test what happens when the pinned certificate changes.

Do not trust the network to protect your API. Validate every input on the server, enforce rate limits and authorisation per request, and never let the app decide what a user may see or do. An attacker with a modified app can send any request they like, so the API must assume the client is hostile.

Check your backend the same way you check the app: run our SSL checker against your API domain to confirm the TLS configuration is sound.

Pre-release security checklist✓No secrets in the binary: secret scanner runs on every commit✓Tokens only in Keychain or Keystore-backed storage✓TLS everywhere, no cleartext exceptions in the manifest✓Server enforces authorisation on every API call✓Third-party SDKs reviewed and pinned to known versions✓Signed release build tested against OWASP MASVSIllustration by Cysoro.
Six checks to run before any release goes to the store. Illustration by Cysoro.

What should you check on the platform side?

Check how the app interacts with the operating system and other apps. On Android, review exported activities, services and content providers, deep links and intent filters, and any WebView with a JavaScript bridge. On iOS, review URL schemes, universal links, app extensions and shared containers. Each of these is a door another app can knock on.

Ask for the minimum permissions and justify each one. An app that requests location, contacts and camera for a feature that needs none of them will fail review, annoy users and widen the damage if the app is compromised. Request permissions when the feature is used, not at first launch, and handle denial gracefully.

Lock down WebViews. Disable JavaScript bridges unless a feature truly needs one, validate every URL a WebView loads, and never let a WebView handle sensitive actions such as login or payment. A WebView with a bridge is a browser running inside your app, with your app's privileges.

Protect sensitive screens from screenshots and screen recording, and clear sensitive data from the app switcher snapshot. On Android, use FLAG_SECURE on sensitive activities; on iOS, hide content when the app moves to the background.

How do you protect the app binary and supply chain?

Protect the binary because it ships to the attacker. Use the platform obfuscation tools — R8 on Android, and the standard release settings on iOS — and strip debug symbols and logging from release builds. Obfuscation does not make an app unbreakable, but it raises the cost of finding the interesting code.

Keep dependencies and SDKs patched. The OWASP Mobile Top 10 ranks inadequate supply chain security second, and unvetted SDKs are a common way in: a single advertising or analytics SDK can read data your app never asked to share. Inventory every SDK, pin versions, review what each one collects, and remove the ones you no longer use.

Use app integrity checks where they matter. Play Integrity on Android and App Attest with DeviceCheck on iOS let your backend confirm that the request comes from your genuine app on a genuine device. These checks are not a replacement for server-side authorisation, but they help your backend spot tampered apps and emulators.

Plan for forced updates. Ship a mechanism that can require a minimum app version, so a vulnerable build can be retired instead of lingering on devices for months. A security fix that users never install is not a fix.

How do you test before release?

Test the signed release build, not just the debug one. Debug builds have different settings, logging and protections, so a test that passes on debug can miss a release-only flaw. Build the exact binary you will ship, install it on a real device, and test that.

Follow MASTG for the how: it maps each MASVS control to concrete test procedures for Android and iOS, with tools, commands and examples. Start with the MAS-L1 profile for most apps, move to MAS-L2 where the data is sensitive, and add MAS-R only where tampering directly costs money.

Automate what you can. Run a secret scanner and a dependency scanner on every commit, and fail the build when a key pattern or a known vulnerable library appears. A key that reaches a release build is already public, because the binary is public the moment it ships.

NIST SP 800-163 Rev. 1, published in April 2019, describes the same idea for organisations: define app security requirements, vet apps against them before deployment, and decide whether an app is acceptable for your devices. The standard is old, but the vetting process it describes is still the right shape.

What are the most common mobile app security mistakes?

The most common mistakes are the ones that keep failing in shipped apps: hardcoded keys, cleartext traffic and unvetted SDKs. Each one is easy to make and easy to catch with a scanner, which is why they still appear — teams ship first and scan later, if at all.

Other frequent mistakes include trusting the client for authorisation, storing passwords or bulk personal data on the device, logging sensitive data, and shipping the debug build to the store. None of these need an attacker with special skills; they need a user with a proxy and patience.

The fix is process, not heroics: a secret scanner in continuous integration, a MASVS checklist before release, and a rule that the release build is the one that gets tested. Most mobile security failures are not exotic attacks; they are basic hygiene skipped under deadline pressure.

If your app has a web backend, check its headers too with our security headers checker — the API behind the app deserves the same review as the app itself.

The bottom line

Mobile app security starts with one assumption: the device, the binary and the network are all hostile. Keep secrets and authority on the server, store tokens in the platform keystore, use TLS everywhere, and test the signed release build against OWASP MASVS before it ships.

Pick one practice from this guide and ship it this week — a secret scanner in your build pipeline is the highest-value first step for most teams. Then work through the MASVS checklist group by group, and make the release review a habit instead of a one-off event.

Frequently asked questions

What is OWASP MASVS?

OWASP MASVS is the Mobile Application Security Verification Standard. Version 2.1.0, released in January 2024, organises mobile security requirements into eight control groups and 24 controls covering storage, cryptography, authentication, network, platform, code, resilience and privacy.

What is the OWASP Mobile Top 10?

The OWASP Mobile Top 10 is a ranked list of the most common mobile app risks. The 2024 edition lists improper credential usage first, followed by inadequate supply chain security, insecure authentication and authorisation, and insufficient input validation. MASVS gives you the controls to address those risks.

Should I store API keys in my mobile app?

No. Anything shipped in the app package can be extracted by anyone who downloads it. Keep API keys and admin tokens on your backend, and have the backend issue short-lived, narrowly scoped tokens to authenticated users.

Do I need certificate pinning?

Certificate pinning adds protection against compromised certificate authorities and hostile networks, but it can break your app if a certificate rotates. Decide deliberately, document the decision, and have a tested plan for rotating pinned certificates.

How is mobile app security different from web security?

On mobile you do not control the device, the operating system or the network, and your binary ships to anyone who wants to take it apart. That means secrets, authorisation and validation must live on the server, and the app itself needs tamper resistance that a web app never needs.

What is the difference between MASVS, MASTG and MASWE?

MASVS says what to verify, with 24 controls in eight groups. MASTG, the testing guide, says how to test each control on Android and iOS. MASWE catalogues the concrete weaknesses that cause failures. Together they form the OWASP Mobile Application Security project.

How often should I test my mobile app?

Test on every release, and re-test after any change to authentication, storage, networking or third-party SDKs. Run automated secret and dependency scans on every commit in continuous integration, and do a full MASVS review before a major release.

Do I need runtime protection (RASP)?

Runtime application self-protection makes sense for apps that handle money, valuable accounts, licensed content or competitive play, where tampering directly costs you. For most apps, the core MASVS controls matter more than anti-tamper features.

Sources

  1. OWASP — MASVS releases (v2.1.0)
  2. OWASP — Using the MASVS
  3. NIST — SP 800-163 Rev. 1, Vetting the Security of Mobile Applications
  4. Cybersecurity News — Mobile App Security Best Practices Mapped to OWASP MASVS
  5. Appknox — What is MASVS?
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against OWASP MASVS 2.1.0 and NIST SP 800-163 Rev. 1, both opened in December 2026.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free