medium · M8 · MASVS-PLATFORM-3 · PTKD-GL-HARDCODED-IPV4
Hardcoded IPv4 address (text search)
Apps must support IPv6. Hardcoded IPv4 addresses will fail on IPv6-only networks.
How it is exploited
Not an attack: the app calls http://203.0.113.10/api directly. App Review tests on an IPv6-only network (NAT64); a literal IPv4 address cannot be reached there, so the reviewer sees a spinner or 'no connection'.
Why it matters
A rejection under 2.1 / 2.5 for a crash or broken feature, and the same failure for real users on IPv6-only carrier networks.
How to fix it
- Replace IP literals with a hostname that has both A and AAAA records (or that resolves through NAT64).
- Use the platform's high-level networking (URLSession, fetch, OkHttp); do not resolve and connect to IPv4 addresses yourself.
- Test on an IPv6-only network: macOS Internet Sharing has a 'Create NAT64 Network' option.
Does your app have this?
PTKD checks your build or your source project for PTKD-GL-HARDCODED-IPV4 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