logo

Database

Android APK JavaScript Enabled Without Clear Cache

Description

Detects Android WebView configurations where JavaScript is enabled together with settings for file or content access.

Weakness:

268 - Insecure service configuration - Webview

Category: Functionality Abuse

Detection Strategy

    • Reads the bytecode of the classes whose name contains Activity, without decompiling it

    • Collects the names that this bytecode uses: the class and its parents, its fields, its methods, and the types, methods, fields and texts that its code refers to. A call with a constant argument counts as a name, such as setJavaScriptEnabled(1)

    • Checks if one of these names mentions setJavaScriptEnabled(true) or setJavaScriptEnabled(1), and one mentions setAllowContentAccess, setAllowFileAccess, setAllowFileAccessFromFileURLs or setAllowUniversalAccessFromFileURLs, whatever value they are given

    • Reports a vulnerability when both are found