low · M8 · MASVS-RESILIENCE-4 · PTKD-WEBVIEW-DEBUG

    WebView remote debugging enabled

    setWebContentsDebuggingEnabled is referenced; if enabled in production it exposes WebView contents to anyone with adb/devtools access.

    How it is exploited

    setWebContentsDebuggingEnabled(true) in production lets anyone with ADB attach Chrome DevTools to your WebViews: read the DOM, cookies, localStorage, and inject script into live sessions.

    Why it matters

    Session material and in-page data are one USB cable away on any device.

    How to fix it

    1. Gate it on BuildConfig.DEBUG so release builds never enable WebView debugging.

    Debug builds only

    if (BuildConfig.DEBUG) WebView.setWebContentsDebuggingEnabled(true)

    Does your app have this?

    PTKD checks your build or your source project for PTKD-WEBVIEW-DEBUG and every other check in this knowledge base.

    Scan your app

    References

    Related checks (M8)