low · M5 · MASVS-NETWORK-1 · PTKD-API-NO-HSTS
First-party HTTPS API without HSTS
A first-party HTTPS endpoint responded without a Strict-Transport-Security header, so a first request (or one after cache expiry) can be downgraded to HTTP by a network attacker.
How it is exploited
The app's HTTPS backend answers without Strict-Transport-Security. On a hostile network an attacker intercepts the very first (or a post-expiry) request, which the client may still attempt over HTTP, and downgrades it to plaintext before any redirect to HTTPS takes effect.
Why it matters
A window for SSL-stripping on each fresh connection, exposing the initial request and any credential it carries.
How to fix it
- Send Strict-Transport-Security with a long max-age (for example 63072000) and includeSubDomains on every HTTPS response.
- Preload the domain in the HSTS preload list once you are confident all subdomains are HTTPS-only.
Does your app have this?
PTKD checks your build or your source project for PTKD-API-NO-HSTS and every other check in this knowledge base.
Scan your appReferences
Related checks (M5)
- Cleartext HTTP traffic at runtime
- Session cookie without Secure/HttpOnly
- TLS interception succeeded (no certificate pinning)
- Weak TLS version negotiated at runtime
- Capacitor WebView allows cleartext or mixed content
- App Transport Security disabled (NSAllowsArbitraryLoads)
- App Transport Security insecure exception domains
- App Transport Security disabled for media