high · M8 · MASVS-PLATFORM-3 · PTKD-AC-IAP-BYPASS-CODE

    Hardcoded unlock or promo code

    Paid features unlock with a code compared in the app. Unlocking with your own codes instead of App Store offer codes is an in-app purchase bypass, and anyone who reads the bundle finds the code.

    How it is exploited

    A user decompiles the JS bundle, finds `promoCode === "VIPFREE2026"` and posts it online. Everyone now has Pro for free, and Apple treats unlocking digital content with your own codes as bypassing In-App Purchase.

    Why it matters

    Lost revenue from a leaked code, and rejection or removal under 3.1.1.

    How to fix it

    1. Remove codes compared in the app.
    2. Use App Store offer codes (presentOfferCodeRedeemSheet / Purchases.presentCodeRedemptionSheet) for promotions.
    3. If you need your own codes, validate them on your server and grant through a store-backed entitlement.

    Does your app have this?

    PTKD checks your build or your source project for PTKD-AC-IAP-BYPASS-CODE and every other check in this knowledge base.

    Scan your app

    References

    Related checks (M8)