Join our Newsletter — 33% off our NHI Course
Home› Guides› Mobile Deep Link and App Link Security Guide:…
Guide Application Security

Mobile Deep Link and App Link Security Guide: Verified Links and Intent Safety

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 16 min read
On this page

Every deep link is an unauthenticated entry point into a mobile app, and a hijacked or unvalidated one can hand an attacker a session token, an OAuth code or a one-tap action the user never meant to take. Custom URL schemes can be claimed by any installed app, verified links only prove which app owns a domain, and the path and query of every link remain under the sender's control. This guide covers Android deep links and App Links, iOS custom URL schemes and Universal Links, intent redirection, and the OAuth redirect case, with the OWASP MASVS and MASTG tests that apply. It is written for mobile developers, mobile security testers and AppSec leads who own the handlers. For the general input validation picture see the OWASP Mobile Top 10 M4 Insufficient Input and Output Validation Guide; this page goes deeper on link routing and handler design.

Key takeaways

  • Custom schemes are not owned by anyone. On both Android and iOS another app can register the same scheme, so a myapp:// link must never carry secrets or trigger a sensitive action on its own.
  • Verification proves the domain, not the content. Android App Links and iOS Universal Links stop another app from claiming your links, but OWASP MASTG is explicit that the path and query parameters stay caller-controlled.
  • Treat every handler as a public API. Convert types, check bounds, allowlist actions and resources, and recheck authentication and authorisation state before acting.
  • Intent redirection is the deep link's quieter cousin. An exported activity that forwards a nested Intent can expose unexported components and URI permissions; sanitise or avoid forwarding.
  • OAuth on mobile depends on link ownership. RFC 8252 (BCP 212) prefers claimed https redirect URIs and requires PKCE for native apps, because private-use scheme redirects can be intercepted.

A deep link is a URI that opens a specific screen or action in an app. The operating system decides which app receives the link, then hands the full URI to a handler in the app. Security depends on two separate questions: who can receive the link (routing), and what the handler does with the data (handling). Most incidents and bug reports fall into one of the two.

