Mobile App Development

Top Tips for Mobile App Security Today

Top Tips for Mobile App Security Today

Anyone who installs your app gets a full copy of it to pick apart on hardware you have no say over. That’s the whole problem, really. The ranking here follows the OWASP Mobile Top 10 (2024), which replaced the 2016 list and puts improper credential usage at M1.

Apple’s developer documentation (2026) is blunt about the limits of self-checking: you can’t rely on your app’s logic to perform security checks on itself, because a compromised app can falsify the results.

The controls that work pair something on the device with a check on the server, and each has a documented condition under which it fails.

Which Mobile App Risks Should the Tips Address First?

OWASP Mobile Top 10 2024 strip with M1 and M9 highlighted, the eight MASVS control groups, Android 9 cleartext default and the TLS 1.2 minimum for App Transport Security

Credentials and on-device data come first. Improper credential usage holds the M1 slot on the OWASP Mobile Top 10 (2024), and insecure data storage sits at M9.

The ranking mostly follows exposure. NowSecure’s 2026 outlook notes that apps ship through public stores, which lets attackers download and reverse engineer them before they ever touch a server.

A mobile app runs on a device the team does not control. Any check that lives only inside the app can be read and edited by an attacker, or simply skipped.

Here is where each of the ten 2024 risks gets handled below.

OWASP 2024 risksTypical flawWhere the fix sits
M1 Improper Credential Usage, M9 Insecure Data Storage, M10 Insufficient CryptographyHardcoded keys, plaintext tokens, weak algorithmsData and key storage
M3 Insecure Authentication/AuthorizationLogin logic enforced only on the deviceLogin and sessions
M4 Insufficient Input/Output Validation, M5 Insecure CommunicationCleartext traffic, unvalidated API inputNetwork and API
M7 Insufficient Binary ProtectionsReadable, repackageable binaryCode protection
M2 Inadequate Supply Chain Security, M6 Inadequate Privacy Controls, M8 Security MisconfigurationRisky SDKs, excess data collection, debug settings left onSDK vetting, testing and compliance

For how these categories show up in real attacks, see this breakdown of threats that target mobile apps.

A few numbers worth having on hand before going further.

  • The OWASP Mobile Top 10 lists 10 risks, and the 2024 revision replaced the 2016 list (OWASP; Approov)
  • MASVS has 8 control groups: storage, cryptography, authentication, network, platform, code, resilience and privacy (OWASP MAS, as of November 2026)
  • Android 9 and higher disable cleartext traffic by default (Android developer documentation, as of November 2026)
  • App Transport Security accepts TLS 1.2 as the minimum by default (Apple developer documentation, 2026)

How to Store Data and Keys Safely on iOS and Android

Nothing secret belongs in the binary, and tokens belong in the platform key store. Anything sensitive that still has to reach disk gets encrypted. On the OWASP list that covers M1, M9 and M10.

Why Secrets Do Not Belong in the App Binary

A key compiled into the app is a key handed to every user who downloads it.

  • For third-party API keys, route the call through your own backend so the key never ships.
  • User passwords should not be stored at all. The OWASP Mobile Application Security Cheat Sheet recommends revocable, device-specific tokens instead.

Signing and backend secrets don’t go in the repository or in resource files either.

Run a secrets scanner in your continuous integration pipeline so a leaked key fails the build before it reaches a store.

Some keys must exist on the device, such as a public SDK key. Treat those as public and limit what they can do on the server.

Platform Key Stores and Encryption at Rest

YouTube player

Both platforms ship a key store, and using it beats any homegrown scheme.

Apple describes the keychain as an encrypted database for small secrets such as passwords, keys and certificates. On Android, the Keystore runs cryptographic operations outside the app process, so a compromised app can use a key without extracting its material.

  • Tokens and encryption keys go in Keychain or Keystore
  • SharedPreferences and plist files are the wrong place for sensitive local data, per the OWASP cheat sheet
  • Encrypt with a vetted platform library and AES-256 keys held in the key store
  • Keep sensitive files out of device backups

On Android, hardware backing applies only when the secure hardware supports the key’s exact algorithm, block mode, padding and digest. On devices running API 31 and higher, check KeyInfo.getSecurityLevel() for TRUSTED_ENVIRONMENT or STRONGBOX; older versions use the now-deprecated isInsideSecureHardware().

StrongBox, the secure element option, is overkill for most apps. Android’s documentation calls it slower and more resource-constrained, and says most apps do not need it.

Worth knowing that the Keystore stops extraction and nothing more. On a compromised OS, an attacker may still be able to use the keys on that device.

What Is the Safest Way to Handle Login and Sessions?

