medium · M7 · MASVS-RESILIENCE-3 · PTKD-LEFTOVER-SOURCEMAP
Source maps shipped inside the app
The build contains JavaScript source maps. Anyone who downloads the app can rebuild your original source code from them, with file names, comments and logic intact, including how your API is called and what it trusts.
How it is exploited
An attacker unzips your APK or IPA, finds index.android.bundle.map (or main.jsbundle.map) and opens it in any source map viewer. They now read your original TypeScript: every API route, every feature flag, the admin screens you hid behind a role check in the client, and any key you thought was safe because it was minified.
Why it matters
Your business logic and client-side security checks become a readable blueprint for abuse; secrets that were only obscured by minification are exposed.
How to fix it
- Keep source map generation on for crash reporting, but upload the maps from CI (Sentry, Crashlytics, EAS Update) instead of bundling them.
- Remove *.map files from android/app/src/main/assets and the iOS bundle resources.
- Rescan the release build to confirm no .map file ships.
Does your app have this?
PTKD checks your build or your source project for PTKD-LEFTOVER-SOURCEMAP 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)
- On-device cryptocurrency mining code
- iOS build is debuggable (get-task-allow = true)
- Debuggable release (get-task-allow in code signature)
- Large DEX code without R8 shrinking and obfuscation
- Framework that downloads and runs code after review