Development tools and frameworks usually have options to make debugging easier for developers. Although these features are useful during development, they should never be enabled for applications deployed in production. Debug instructions or error messages can leak detailed information about the system, like the application’s path or file names.

Ask Yourself Whether

There is a risk if you answered yes to any of those questions.

Recommended Secure Coding Practices

Do not enable debugging features on applications distributed to end users.

Sensitive Code Example

WebView.setWebContentsDebuggingEnabled(true) for Android enables debugging support:

import android.webkit.WebView

WebView.setWebContentsDebuggingEnabled(true) // Sensitive

Compliant Solution

WebView.setWebContentsDebuggingEnabled(false) for Android disables debugging support:

import android.webkit.WebView

WebView.setWebContentsDebuggingEnabled(false)

See