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
- Search the code for ngrok, loca.lt, trycloudflare, localhost and 10.0.2.2 and replace them with a configured base URL.
- Use per-environment config (EAS env, Xcode build configurations, Gradle buildTypes, --dart-define) so release builds can only point at production.
- 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 appReferences
Related checks (M8)
- JavaScript obfuscation in the build
- Export compliance (ITSAppUsesNonExemptEncryption) not declared
- HealthKit app that also ships an ads SDK
- Hardcoded unlock or promo code
- Purchases SDK configured with an empty or test key
- Purchase screen falls back to made-up prices or 'coming soon' text
- False-urgency copy on a purchase screen
- Hardcoded price on a purchase screen