smaple.tr
mobile app security

Mobile App Security: OWASP Mobile Top 10 Implementation Guide [2026]

Mehmet Kurtipek
November 22, 2025
11 min read
mobile app security
OWASP mobile
certificate pinning
secure storage
mobile DevSecOps

Mobile applications are the most widely attacked surface in enterprise and consumer software. IBM's X-Force Threat Intelligence Index reports mobile app vulnerabilities as a top-five initial attack vector, with credential theft and insecure data storage accounting for the majority of successful exploits. Unlike server-side vulnerabilities, mobile app security flaws are directly accessible to any user who installs the app — no network perimeter to breach.

This guide covers the OWASP Mobile Top 10, secure storage implementation, transport layer security including certificate pinning, authentication patterns, and integrating security into the development pipeline. By the end, you will have a concrete checklist for production mobile app security that survives security review.

Mobile App Security: Why the Attack Surface Is Unique

Web application security has decades of hardened tooling: WAFs, intrusion detection, network segmentation. Mobile security has the opposite problem — the application binary runs on an attacker-controlled device. Every APK and IPA file distributed through app stores can be downloaded, decompiled, and analyzed. Every network request can be intercepted with a proxy. Every piece of data stored on-device is a potential extraction target if the device is compromised.

Three characteristics distinguish mobile app security from server-side security:

The device is untrusted. Unlike a server in a hardened data center, the device running your application can be jailbroken, rooted, connected to a malicious proxy, or running malware with keylogging capabilities. Security controls cannot rely on the device OS being unmodified.

API keys and secrets are extractable. Any secret hardcoded in the application binary — API keys, encryption keys, OAuth client secrets — can be extracted by anyone with the binary and a decompiler. Mobile applications cannot store secrets the same way server applications do.

Network traffic is interceptable. Mobile users frequently connect through untrusted networks: coffee shop WiFi, hotel networks, corporate proxies. Without transport layer validation beyond basic TLS, man-in-the-middle attacks are practical.

OWASP Mobile Top 10: Implementation Guidance

The OWASP Mobile Top 10 is the authoritative reference for mobile application security vulnerabilities. Each category requires specific implementation countermeasures.

M1: Improper Credential Usage

Storing credentials, API keys, or authentication tokens in insecure locations is the most common mobile security failure. Common violations:

  • Hardcoded API keys in source code (extractable by decompilation)
  • Credentials stored in SharedPreferences (Android) or NSUserDefaults (iOS) in plaintext
  • Tokens logged to system logs accessible to other apps

Correct implementation: Use Android Keystore or iOS Keychain for all sensitive data. These hardware-backed secure storage mechanisms protect data with keys that never leave the secure enclave.

// Android - Store with BiometricPrompt-protected Keystore key
val keyGenSpec = KeyGenParameterSpec.Builder(
    "user_credentials",
    KeyProperties.PURPOSE_ENCRYPT or KeyProperties.PURPOSE_DECRYPT
).apply {
    setBlockModes(KeyProperties.BLOCK_MODE_GCM)
    setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
    setUserAuthenticationRequired(true)
    setUserAuthenticationParameters(30, KeyProperties.AUTH_BIOMETRIC_STRONG)
}.build()

M2: Inadequate Supply Chain Security

The average mobile application depends on 40–80 third-party libraries. NIST reports that 22% of packages in common mobile dependency trees contain at least one known CVE. Supply chain attacks — injecting malicious code through compromised dependencies — are an increasing threat.

Controls: Software Composition Analysis (SCA) tools (Snyk, Dependabot, OWASP Dependency-Check) should run in CI on every build. Pin dependency versions, not version ranges, to prevent automatic upgrade to a malicious release. Audit new dependencies against the VirusTotal API before adding them to the project.

M3: Insecure Authentication and Authorization

OAuth 2.0 and OpenID Connect implementations with implementation errors are more dangerous than basic username/password — the false sense of security from using a "secure" protocol is itself a vulnerability.