The safest setup has the server issue short-lived tokens through OAuth 2.0 with OpenID Connect. The app keeps them in the key store and only presents proof, while the server makes every authorization decision.

This is authentication on tokens instead of repeated passwords. The password travels once, and every later request carries a token that can expire or be revoked.

The OWASP cheat sheet gives no fixed token lifetime and asks apps to handle expiration gracefully, so the number is a risk call. Payment and health apps need shorter windows than a recipe app.

On the device, access and refresh tokens live in Keychain or Keystore. Gate their use behind a biometric prompt (Android BiometricPrompt, Face ID) with a PIN as fallback, and clear them on logout and after the session timeout.

The server expires sessions after inactivity and generates random session tokens. It checks authorization on every request, never from a client-side flag, and asks for re-authentication before password and payment changes.

Multi-factor authentication belongs on high-risk actions such as payouts and credential changes, not on every app launch.

Biometrics prove the device holder is present. They say nothing about who the server is talking to, so a biometric result never replaces a server check.

Binding a Keystore key to user authentication helps in one narrow case, when the app process is compromised after the key exists. Android’s documentation calls it an advanced feature for that reason.

How to Protect Network Traffic and the API Behind the App

YouTube player

Every connection should use TLS. Pinning certificates only makes sense if you can rotate the pins safely. The API is the real security boundary, and the app is just a client.

Transport Security and Certificate Pinning

YouTube player

Both platforms block cleartext by default now, so the work is auditing exceptions. On iOS, a single global ATS opt-out disables protection for every domain, and Apple’s documentation says to fix the server first and keep any exception as narrow as possible.

ATS also does not cover the Network framework or CFNetwork. Code written against those lower-level interfaces owns its own TLS checks.

On Android, allowing cleartext in the base config should be avoided, and opting in per domain is the better route.

Android pins are hashes of the certificate’s public key, and a chain is valid only if it contains at least one pinned key.

  • Without a backup pin, a key or CA change means you must push an app update to restore connectivity.
  • A pin expiration keeps stale installs online, but Android warns it may let attackers bypass the pins. Leave it off and installs that never update fail closed when the certificate changes.

The OWASP cheat sheet only says to consider pinning, and that trade-off is the reason.

Pinning fits an app that handles money or health data, provided you own the backend and ship updates often. It’s a poor fit if the app calls third-party endpoints you do not control, or if a large share of users stay on old versions.

Server-Side Validation and App Attestation

Apple’s App Attest documentation puts the premise plainly. You can’t rely on your app’s logic to perform security checks on itself, because a compromised app can falsify the results.

So the server validates every input and checks authorization on every endpoint, whatever the app claims. Attestation adds one more signal about who is calling.

PlatformServiceWhat the server learnsDocumented limit
iOSApp AttestRequest signed by a Secure Enclave key certified for a genuine app instanceKeys do not survive reinstall, device migration or backup restore (Apple, 2026)
AndroidPlay Integrity APILicensed install, unmodified Play-recognized binary, genuine certified deviceDefault quota of 10,000 requests per day across all installs (as of November 2026)
BothOne-time challengeVerify the nonce or request hash on the server to block replayA signal, not a verdict

Google says Play Integrity works best alongside other signals, and should not be the sole anti-abuse mechanism. It also recommends answering with a range of outcomes instead of a flat allow or deny.

Fewer devices reach the strongest verdict tiers, so tiered enforcement works better than demanding them. Caching verdicts raises the risk of proxying, so request a fresh one.

The threat is live. In October 2026, ThreatFabric reported an Android banking trojan, Hirudo, that replaces genuine banking apps with patched copies that disable the app’s own security checks from the inside. That is why attestation verdicts must be validated on the server rather than trusted from inside the app (Cybersecurity News, 2026).

Do Obfuscation, Root Detection and Runtime Protection Work?

YouTube player

They slow attackers and raise the cost of an attack, and they do not stop a determined one. Add them where a repackaged copy of the app leads to fraud, and skip the extras where it does not.

On Android, R8 handles code obfuscation by shortening class, field and method names, so com.example.MyActivity becomes something like a.b.a. It runs only when optimization is enabled in the release build.

Android’s documentation presents that renaming as a way to cut DEX size, and the only side effect it mentions is harder-to-read stack traces. Read it as a size feature with a small security benefit.

R8 gets you a smaller binary and unreadable symbol names. Logic and strings stay readable to a patient analyst though, and crash reports need retracing.

Root and jailbreak detection is a cheap risk signal that can feed server decisions. The check runs on a device the attacker controls, so instrumentation tools such as Frida can hook and neutralize it. Rooted devices also aren’t always hostile, and hard blocks cost legitimate users.

