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

    1. Keep source map generation on for crash reporting, but upload the maps from CI (Sentry, Crashlytics, EAS Update) instead of bundling them.
    2. Remove *.map files from android/app/src/main/assets and the iOS bundle resources.
    3. 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 app

    References

    Related checks (M7)