medium · M4 · MASVS-PLATFORM-1 · PTKD-DEEPLINK-URL-LOAD
Deep link URL loaded or opened without a host check (heuristic)
A deep link, app link or intent that any app or web page can send carries a URL, and the app loads that URL into its WebView or opens it, with no check of the host. An attacker's link then shows their page inside the app (with the app's cookies, JavaScript bridges and trusted look) or bounces the user to it (open redirect).
How it is exploited
The app handles myapp://open?url=… by loading the url parameter into its WebView. An attacker posts a link myapp://open?url=https://evil.example/login; the victim taps it, the app shows the attacker's login page inside its own trusted frame, and any JavaScript bridge or session cookie of that WebView is now available to the attacker's page.
Why it matters
Phishing inside the real app, theft of session cookies or bridge calls (WebView takeover), or an open redirect that lends the app's name to any site.
How to fix it
- Parse the URL and compare scheme and host against an allowlist of your own domains before loading or opening it; reject everything else.
- Open third-party links in the system browser or SFSafariViewController / Custom Tabs, never in the WebView that has your bridge or cookies.
- Android: do not export activities that load URLs unless needed; use verified App Links (android:autoVerify="true"). iOS: prefer Universal Links over custom schemes.
Does your app have this?
PTKD checks your build or your source project for PTKD-DEEPLINK-URL-LOAD and every other check in this knowledge base.
Scan your appReferences
Related checks (M4)
- Supabase function runs any SQL the caller sends
- Hybrid WebView may open any website inside the app
- Wildcard associated domain (universal-link hijack surface)
- Process execution via system()/exec/popen
- Unsafe C string function (buffer overflow risk)
- Hijackable custom URL-scheme deep link
- SQL built by joining request data into a string (text search)
- HTML rendered without sanitizing (dangerouslySetInnerHTML / innerHTML)