Runtime protection (RASP) watches for hooking, debuggers and repackaging while the app runs. It adds a vendor dependency and build complexity, and it still loses to a patient attacker.

A simple way to decide is to ask what an attacker gains from a modified copy of the app. If the answer is fraud or free premium content, add integrity checks and runtime protection. If the answer is nothing, turn on R8 and stop there.

Whatever you add, report the result to the server and let the backend decide, the way attestation does.

How to Vet Third-Party SDKs and Dependencies

How the EngageLab SDK's exported activity exposed 50 million installs, a five-point SDK vetting checklist, and Google Play's 90-day rule for SDK versions with critical issues

Treat every SDK as code you wrote. Check who maintains it and what it adds to your manifest before it ships, and again at every update. OWASP M2 covers attackers who insert malicious code or alter it during the build, and those who abuse third-party libraries and SDKs.

Microsoft’s April 2026 advisory on the EngageLab SDK shows how this plays out. The library added an exported activity, MTCommonActivity, to the host app’s merged manifest, which let a malicious app on the same device reach the host app’s private data.

Wallet apps using the SDK accounted for more than 30 million installations, and exposure exceeded 50 million installations once non-wallet apps were counted. Microsoft reported no evidence of in-the-wild exploitation. EngageLab shipped the fix on November 3, 2025 as version 5.2.1, and Microsoft published its write-up on April 9, 2026.

  • Google Play SDK Index shows version adoption, requested permissions and retention for popular commercial SDKs, which makes it a decent first look at who maintains a library.
  • Google expects you to treat an SDK’s data collection as if your app collected it directly. On iOS, Apple’s documentation says SDKs on its required list must bundle a privacy manifest (PrivacyInfo.xcprivacy) declaring collected data types and required reason APIs.
  • Microsoft advises reviewing the merged Android manifest after adding third-party SDKs, since that is where exported components and pulled-in permissions show up.
  • A software bill of materials lists every library and version in a build, so a new advisory takes minutes to check instead of days.

A scan that passes today says nothing about the next update. OWASP rates the impact of supply chain attacks as severe, and says they are both common and difficult to detect.

So rescan on every release, and send SDK upgrades through the same code review process as your own changes.

Google Play enforces part of this for you. An app that uses an SDK version with critical issues can still be released temporarily, but it must move to a newer SDK version within 90 days of that release, after which further releases using that version are blocked (Google Play Console Help, as of November 2026).

How to Test a Mobile App Before and After Release

YouTube player

Test in layers and automate the cheap ones. Static analysis can run on every build, while dynamic analysis and the manual penetration test are saved for the release candidate and the pre-launch stage.

That order is the practical core of mobile app security testing, since each layer catches what the one before it cannot.

  1. Threat model the app. List assets (tokens, keys, personal data), entry points (deep links, exported components) and trust boundaries.
  2. Run static analysis on every build in the CI pipeline.
  3. Run dynamic analysis on a release candidate, on a real device.
  4. Intercept and tamper with API traffic to test authorization and input validation.
  5. Commission a manual penetration test against the OWASP MASTG before launch.
  6. Fix, retest the fixed findings, and repeat after major releases and SDK changes.
ToolWhat it doesFits step
MobSFStatic analysis of APK, IPA and APPX files plus source code; dynamic analysis on Android and iOS; REST API and CLI for CI/CD2 and 3
FridaInjects JavaScript into running native apps to hook functions and read memory3
Burp SuiteIntercepts, views and modifies the app’s HTTP/S requests and responses4

Tool choice depends on the step, and this roundup of mobile application penetration testing tools covers more options than the three above.

Interception proxies such as Burp and OWASP ZAP do not decode non-HTTP traffic by default, so apps with custom protocols need plugins or network-layer capture.

Test a build with certificate pinning switched off as well as the release build. A pinned app shows an interception proxy nothing.

The OWASP MASTG helps with step 5. It ships numbered test procedures and worked demos for Android and iOS, organized by MASVS category.

Which Security Standard and Verification Level Does the App Need?

Start with the data the app handles. Baseline controls go on every app, and defense in depth goes on anything holding sensitive data. Resilience controls only earn their cost when a tampered copy causes real harm.

One naming trap first. OWASP moved the L1, L2 and R levels out of the MASVS controls in version 2.0.0 and turned them into MAS profiles applied to MASTG tests.

OWASP’s own checklist labels the old levels as a transition artifact being reworked into security testing profiles, yet vendor pages still write MASVS-L1, MASVS-L2 and MASVS-R as if they live inside the standard. Check which one a pentest report or RFP means before you sign off.

ProfileUse it whenWhat it adds
L1Any appBaseline controls across the MASVS control groups
L2The app handles payments, health or identity dataDefense in depth on top of L1
RA modified copy leads to fraud, IP theft or cheatingResilience against reverse engineering and tampering

