critical · M7 · MASVS-CODE-4 · PTKD-DS-CRYPTO-MINING

    On-device cryptocurrency mining code

    The app contains a known crypto-mining library or a mining-pool address. Mining on the device is not allowed on the App Store (3.1.5(ii)) or Google Play (device abuse), and is often a sign of a compromised dependency.

    How it is exploited

    A compromised npm package injects a CoinHive-style miner into the JS bundle. While the app is open, users' phones heat up, drain the battery and send hashes to a mining pool the attacker controls.

    Why it matters

    Removal from both stores (Apple 2.4.2 and 3.1.5, Google Play device and network abuse), damaged devices and reviews, and a supply-chain compromise that may also have read secrets.

    How to fix it

    1. Find what brought the miner in: search the bundle and lockfile diff for the library or pool address named in the finding.
    2. Remove or pin a clean version of that package, delete node_modules and the lockfile entry, reinstall and rebuild.
    3. Rotate every key the build or the package could read (API keys, signing credentials, CI tokens).
    4. Add lockfile review and a dependency audit to CI so the next change is caught before release.

    Does your app have this?

    PTKD checks your build or your source project for PTKD-DS-CRYPTO-MINING and every other check in this knowledge base.

    Scan your app

    References

    Related checks (M7)