Mobile OAuth and Deep Link Attacks

How mobile apps route inbound URLs — custom schemes, Android deep links/App Links, iOS Universal Links — and the validation failures that turn a crafted link into account takeover, file theft, or privilege escalation.

Mobile platforms let other apps and web pages hand a URL to an app. Each mechanism has a different trust property:

MechanismSchemeClaimable by other apps?Verification
Android deep linkcustom (app://) or http(s)Yes — multiple apps can register the same filter; a disambiguation dialog may shownone by default
Android App Linkhttp/https onlyNo, if verifiedandroid:autoVerify="true" + /.well-known/assetlinks.json
iOS custom URL schemecustomFirst-come-first-served, but not exclusivenone
iOS Universal LinkhttpsNoapple-app-site-association (AASA) + Associated Domains entitlement

Custom schemes and unverified deep links are the weak forms: any app can claim the scheme, and a browser page can trigger it. App Links and Universal Links are the hardened forms, but only when autoVerify/AASA are correct and the receiver still validates the payload.

A deep link is an input to whatever the target activity does. Failures:

  • Missing/weak validation → ATO. A deep link that feeds an untrusted server address or URL into a sensitive flow. kChat (kchat://<server>/login/one_time_link?t=...) took the server address from the link without checking it belonged to kChat; an attacker server captured the magic-link token and push tokens, then received messages (High, CVSS 7.1). The abdelnasserr writeups show the pattern repeatedly: scheme://webview?url= with no scheme/domain validation, where a WebView re-issues requests through an OkHttp client injecting auth headers → one-click ATO (often rediscovered after a “fixed” dup).
  • Intent redirection. An exported component forwards an attacker-controlled intent/extra under the app’s identity. EngageLab’s MTCommonActivity (in millions of apps incl. crypto wallets) read n_intent_uri from an incoming intent and dispatched it, bypassing the sandbox to reach non-exported components (Microsoft). A Class.forName() on an attacker string launches arbitrary internal activities — frequently an insecure WebView (see WebView Vulnerabilities).
  • Parser abuse. Deep-link parsers that rebuild Serializable/Parcelable/Intent objects from bytes can set insecure flags or reach arbitrary components. Impact ladder: data exposure, session hijack, open redirect, LFI, XSS, RCE (developer.android.com MASVS-PLATFORM; InjuredAndroid via Drozer).

Defense: android:autoVerify="true" + assetlinks.json; validate every extra and the full URL (scheme + host + path); treat exported components as attacker-reachable.

  • OAuth code theft via ASWebAuthenticationSession. The session carries Safari cookies. Combined with an OAuth prompt=none silent-auth flow, a malicious app opens an attacker domain (so the consent prompt shows attacker.com, not victim.com), which 302-redirects into the victim app’s auth endpoint; the returned auth code lands on the attacker’s custom scheme. ~30 popular apps plus an iOS feature were vulnerable — ATO bypassing PKCE, no classic scheme-squatting needed (Connelly & Ahrens). Evil-PWA variants abuse custom protocol handlers to bypass redirect_uri origin checks (Casdoor).
  • Universal Links. AASA can leak sensitive/unreleased paths; since iOS 14 it’s also served from Apple’s CDN, so triage both origin and cached copies. Weak receiver validation in application:continueUserActivity:restorationHandler: permits spoofing (CVE-2024-10474). Test with MASTG-TEST-0070 / AASA Validator.
  • Confirmation-prompt bypass. Chrome for iOS treated Shortcuts (shortcuts://, workflow://) as trusted; a page chained navigation to Shortcuts with a tel: callback, reaching the phone handler without Chrome’s user-gesture check (CVE-2026-13795).

Beyond the login: token lifecycle

A completed OAuth flow is not the end of the test. An app can use HTTPS, encrypted token storage and valid JWT signatures while the backend still authorizes weakly; the token lifecycle (refresh-token issuance, reuse and revocation) and the mobile-to-backend trust boundary need their own tests, with RFC 9700 (OAuth security BCP) and RFC 10017 (Aug 2026, OAuth for browser-based apps) as baselines. Only the article’s outline is available (Rebline CyberSec). Companion-app cloud APIs show the backend side: DreameHome’s POST /dreame-user-iot/token/rtc2 minted a live-video RTC token for any supplied device DID and owner UID (CVE-2026-49964) (GHSA-3pfg-cg22-v3rr).

Testing

Enumerate intent filters / CFBundleURLSchemes / Associated Domains and AASA; check autoVerify and assetlinks.json; fuzz every extra and URL component; trace where link data flows (WebView loads, auth flows, Class.forName, OkHttp header injection). Drozer/ADB am start for Android; craft custom-scheme pages for iOS.

Sources