Critical implementation requirements:

  • Use PKCE for all OAuth mobile flows (prevents authorization code interception)
  • Validate token signatures against the authorization server's JWKS endpoint on every request
  • Implement token expiration checks client-side to prevent use of expired tokens
  • Never store refresh tokens in SharedPreferences or NSUserDefaults; use Keystore/Keychain

M4: Insufficient Input/Output Validation

Mobile applications that pass user input directly to backend APIs without validation are vulnerable to injection attacks — not just SQL injection but also path traversal, command injection, and deserialization attacks in backend services.

Controls: Validate all inputs against allowlists (not denylists). Encode outputs. Use parameterized queries for any database-adjacent logic in the mobile client. Validate server response schemas before processing — a compromised CDN serving a malformed JSON response should not cause the app to crash or execute unexpected code paths.

M5: Insecure Communication

Transport layer security is the minimum requirement. Common failures beyond missing HTTPS:

  • TLS 1.0/1.1 still accepted (deprecated by RFC 8996; remove from allowed cipher suites)
  • Self-signed certificates accepted (testing shortcut that makes it to production)
  • Certificate pinning absent (leaves the app vulnerable to traffic interception via trusted CA certificate)
  • HTTP fallback allowed when HTTPS request fails

Certificate pinning implementation: Pin the server's public key, not the certificate (key pinning survives certificate renewal without app update). Implement backup pins for the CA intermediate to prevent complete lockout if the server certificate is lost.

// iOS - URLSessionDelegate certificate pinning
func urlSession(_ session: URLSession,
               didReceive challenge: URLAuthenticationChallenge,
               completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
    guard challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust,
          let serverTrust = challenge.protectionSpace.serverTrust,
          let certificate = SecTrustGetCertificateAtIndex(serverTrust, 0) else {
        completionHandler(.cancelAuthenticationChallenge, nil)
        return
    }
    let serverPublicKey = SecCertificateCopyKey(certificate)
    let pinnedPublicKeys = loadPinnedPublicKeys() // Load from bundle at build time
    if pinnedPublicKeys.contains(serverPublicKey) {
        completionHandler(.useCredential, URLCredential(trust: serverTrust))
    } else {
        completionHandler(.cancelAuthenticationChallenge, nil)
    }
}

M6: Inadequate Privacy Controls

GDPR Articles 32 and 25 (security of processing and privacy by design) impose technical obligations on applications processing EU personal data. HIPAA imposes equivalent requirements for US healthcare data. Implementation requirements:

  • Explicit consent collection before data processing, with purpose limitation
  • Data minimization: request only permissions the app actually uses
  • Retention limits: data deleted at the earlier of user deletion request or retention policy expiration
  • Right of access: export all data associated with a user account on request
  • Right to erasure: cascade delete across all services when user requests deletion

M7: Insufficient Binary Protections

Decompiled mobile app binaries expose business logic, API endpoints, encryption key derivation, and hardcoded configuration. Code protection measures:

Obfuscation. ProGuard/R8 for Android (renames classes and methods, removes unused code), symbol stripping for iOS release builds. These raise the cost of analysis without making it impossible.

Integrity checking. Calculate a hash of the application binary at first launch and store it securely. Subsequent launches verify the hash matches — modified binaries fail verification. Note: this is bypassable by a sophisticated attacker; it raises the bar, not eliminates the risk.

String encryption. Encrypt sensitive string constants (API endpoint paths, algorithm configuration) so they are not directly readable in the binary. Available through libraries like DexGuard (Android) and iXGuard (iOS).

M8: Security Misconfiguration

Common misconfigurations in production mobile applications:

  • Debug builds deployed to production (includes verbose logging, disabled certificate pinning, debug API endpoints)
  • AllowArbitraryLoads set to true in iOS App Transport Security (disables TLS requirements)
  • Android android:debuggable="true" in production manifest
  • Cleartext traffic allowed for non-loopback addresses

