Why app security matters
A mobile app is an attractive target. The binary runs on a device you have no control over, communicates over networks you have no control over, and often contains credentials or tokens that give direct access to your backend. A successful exploit can become a data breach, reputational damage and a compliance incident all at once.
The four layers of the attack surface
- Network — traffic between app and server can be intercepted (man-in-the-middle), especially on public Wi-Fi or via a rogue DNS resolver.
- Device — the device itself may be rooted, jailbroken or infected with malware that watches the memory or file system of your app.
- Server — in practice, the backend API is where most data breaches originate. An insecure endpoint is deadlier than a missing certificate pin.
- Supply chain — third-party SDKs, build tools and CI/CD systems form a chain in which every link is an attack vector.
Recent incidents and legislation make the importance even sharper. The EU has had the DSA and the AI Act in force since 2024, and the Cyber Resilience Act (CRA) will apply in full to apps with digital elements from 2027. That means security is no longer a choice but a design criterion, even for relatively small apps in regulated sectors.
The key starting point for mobile security is the OWASP Mobile Top 10 (2024 edition). The list covers improper credential usage, insecure communication, insecure authentication, insufficient cryptography, insecure authorisation, poor code quality, code tampering, reverse engineering, extraneous functionality and inadequate binary protection.
Level 1: Baseline (required for every app)
These are the requirements no production app can skip. We see them missing time and again in MVPs that rushed to the store, and it is almost always a disaster waiting to happen.
HTTPS-only and transport security
All network traffic must go over TLS. On iOS, App Transport Security (ATS) enforces this by default; exceptions for plain HTTP must be declared explicitly in Info.plist and need a good reason. On Android, NetworkSecurityConfig applies the same idea: you declare per domain which traffic is allowed. No stray HTTP calls, no "just for debugging", and no cleartextTraffic enabled in production.
Secure data storage
- iOS Keychain for secrets, tokens, refresh tokens and biometric keys. Not
UserDefaultsas that is stored in a readable plist file. - Android Keystore for keys and credentials. Not
SharedPreferencesas that is trivial to read on rooted devices. - EncryptedSharedPreferences (AndroidX Security) if you absolutely have to store something in preferences.
- No secrets in the binary: API keys and client secrets in the app bundle can be extracted within a few minutes.
Authentication
For login we use OAuth 2.0 and OpenID Connect (OIDC) as standard. Passwords are stored server-side using a modern password hash (bcrypt, scrypt or Argon2, not SHA-256 or MD5). Never store passwords in the app; use refresh tokens via the PKCE flow for mobile clients.
Input validation
Never trust input from the client. All validation must also happen server-side: the app validates for UX, the server validates for security. This prevents injection attacks, forced state changes and logic that would exist only on the device.
Secure update flow and privacy permissions
An app must be able to update itself without making the user reconfigure everything. A good in-app update prompt (Android In-App Updates or your own version check against your backend) ensures old, vulnerable versions disappear quickly. Also, only request permissions you actually use; overly broad permissions lead to both store rejections and privacy risks.
Server-side first
A key insight from OWASP practice: most mobile data leaks come from poorly secured backends, not from the app itself. An unprotected endpoint that returns all user records is more dangerous than a missing anti-debugging check. If you are building compliance software, our ISO 27001 page is a good starting point to see how we approach that backend layer.
Level 2: Intermediate
For most B2C apps of any size, and all apps with user accounts, this layer is a must. These measures raise the bar for attackers significantly without paralysing product development.
Token management
Access tokens have a short lifetime (think minutes), while refresh tokens last longer but use a rotating implementation. A refresh token must be replaced on every use; reuse indicates compromise and must invalidate the entire session. Server-side revocation must always be possible, so users who lose their device can log out remotely.
Biometric authentication
Face ID, Touch ID and Android Biometric make re-authentication convenient without having to store passwords. Importantly, the biometric check unlocks a Keystore item; the password itself is never in the app. The fallback (PIN, pattern) must always go through the OS API.
Code obfuscation and anti-debugging
- R8 on Android: Google's standard shrinker and obfuscator. Enable it in
proguard-rules.pro. Essential for commercial apps. - Swift and Objective-C — Apple's compiler does only limited symbol stripping; for stronger protection there are tools such as
swiftshield. - Anti-debugging — check whether a debugger is attached to the app and refuse sensitive operations if so. Not foolproof, but it does increase the time an attacker has to spend.
The UX layer of security
- Secure clipboard — password managers may place credentials on the clipboard, but your app must not do so itself. Clear sensitive clipboard contents after a few seconds.
- Screenshot protection — on Android via
FLAG_SECUREat Activity level, on iOS via a blur overlay when the app resigns active. Particularly relevant for banking, healthcare and HR apps. - MFA — offer a second factor via TOTP, WebAuthn or passkeys. An SMS OTP is better than nothing, but nowhere near as secure as a hardware-bound factor.
Session management
Sessions should have server-side state. A logged-out user must also be invalidated server-side, not just client-side. Idle timeouts, absolute timeouts and device binding are standard components of any serious app.
Level 3 — Advanced
For banking, fintech, healthcare, defence and any app where a successful attack causes direct financial or physical harm. This layer is not cheap, but for the right use case it is indispensable.
Certificate pinning
Standard TLS trusts every Certificate Authority approved by the OS. With certificate pinning, your app trusts only the CA certificate (or public key) of your own backend. An attacker who has managed to get a valid certificate issued still cannot carry out a man-in-the-middle attack. Be careful with key rotation, though: an expired pin breaks your app for everyone at once. Always use at least two pins (current and next rotation) and a server-side emergency update channel.
Jailbreak and root detection
Detecting modified devices can be bypassed, but it does raise the bar. An attacker who wants to debug your app on their rooted device first has to deal with the detection itself. For financial apps, refusing to launch on rooted devices is a reasonable default — for B2B apps on enterprise devices it is often too heavy-handed.
Anti-tamper and runtime integrity
- Frida detection — Frida is the most widely used runtime instrumentation tool for mobile apps. Detect its characteristic ports, libraries and stack traces.
- Checksum verification — at start-up, the app compares the checksum of its own binary with an expected value. Tampering breaks the check.
- Anti-hooking — prevent method swizzling or Java hooks from intercepting sensitive methods.
Hardware-backed key storage
- Secure Enclave (iOS) — a separate coprocessor that never lets keys leak out on its own.
- StrongBox (Android) — a Trusted Execution Environment or dedicated security chip on modern devices.
- TEE — generic term for hardware isolation that extends ARM TrustZone.
Device attestation
App Attest (iOS) and Play Integrity (Android) let your backend verify that a request comes from a genuine, unmodified app on a genuine device. For anti-fraud in payments, gambling, ticketing and account registration, this has become a de facto standard.
End-to-end encryption and zero trust
For messaging apps and sensitive communication, end-to-end encryption is the standard, often based on the Signal Protocol with double-ratchet key rotation. Zero trust goes a step further: every request is authenticated again, not just at login. No implicit trust, no tunnel magic, no "we're already inside".
Penetration testing, SBOM and supply chain
For serious apps, an annual external pen test is standard practice, or more often for major releases. A Software Bill of Materials (SBOM) has been mandatory for some sectors since 2024 and becomes more widely required under the CRA. Supply-chain security relies on dependency scanning, signed releases (Sigstore, Cosign) and strict control of build pipelines. What this means in practice for compliance software in healthcare or fintech is explained on our NEN 7510 page and our GDPR compliance page.
Compliance context
Security is not only a technical task but a legal one too. These are the relevant frameworks your app needs to take into account:
| Framework | When it applies |
|---|---|
| OWASP MASVS — Mobile Application Security Verification Standard | A generic baseline for any mobile app, with three verification levels (L1, L2, R). |
| OWASP MSTG — Mobile Security Testing Guide | A practical testing guide that translates MASVS requirements into concrete checks. |
| GDPR | Mandatory as soon as you process personal data of EU citizens. In practice, almost every consumer app. |
| PSD2 / SCA | Strong customer authentication for payment services. Banking and fintech. |
| PCI-DSS | Card transactions. In practice, most apps use tokenisation via Stripe or Mollie to stay out of scope. |
| HIPAA / NEN 7510 | Healthcare data. HIPAA for the US, NEN 7510 for the Netherlands. |
| EU CRA | The Cyber Resilience Act, fully applicable from 2027 to products with digital elements. |
| Store policies | Apple's Privacy Nutrition Labels and Google's Data Safety section. Strict and enforceable. |
It is tempting to see compliance as a checklist, but in practice it works the other way round: good security choices make the compliance paperwork easier. An audit of a well-secured app is a formal confirmation; an audit of a poorly secured app is a gauntlet.
Tooling landscape
The ecosystem of mobile security tooling has matured over the past five years. A rough overview of the categories that matter:
Static Application Security Testing (SAST)
- SonarQube — an open-core code quality and security scanner with good mobile rule sets.
- Snyk Code — SaaS, quick to integrate into CI/CD, with good iOS/Android coverage.
- Veracode — the enterprise choice, with in-depth compliance reporting.
Software Composition Analysis (SCA)
- Snyk Open Source and Mend (formerly WhiteSource) — dependency scanning with integrated fix suggestions.
- GitHub Dependabot — free for public and private repos, raises automatic PRs for patches.
Dynamic and mobile pen testing
- OWASP ZAP and Burp Suite — for API proxying and server-side pen testing.
- MobSF — Mobile Security Framework, open source, covering both static and dynamic analysis of iOS and Android.
- Frida and Objection — runtime instrumentation. Indispensable for red-team work, and just as indispensable as a target for anti-tamper measures.
- drozer — an Android-specific pen testing framework.
Runtime protection and bug bounty
- Promon Shield, Verimatrix and Appdome — commercial runtime application self-protection (RASP) suites for apps in the financial and media sectors.
- HackerOne and Intigriti — bug bounty platforms. For a serious app, a natural next step after the first pen test.
Which level, and when?
Not every app needs all three levels. A rough decision framework:
- Standard B2C app (lifestyle, content, community) — Level 1 is mandatory; parts of Level 2 (token management, MFA, screenshot protection on sensitive views) are strongly recommended.
- Banking and fintech — all three levels, with certificate pinning, device attestation and RASP as hard requirements. Plus PSD2 SCA.
- Healthcare and medical — all three levels, with NEN 7510 or HIPAA as an overlay. Medical devices also fall under MDR requirements, with their own quality system.
- B2B mid-market — Levels 1 and 2 as the baseline, with selected Level 3 components based on what customers ask for in their procurement questionnaires. ISO 27001 is often the driver here.
Level 3 is not always the right answer. For a simple B2C app, anti-tamper adds more cost and maintenance than it protects. Start with a threat analysis: who would want to attack your app, with what goal, and by what means? The answer determines where the balance tips.
Common mistakes
- Hardcoded API keys in the binary — extracting them takes a few minutes with standard reverse-engineering tools. Server-side proxying or dynamic token issuance is the right approach.
- No certificate pinning in high-value apps — for banking, healthcare and e-commerce, a man-in-the-middle attack on public Wi-Fi is a realistic scenario. Do implement pinning, and do so with a key rotation strategy.
- No logging of authentication failures — a brute-force attack on your login endpoint should be visible in monitoring. Otherwise you only find out once the damage is done.
- Overly broad permissions — an app that asks for location, contacts and SMS on installation without a visible reason risks both a store rejection and a loss of user trust.
- No update strategy — old versions of your app stay in circulation with vulnerabilities you may not even know exist. Force-update mechanisms and version deprecation are not a luxury.
- No CVD policy — without a Coordinated Vulnerability Disclosure procedure, security researchers don't know how to reach you when they find something. A simple
security.txtand a working mailbox are the minimum requirements.
If you want to get started on a new app, or have an existing app reviewed against these points, our app development service page goes into more detail on how we build security into every phase of a project.
Frequently asked questions
What is the first layer of app security we should implement?
HTTPS-only traffic and secure storage of secrets in the Keychain or Keystore. These are two measures that belong in every MVP, regardless of the type of app. Next comes the auth layer (OAuth 2.0 / OIDC) and server-side input validation. If you have these four things in place, you have the absolute basics covered.
What is the OWASP Mobile Top 10, and should we focus on it?
The OWASP Mobile Top 10 is a list of the most common mobile security risks, compiled by an international community of security professionals. For any serious app, it is the standard baseline checklist. We use the 2024 version and map the MASVS requirements to it for in-depth verification.
What is certificate pinning, and does my app really need it?
With certificate pinning, your app only trusts your own server's certificate, rather than every CA approved by the OS. This protects against man-in-the-middle attacks via compromised CAs. For banking, healthcare and payment apps it is effectively standard; for a simple content app, the extra maintenance is often not worth the effort. The choice depends on the value of the data travelling over the connection.
Is jailbreak or root detection worthwhile if it can be bypassed anyway?
Yes, even though it can be bypassed. Raising the barrier is a legitimate goal: a motivated attacker will get through, but an opportunistic one won't. For financial apps, refusing to launch on rooted devices is sensible; for other apps, a warning or a reduced feature set is often enough.
How often should we run a penetration test?
At least annually for a serious production app, and also with every major release or significant architectural change. A pen test is not a one-off event but a recurring check. Bug bounty programmes fill the gaps in between with permanent external eyes on your app.
What is the difference between GDPR and PCI DSS for our app?
The AVG (the Dutch implementation of the GDPR) covers the personal data of EU citizens and applies almost without exception. PCI-DSS applies specifically to card transaction data and only if you process or store credit card numbers yourself. In practice, almost all apps use tokenisation via a payment provider to stay outside the scope of PCI-DSS; GDPR compliance, on the other hand, is unavoidable.
What determines the cost of a security audit?
The scope (the mobile binary only, or the backend too?), the complexity of the architecture, the verification level you are aiming for (MASVS L1, L2 or R) and the level of access you give the auditor (black-box, grey-box, white-box). A grey-box audit of a mid-sized app typically takes several sprints, with a report and a follow-up round to resolve the findings.