high · M1 · MASVS-CRYPTO-1 · PTKD-DYN-SECRET-TRANSIT
Hardcoded secret sent on the wire
A request carried what looks like a long-lived credential (in a header, URL, or body).
How it is exploited
A credential that also sits hardcoded in the binary was observed leaving the device on the wire. It is now extractable two ways: strings on the APK, or one captured request.
Why it matters
The secret must be treated as fully public; abuse happens from infrastructure you do not control.
How to fix it
- Rotate the secret immediately.
- Move the authenticated call server-side; issue short-lived, user-scoped tokens to the client instead.
Does your app have this?
PTKD checks your build or your source project for PTKD-DYN-SECRET-TRANSIT and every other check in this knowledge base.
Scan your appReferences
Related checks (M1)
- Secret returned in an API response
- App code calls Supabase admin APIs, so the service-role key ships in the app
- Hardcoded secret in the app
- Credential passed in a URL
- Secret written in eas.json
- A .env file ships inside the app
- Secret .env file is not ignored by git
- Secret in the Expo app config `extra`, which ships inside the app