Controls: Build configuration validation in CI — reject production builds that include debug flags. Use separate build configurations for development and production with distinct signing certificates and feature flags.

M9: Insecure Data Storage

Beyond secure credential storage, production applications commonly store sensitive data in locations accessible to other apps or through device backup:

  • Database files without SQLCipher encryption
  • Exported files in external storage (world-readable on Android)
  • Clipboard contents containing sensitive data (credit card numbers, tokens)
  • Application screenshots in the app switcher (iOS background snapshot)

Controls: Use SQLCipher for local database encryption when sensitive records must be stored. Set FLAG_SECURE (Android) or allowScreenshots: false (iOS) to prevent sensitive content in app switcher previews. Clear clipboard after authentication flows complete.

M10: Insufficient Cryptography

Cryptographic failures: using deprecated algorithms (MD5, SHA-1, DES), ECB cipher mode (deterministic encryption reveals plaintext patterns), static IVs, or self-implemented cryptographic primitives.

Standards:

  • Symmetric encryption: AES-256-GCM with random IV per encryption operation
  • Password hashing: bcrypt (cost factor 12+), scrypt, or Argon2id
  • Key derivation: PBKDF2 with SHA-256, minimum 100,000 iterations
  • TLS: minimum 1.2, prefer 1.3; ECDHE cipher suites for forward secrecy

Biometric Authentication Implementation

Biometric authentication (Face ID, Touch ID, fingerprint) is more phishing-resistant than passwords and significantly improves user experience in high-frequency authentication scenarios. Implementation requires platform-specific APIs.

iOS — LocalAuthentication framework:

import LocalAuthentication

let context = LAContext()
var error: NSError?

if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
    context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics,
                          localizedReason: "Authenticate to access your account") { success, authError in
        DispatchQueue.main.async {
            if success {
                // Retrieve stored credentials from Keychain
            } else {
                // Handle fallback to PIN/password
            }
        }
    }
}

Android — BiometricPrompt API: The BiometricPrompt API (API 28+) provides a unified interface for fingerprint, face, and iris authentication, integrating with the Keystore system to decrypt credentials only after successful biometric verification.

Security Testing and SAST/DAST Integration

Security testing for mobile applications combines static analysis (SAST), dynamic analysis (DAST), and manual penetration testing.

Automated Security Scanning in CI/CD

SAST tools for mobile:

  • MobSF (Mobile Security Framework) — open-source static and dynamic analysis for APK and IPA files
  • Semgrep with mobile rule sets — configurable pattern matching for common vulnerability patterns
  • Android Lint security checks — built into Android Studio, catches common Android-specific security issues

DAST for mobile:

  • OWASP ZAP with mobile proxy configuration — intercepts and analyzes API traffic
  • Burp Suite — professional HTTP proxy with mobile app testing extensions

A production CI/CD pipeline for mobile security runs SAST on every PR, MobSF on release candidates, and DAST against staging environments before deployment. In CI pipelines at Smart Maple, we block merges when SAST detects new high-severity findings — treating security regressions the same as test failures.

Penetration Testing Scope

Manual penetration testing for mobile applications covers:

  1. Binary analysis — APK/IPA decompilation, string extraction, algorithm identification
  2. Static analysis — Source code review for security vulnerabilities
  3. Dynamic analysis — Runtime behavior analysis with proxy interception
  4. API testing — Authorization bypass, BOLA/IDOR testing, rate limiting validation
  5. Authentication testing — Token handling, session management, MFA bypass attempts
  6. Encryption testing — Key storage, algorithm strength, IV reuse detection
  7. Network testing — Certificate pinning bypass attempts, downgrade attacks

Penetration testing cadence: at minimum annually, before major releases, and after significant architectural changes. Organizations under SOC 2 Type II audit requirements typically need quarterly or semi-annual testing evidence.

