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.
The link-handling surface
Mobile platforms let other apps and web pages hand a URL to an app. Each mechanism has a different trust property:
| Mechanism | Scheme | Claimable by other apps? | Verification |
|---|---|---|---|
| Android deep link | custom (app://) or http(s) | Yes — multiple apps can register the same filter; a disambiguation dialog may show | none by default |
| Android App Link | http/https only | No, if verified | android:autoVerify="true" + /.well-known/assetlinks.json |
| iOS custom URL scheme | custom | First-come-first-served, but not exclusive | none |
| iOS Universal Link | https | No | apple-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.
Android deep-link abuse
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) readn_intent_urifrom an incoming intent and dispatched it, bypassing the sandbox to reach non-exported components (Microsoft). AClass.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/Intentobjects 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.
iOS URL-scheme and Universal Link abuse
- OAuth code theft via
ASWebAuthenticationSession. The session carries Safari cookies. Combined with an OAuthprompt=nonesilent-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 bypassredirect_uriorigin 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 atel: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.
Related
- Mobile Application Security · WebView Vulnerabilities · Android App Security · iOS App Security · OAuth 2.0 Vulnerabilities · Account Takeover · OWASP Mobile Top 10
Sources
- Deep Linking Vulnerabilities cheat sheet · original
- Unsafe use of deep links (Android Developers) · original
- Android Pentest: Deep Link Exploitation · original
- How a Login Link Could Switch kChat to an Attacker's Server · original
- One Deep Link, Zero Validation, Full ATO (Again) · original
- Intent redirection in a third-party SDK (EngageLab) · original
- Mobile OAuth Attacks — iOS URL Scheme Hijacking Revamped · original
- iOS Universal Links (HackTricks) · original
- Evil PWA Attack on Casdoor · original
- OAuth Is Not the Finish Line: Testing Token Lifecycle and Mobile API Trust Boundaries · original
- DreameHome cloud API insecure direct object reference · original