medium · M3 · MASVS-AUTH-1 · PTKD-AUTH-CLIENT-SIDE-PAYWALL
Premium access is stored on the phone and trusted (heuristic)
The app writes a premium / pro / subscribed flag to local storage (AsyncStorage, MMKV, SecureStore, SharedPreferences, UserDefaults) and reads it back to unlock paid features. Everything on the phone belongs to the user: a jailbroken or rooted phone, an edited backup or a hooked function sets the flag without paying. When the paid content also comes from your backend, the backend must check the purchase itself.
How it is exploited
After purchase the app runs `AsyncStorage.setItem('isPremium', 'true')` and every screen checks that key. On a jailbroken iPhone (or by editing an unencrypted iTunes backup) the user sets the key themselves and gets every paid feature; a Frida script does the same on Android without root.
Why it matters
Lost revenue, and paid AI features used for free (each call still costs you).
How to fix it
- Read entitlements from RevenueCat, StoreKit 2 or Play Billing at launch, and cache them only in memory.
- Have the backend decide: write the subscription from the purchase webhook and check it in RLS or in the Edge Function.
- Treat any locally stored flag as a display hint only.
Does your app have this?
PTKD checks your build or your source project for PTKD-AUTH-CLIENT-SIDE-PAYWALL and every other check in this knowledge base.
Scan your appReferences
Related checks (M3)
- Permissive CORS with credentials
- State-changing request succeeded without authentication
- Weak JWT observed on the wire
- Biometric authentication not bound to a cryptographic key
- Firebase rules trust an email address nobody verified
- Firebase security rules open to everyone
- Users can make themselves admin or premium in Firestore
- Supabase auth settings in the local config (check the hosted project)