Link typePlatformHow the OS routes itCan another app claim it?Typical risk
Custom URL scheme (myapp://)AndroidIntent filter with ACTION_VIEW, BROWSABLE and a non-http schemeYes, any app can declare the same filter; a disambiguation dialog may appearLink collision, phishing via a lookalike app, parameter tampering
Unverified web deep link (http/https without autoVerify)AndroidSame intent filter, web scheme, no domain proofYes, until verification succeedsInterception of links carrying tokens or codes (MASTG-TEST-0393)
Android App LinkAndroid 6.0 (API 23) and laterandroid:autoVerify="true" plus /.well-known/assetlinks.json on each hostNo, once verifiedUnvalidated parameters, broken verification after redirects
Custom URL schemeiOSCFBundleURLTypes in Info.plist, delivered to application(_:open:options:) or scene(_:openURLContexts:)Yes; MASTG notes iOS gives no guaranteed resolution order when schemes collideScheme hijacking, missing source and input validation
Universal LinkiOScom.apple.developer.associated-domains entitlement with applinks: entries plus the AASA fileNo, the AASA file binds Team ID and bundle ID to the domainUnvalidated path and query, open redirects into WebViews

Android routing details that matter

  • Verification is per host: Android fetches https://<host>/.well-known/assetlinks.json for every declared android:host. The file must list the package name and the signing certificate SHA-256 fingerprint and must be served over HTTPS without redirects. A redirect from example.com to www.example.com silently breaks verification.
  • Older Android versions fail open: MASTG records that before Android 12 (API 31) a single non-verifiable link in the app, such as a missing autoVerify or a custom scheme inside a verified filter, can make the system skip verification for all of the app's App Links.
  • Android 12 and later: a generic web intent resolves to the user's default browser unless the app is approved for that domain, which reduces collision risk for unverified web links but does nothing for custom schemes.
  • No caller identity: unlike iOS, Android gives a deep link handler no built-in way to identify which app sent the Intent. Any app can fire an Intent at an exported filter.

iOS routing details that matter

  • AASA file: iOS downloads apple-app-site-association from https://<domain>/.well-known/ or via Apple's CDN at install time and refreshes it periodically. The appIDs must match Team ID plus bundle ID. The exclude key is a routing filter, not a security control.
  • Delivery path: Universal Links arrive as an NSUserActivity with type NSUserActivityTypeBrowsingWeb through application(_:continue:restorationHandler:), scene(_:continue:) or SwiftUI onContinueUserActivity, and carry no sourceApplication.
  • Source checks are limited: for custom schemes, sourceApplication is populated only when the caller belongs to the same Apple Developer Team, so it is useful for restricting a scheme to your own app suite, not for identifying arbitrary callers (MASTG-BEST-0055).

Attack patterns defenders should design against

The following patterns come from the OWASP MASTG test cases and Android's own risk guidance. They are described at the level needed to build and test defences.

PatternWhat goes wrongTypical consequencePrimary control
Deep link collision and hijackingA second app registers the same scheme or unverified web linkLogin links, magic links or OAuth codes delivered to the wrong appVerified App Links and Universal Links; no secrets in custom-scheme URIs
Parameter tamperingHandler trusts values such as amount, userId or actionBusiness logic bypass, one-tap state changes (CSRF-style)Type conversion, bounds checks, allowlists, confirmation screens
URL into WebViewA url or page parameter is loaded into an in-app WebViewAttacker content running inside a trusted frame, possibly with a JavaScript bridgeHost allowlist before loadUrl; see the Mobile WebView Security Guide
Path traversalA parameter is used as a file pathReading or overwriting app-private filesCanonicalise and confirm the path stays under a base directory
Token leakage in linksBearer tokens or session IDs placed in deep link URIsToken theft by a colliding app or via logs and referrers (MASTG cites public bug reports of exactly this)Never place long-lived credentials in links; use short-lived, single-use codes bound to the session
Intent redirectionAn exported component forwards a nested Intent from extrasAccess to unexported components or content providersAvoid forwarding; IntentSanitizer, resolveActivity checks, PendingIntent

In MITRE ATT&CK for Mobile, link interception of this kind is tracked as T1635.001 URI Hijacking under T1635 Steal Application Access Token, which is a useful reference when you model OAuth and magic link flows. See the MITRE ATT&CK for Mobile Guide.

OWASP MASTG best practices BEST-0070, BEST-0071 and BEST-0072 and Apple's guidance on supporting universal links converge on the same handler design. Apple's documentation treats universal links as an entry point into the app and says to validate parameters, discard malformed URLs and limit the actions a link can trigger.

  1. Confirm the delivery type: on iOS, handle only NSUserActivityTypeBrowsingWeb activities and read webpageURL; on Android, read Intent.getData() in both onCreate and onNewIntent() so warm and cold starts follow the same checks.
  2. Parse with platform APIs: use Uri on Android and URLComponents on iOS. Never parse links with string splitting or regular expressions that miss encoding tricks.
  3. Match the route against an allowlist: map each accepted path to a known screen. Reject anything unknown rather than falling through to a default handler.
  4. Convert and bound every value: numbers through toLongOrNull() or Int.init, with explicit minimum and maximum; identifiers checked against format; enumerated values checked against a fixed set.
  5. Re-establish context: a link must not imply authentication. Check the session, the user's rights to the referenced object, and any step-up requirement before showing data or acting.
  6. Make state changes explicit: a link may navigate to a pre-filled confirmation screen; it should not complete a payment, change an email address, accept an invitation or link a device without a user action in the app.
  7. Never forward raw URLs: if a parameter selects a web page, resolve it from an internal map or validate scheme and host against an allowlist before loading it anywhere.
  8. Restrict the surface: set android:exported="false" on activities that do not need to be reachable by other apps, and keep routing activities thin so they hand off to internal, non-exported screens.

Magic links, password resets and invitations

Links that authenticate are the highest-value targets. Use verified App Links and Universal Links only, make the code single-use and short-lived, bind it server-side to the device or session that requested it where the flow allows, and show the user what is about to happen before completing sign-in. Treat a link opened on a different device from the one that requested it as suspicious. See the Account Takeover Prevention Guide for the server-side signals that complement these checks.

OAuth redirects and app-to-app flows

Native app sign-in is where deep link routing becomes an identity control. RFC 8252, OAuth 2.0 for Native Apps, is Best Current Practice BCP 212. Section 7 defines three redirect options that authorisation servers must support: private-use URI schemes (7.1), claimed https scheme URIs (7.2) and loopback interface redirects (7.3). The RFC says apps should use claimed https redirects over the other options where possible, because the OS verifies domain ownership.

  • PKCE is mandatory: Section 6 requires public native clients to implement PKCE and servers to support it, and Section 8.1 says servers should reject native app requests without it. PKCE turns an intercepted authorisation code into a useless one.
  • No embedded user agents: Section 8.12 says native apps must not use embedded user agents (in-app WebViews) for authorisation requests. Use the system browser or an in-app browser tab such as Custom Tabs or ASWebAuthenticationSession.
  • Impersonation: Sections 8.6 to 8.8 cover client impersonation and fake or malicious external user agents. Do not rely on a redirect URI as client authentication for a public client.
  • Machine credentials: never ship a client secret in a mobile app to "secure" a redirect; a public client has no secret worth the name. See the OAuth for Native and Mobile Apps Guide and the OWASP Mobile Top 10 M1 Improper Credential Usage Guide.

Android's risk guidance describes intent redirection as an attacker partly or fully controlling an Intent that the vulnerable app uses to launch another component, for example a serialised Intent in an extra. The impact ranges from triggering internal features to reaching unexported content providers.

  • Do not forward nested Intents: the simplest fix is to remove the feature. If you cannot, validate the target with resolveActivity() against an expected package and class, and strip FLAG_GRANT_READ_URI_PERMISSION, FLAG_GRANT_WRITE_URI_PERMISSION, FLAG_GRANT_PERSISTABLE_URI_PERMISSION and FLAG_GRANT_PREFIX_URI_PERMISSION. AndroidX IntentSanitizer builds an allowlist of components, data and types.
  • Common mistakes Google calls out: treating a non-null getCallingActivity() as proof of a trusted caller, and assuming checkCallingPermission() throws when it actually returns an integer.
  • Use the platform's guard rails: for apps targeting Android 12 and later, the StrictMode unsafe intent launch detection (documented as DetectUnsafeIntentLaunches) flags code that unparcels a nested Intent and launches it. Android's guidance also describes default hardening against intent redirection in Android 16, with an opt-out that should be used only when strictly necessary.
  • Prefer explicit and immutable Intents: use explicit Intents for internal IPC and immutable PendingIntent objects (MASTG-BEST-0056, MASTG-BEST-0063).

Testing and verification

The OWASP MASTG maps deep link testing to MASVS-PLATFORM-1 (secure IPC) and MASVS-CODE-4 (validate and sanitise untrusted input). Use these test IDs in your test plan so findings trace back to a public standard.

MASTG testPlatformWhat it checksPass condition
MASTG-TEST-0393 Use of Unverified App LinksAndroidhttp/https intent filters without autoVerifyEvery web deep link filter verifies, and verification succeeds on device
MASTG-TEST-0394 Missing Input Validation in Custom URL Scheme HandlersAndroidHandler use of getData() and getQueryParameter()Type conversion, bounds, sanitisation and allowlists before use
MASTG-TEST-0370 and 0371iOSInput and source validation in custom URL scheme handlersValidated parameters; sourceApplication checked for privileged actions
MASTG-TEST-0395 Missing Input Validation in Universal Link HandlersiOSUse of webpageURL path and querySame validation as custom schemes, no trust in the verified domain alone
MASTG-TEST-0028 Testing Deep LinksAndroidEnumeration and dynamic testing of declared links (older test, superseded in part by the beta tests)No undocumented or debug routes reachable
  • Static checks in CI: lint the merged AndroidManifest.xml for web schemes without autoVerify, exported activities with BROWSABLE, and custom schemes inside verified filters. On iOS, diff the entitlements and CFBundleURLTypes between releases.
  • Verification checks on device: adb shell pm get-app-links <package> shows App Link verification state; Apple's AASA validation tooling and the CDN URL show what iOS sees.
  • Server-side monitoring of association files: monitor assetlinks.json and apple-app-site-association for availability, redirects and content changes. A CDN or WAF change that adds a redirect breaks verification without any app release.
  • Route inventory: keep a register of every route, its parameters, whether it needs a session, and its owner. Testers fuzz the register; release review rejects new routes that are not in it.

See the Mobile App Security Testing Guide for the wider MASTG test programme.

  1. Inventory: extract every intent filter, URL type and associated domain from the shipped builds, not the source tree, and list every route the handlers accept.
  2. Classify routes: navigation only, data display, state change, authentication. Anything in the last two classes moves to verified links and gets explicit confirmation.
  3. Fix verification first: publish correct association files on every host, remove redirects, add autoVerify, and confirm on test devices across the Android versions you support.
  4. Harden handlers behind a flag: ship the new validation in log-only mode for one release, recording links that would be rejected, then enforce. Rollback is a remote config switch back to log-only, not a new binary.
  5. Retire custom schemes for sensitive flows: keep them only for low-risk navigation and inter-app calls within your own suite, and plan deprecation with marketing and partner teams who embed links.
  6. Gate releases: add the static checks and MASTG test IDs to the release checklist so regressions are caught before store submission.

Small teams with one app can do this in a sprint. Large organisations with many apps and marketing link providers need a shared association file owner, because one platform team editing assetlinks.json can break every app on the domain.

Detection and measurement

  • Handler rejections: log route, rejection reason and app version (never the full URI if it may contain codes). A spike in rejections on one route often signals probing or a broken campaign link.
  • Authentication anomalies: magic link or OAuth code redemptions from a different device or app instance than the one that started the flow.
  • Association file health: synthetic checks for HTTP status, redirects and fingerprint content.
MetricTarget
Web deep link filters with successful verification on supported Android versions100%
Sensitive routes (state change, authentication) reachable through custom schemes0
Routes in the inventory with documented parameters, validation and owner100%
MASTG deep link tests (0393, 0394, 0370, 0371, 0395) passing at releaseAll applicable
Association file availability (synthetic monitoring)At or above your web SLO
Median time to fix a deep link finding from bug bounty or testingTracked and falling

Framework mapping

FrameworkReferenceHow it applies
OWASP MASVSMASVS-PLATFORM-1, MASVS-CODE-4Secure IPC use; validation and sanitisation of untrusted input
OWASP Mobile Top 10 2024M4 Insufficient Input/Output Validation; M3 Insecure Authentication/AuthorizationHandler validation; links that skip authorisation checks
NIST SP 800-53 Rev 5SI-10 Information Input Validation; SA-11 Developer Testing and Evaluation; SA-8 Security and Privacy Engineering PrinciplesValidation design and test evidence
NIST CSF 2.0PR.PS-06Secure development practices integrated and monitored
ISO/IEC 27001:2022 Annex AA.8.28 Secure coding; A.8.29 Security testing in development and acceptanceCoding standard for handlers; release testing
CIS Controls v8.1Control 16 Application Software SecuritySecure design and testing of in-house apps
MITRE ATT&CK for MobileT1635.001 URI HijackingThreat model for OAuth and magic link interception

Common failure patterns

  • Tokens in custom-scheme links: a reset or login link uses myapp://login?token=.... Any app claiming the scheme can capture it. MASTG lists public bug reports of bearer tokens stolen from deep links.
  • Verified on paper, unverified in practice: autoVerify is set but a CDN redirect or a missing subdomain file means verification fails, and nobody checks device state.
  • The domain is trusted, so the link is trusted: a Universal Link handler loads ?page= into a WebView because the link came from the company's own domain, ignoring that anyone can craft that URL.
  • One-tap state changes: follow, invite-accept or transfer actions complete on link open, which turns a shared link into cross-site request forgery for mobile.
  • Forgotten debug routes: test or QA routes that bypass login ship in production builds and are found by enumerating the manifest.
  • Embedded WebView sign-in: OAuth flows rendered in an in-app WebView, against RFC 8252 Section 8.12, exposing credentials to the app and teaching users to type passwords into unverifiable screens.

Practitioner checklist

  • Inventory every scheme, intent filter, associated domain and route from the shipped binaries.
  • Move all authentication, reset, invitation and payment links to verified App Links and Universal Links.
  • Publish and monitor assetlinks.json and apple-app-site-association on every host, with no redirects.
  • Validate every parameter: type, bounds, format, allowlist; reject unknown routes.
  • Recheck session, object-level authorisation and step-up before any data display or state change.
  • Never load a link-supplied URL into a WebView without a host allowlist.
  • Use PKCE and the system browser for OAuth; prefer claimed https redirects per RFC 8252.
  • Remove nested Intent forwarding or sanitise it with IntentSanitizer and resolveActivity() checks.
  • Add MASTG-TEST-0393, 0394, 0370, 0371 and 0395 to the release test plan.
  • Log handler rejections without logging codes or tokens, and alert on spikes.

Standards and references

Related NHI Mgmt Group resources: OWASP Mobile Top 10 M4 Insufficient Input and Output Validation Guide · Mobile WebView Security Guide · OAuth for Native and Mobile Apps Guide · Mobile App Security Guide · OWASP Mobile Top 10 Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.