The profiles carry over the old meaning, so L1 is still the baseline for every app and R is still about reverse-engineering risk, with L2 sitting between them for apps that handle sensitive data.

To place an app, score it on a risk assessment matrix: likelihood of attack against impact of a breach, using the data classes from your threat model. Skip R for low-risk apps, because resilience controls add build and maintenance overhead that a news reader never needs.

  • Under GDPR, fines reach up to 20 million euros or 4% of worldwide annual turnover, whichever is higher. Article 83 also tells regulators to weigh the technical and organisational measures a company had in place.
  • PCI DSS applies to any entity that stores, processes or transmits payment card data, and 51 of the 64 new v4.x requirements took effect on 31 March 2025 (PCI Security Standards Council).
  • NIST SP 800-163 Rev. 1 is a mobile app vetting process for organizations approving apps against their own security requirements. The revision NIST lists dates from April 2019, so use it as a process, not a threat list.

Regulatory duties like these fall under software compliance, and the profile you choose is how you evidence the technical side.

Where Do Mobile App Security Controls Stop Working?

Table of when Play Integrity, App Attest, a passed MASVS profile and in-app controls stop working, and how to design the server side and fallbacks for each case

They stop working where they lean on something the attacker controls or a vendor can switch off, and wherever nobody retests.

Attestation services have gaps of their own.

  • Google tells developers to plan how the backend behaves during a Play Integrity outage, and notes some Android apps cannot use the API at all.
  • Apple’s App Attest documentation says not every device supports the service, and the server must stop requiring assertions for devices that do not.

So the fallback path is part of the design. A fallback that waves everyone through is a bypass.

OWASP’s own mobile cheat sheet calls itself a starting point, not a comprehensive guide, and a passed profile works the same way. It verifies only the controls that were tested, on the build that was tested.

Every control ships inside the binary, so users who never update keep yesterday’s flaws. A couple of habits help.

  • Enforce a minimum supported app version on the server, and retire old API versions on a published schedule
  • Retest after each SDK or OS-level change

Mobile App Security FAQ

What is mobile app security?

It protects the code, stored data and network traffic of apps running on iOS and Android devices the developer does not control, and it sits under the wider application security umbrella. The scope runs from credentials and storage through authentication and transport to the binary and third-party SDKs.

Is app security the same as mobile device security?

No. Device security covers the phone, meaning OS updates, screen locks and device management, whereas app security is about the app’s own code, data and API. A fully patched device will still run a hardcoded API key shipped inside a vulnerable app without complaint.

Is iOS or Android safer for apps?

Neither is safe by default for your app. Both platforms give you a key store (Keychain, Keystore) and app attestation, and both enforce TLS by default, but both will also run apps with hardcoded secrets or weak authorization just as easily. The developer’s choices decide the outcome.

Are cross-platform apps less secure than native ones?

Not by design. The added risk comes from the JavaScript dependency tree: NowSecure notes that apps built on frameworks like React Native, Ionic and Cordova inherit JavaScript ecosystem supply chain risk. Use the same key stores through native modules and audit packages like any other SDK.

How often should a mobile app be security tested?

Run static analysis on every build and dynamic testing on each release candidate. Add a manual penetration test before launch, and again after major changes such as a new login flow or a new SDK, or when payments get added.

How much does mobile app penetration testing cost?

There is no flat rate, so ask for a scoped quote. Price follows the number of platforms, features and API endpoints, the depth of the profile tested (L1 versus L2 plus R), and whether retesting of fixes is included.

How can users tell whether an app is safe to install?

Check what the app requests against what it does. Kaspersky’s guide to fake apps points to signs such as uniformly positive reviews, typos in the description, a popular app with few downloads, a developer name copied from the original and permissions the app does not need. Install from the official store and remove apps that ask for unrelated permissions.

Keeping Mobile App Security Current After Launch

A fixed release routine keeps things current. Scan every build and retest after any SDK, OS or authentication change. Pins and certificates get rotated before they expire.

Cost sets the order. Secrets and exported-component scans run on every build because they cost almost nothing per run. Authentication and API retests follow each SDK or OS change and take real tester time, while pin and certificate rotation sits on a fixed calendar because the expiry date is known.

Forced upgrade gates have a cost too. They lock out users who have not updated, so schedule cutoffs against your support window. Keep the routine inside a mobile app security checklist that lives beside the build.

Verified November 2026. A new OWASP Mobile Top 10 revision or finalized MAS testing profiles would change this order.

Bogdan Sandu

Stay sharp. Ship better code.

Every week: one curated article, one tool worth knowing, one tip you can use tomorrow. No noise, no padding.