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

    1. Parse the URL and compare scheme and host against an allowlist of your own domains before loading or opening it; reject everything else.
    2. Open third-party links in the system browser or SFSafariViewController / Custom Tabs, never in the WebView that has your bridge or cookies.
    3. 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 app

    References

    Related checks (M4)