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

    1. Read entitlements from RevenueCat, StoreKit 2 or Play Billing at launch, and cache them only in memory.
    2. Have the backend decide: write the subscription from the purchase webhook and check it in RLS or in the Edge Function.
    3. 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 app

    References

    Related checks (M3)