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
- Find what brought the miner in: search the bundle and lockfile diff for the library or pool address named in the finding.
- Remove or pin a clean version of that package, delete node_modules and the lockfile entry, reinstall and rebuild.
- Rotate every key the build or the package could read (API keys, signing credentials, CI tokens).
- 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 appReferences
Related checks (M7)
- Executable built without stack canaries
- iOS binary is not encrypted (cryptid = 0)
- Executable is not position-independent (no PIE/ASLR)
- iOS build is debuggable (get-task-allow = true)
- Debuggable release (get-task-allow in code signature)
- Source maps shipped inside the app
- Large DEX code without R8 shrinking and obfuscation
- Framework that downloads and runs code after review