DevSecOps Pipeline for Mobile

Security integrated into the development pipeline prevents vulnerabilities from reaching production rather than detecting them after release.

Pipeline stages:

  1. Pre-commit hooks: Secret detection (detect-secrets, truffleHog) prevents credential commits
  2. PR gate: SAST (Semgrep, Android Lint), dependency CVE scan (Snyk), code review checklist
  3. Build: Dependency pinning verification, debug flag check, signing certificate validation
  4. Release candidate: MobSF scan, OWASP ZAP against staging API, ProGuard/R8 obfuscation verification
  5. Production deployment: Binary integrity hash generation, certificate pinning verification

Security controls in the pipeline reduce the cost of vulnerability remediation by catching issues when they are introduced rather than during penetration testing. NIST estimates that fixing a vulnerability found in development costs 10x less than fixing one found in penetration testing and 100x less than one found in production. For teams extending this to their broader software delivery process, DevSecOps covers security automation across the full CI/CD pipeline — not just mobile-specific tooling.

Compliance-Driven Security Requirements

GDPR Technical Safeguards (Article 32)

GDPR requires "appropriate technical and organisational measures" for personal data processing. For mobile applications, this translates to:

  • End-to-end encryption for personal data in transit
  • Encryption at rest for personal data stored on device
  • Access logging for personal data access operations
  • Breach notification capability within 72 hours (requires monitoring infrastructure)
  • Data minimization in analytics and crash reporting (anonymize crash reports, avoid logging personal data)

HIPAA Technical Safeguards

For healthcare applications processing Protected Health Information (PHI):

  • Unique user identification (no shared logins)
  • Automatic logoff after inactivity period (configurable, typically 15 minutes)
  • Encryption of ePHI in transit (TLS 1.2+) and at rest (AES-256)
  • Audit controls: log all access to ePHI with user, timestamp, action, and data element

Conclusion

Mobile app security is not a feature added at the end of development — it is an architectural discipline applied from the first design decision. The OWASP Mobile Top 10 provides a systematic framework for the most impactful vulnerability categories, but production security requires continuous attention: dependency scanning, certificate pinning rotation, penetration testing cadence, and security-aware code review.

The asymmetry of mobile security — attackers need to find one vulnerability, defenders need to close all of them — makes systematic coverage the only viable approach. Teams that treat security as a checklist item rather than an ongoing practice consistently produce applications with exploitable vulnerabilities that survive multiple release cycles undetected.

Related Articles

August 11, 2026

MLOps Guide: Taking Machine Learning Models to Production [2026]

87% of machine learning models built by data science teams never reach production. The models work — they pass cross-validation, they score well on holdout sets, they demonstrate genuine predictive value. The problem is not the modeling. The problem is everything that happens between a notebook experiment and a reliable, monitored, production system. MLOps is the discipline that closes that gap. This guide covers the full MLOps stack: maturity levels, tooling choices (MLflow, DVC, Kubeflow

Read More
August 10, 2026

LLM Fine-Tuning Guide: Custom Model Training with LoRA and QLoRA [2026]

General-purpose LLMs are impressive. They can write code, summarize documents, answer questions, and translate between languages with reasonable accuracy. But "reasonable" is not good enough when your application requires consistent output format, domain-specific terminology, a particular tone, or behavior that the base model was never trained to exhibit. That gap is where fine-tuning matters. Fine-tuning updates a model's weights on your specific data, changing how the model behaves — not

Read More
August 9, 2026

Computer Vision Applications: Object Detection, OCR, and Industrial AI [2026]

Computer vision has moved well past the research phase. The models are trained, the frameworks are mature, the hardware is accessible, and the use cases are generating measurable returns. What was a specialized capability requiring deep expertise in 2018 is now deployable infrastructure — if you know which component to reach for and where the real complexity lives. This guide covers computer vision applications across industrial, medical, logistics, and document processing domains. It expl

Read More