medium · M4 · MASVS-PLATFORM-2 · PTKD-HYBRID-NAV-WILDCARD

    Hybrid WebView may open any website inside the app

    The Capacitor allowNavigation list or the Cordova config.xml whitelist allows every origin (*). Any link, redirect or injected URL then opens inside the app's WebView instead of the browser, and that page can call the app's native plugins (camera, files, storage).

    How it is exploited

    allowNavigation: ["*"] is set so an OAuth page opens in-app. A chat message carries a link to an attacker's page; it loads inside the app's WebView and calls the Capacitor Camera and Filesystem plugins through the bridge.

    Why it matters

    Third-party pages run with the app's native plugin access, and phishing pages look like part of the app.

    How to fix it

    1. Replace "*" with the exact hosts that must load in-app.
    2. Open every other URL with the Browser plugin / InAppBrowser (system browser).
    3. Cordova: restrict <access> and <allow-navigation>, keep <allow-intent> for external links, add a Content-Security-Policy meta tag.

    Does your app have this?

    PTKD checks your build or your source project for PTKD-HYBRID-NAV-WILDCARD and every other check in this knowledge base.

    Scan your app

    References

    Related checks (M4)