medium · M8 · MASVS-CODE-4 · PTKD-LEFTOVER-DEV-URL

    Development or tunnel URL left in the app

    The app contains a URL that points at a developer machine, a local network address, a temporary tunnel (ngrok, localtunnel, Cloudflare quick tunnels) or a staging/QA server. In production these either fail, send user data to whoever controls that address now, or talk to a backend with test data and weaker protection.

    How it is exploited

    During development the API ran behind https://3f2a-81-2-69-1.ngrok-free.app and that URL was hardcoded. The tunnel closed, a stranger later claims the same subdomain on a paid plan, and every login request from the shipped app now goes to their server.

    Why it matters

    Broken features for every user, or user credentials and data sent to an address you no longer control.

    How to fix it

    1. Search the code for ngrok, loca.lt, trycloudflare, localhost and 10.0.2.2 and replace them with a configured base URL.
    2. Use per-environment config (EAS env, Xcode build configurations, Gradle buildTypes, --dart-define) so release builds can only point at production.
    3. Add a CI check that fails a release build containing these hosts.

    Does your app have this?

    PTKD checks your build or your source project for PTKD-LEFTOVER-DEV-URL and every other check in this knowledge base.

    Scan your app

    References

    Related checks (M8)