Skip to content

Commit a6a500a

Browse files
Apply suggestions from code review - doc improvements, simplification
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
1 parent 6014a75 commit a6a500a

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

java/ql/lib/semmle/code/java/security/WebviewDubuggingEnabledQuery.qll

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ import semmle.code.java.security.SecurityTests
88
/** Holds if `ex` looks like a check that this is a debug build. */
99
private predicate isDebugCheck(Expr ex) {
1010
exists(Expr subex, string debug |
11-
(
12-
debug.toLowerCase().matches("%debug%")
13-
or
14-
debug.toLowerCase().matches("%test%")
15-
) and
11+
debug.toLowerCase().matches(["%debug%", "%test%"]) and
1612
subex.getParent*() = ex
1713
|
1814
subex.(VarAccess).getVariable().getName() = debug

java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.qhelp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
<overview>
77
<p>The <code>WebView.setWebContentsDebuggingEnabled</code> method enables or disables the contents of any <code>WebView</code> in the application to be debugged.</p>
88

9-
<p>Enabling debugging featues could allow for additional entry points or leaking sensitive information.
10-
As such, debugging should only be anabled during development, and disabled during production builds.</p>
9+
<p>Enabling debugging features could allow for additional entry points or leaking sensitive information.
10+
As such, debugging should only be enabled during development, and disabled in production builds.</p>
1111
</overview>
1212
<recommendation>
13-
<p>Ensure that debugging features are not enabled during production builds.
13+
<p>Ensure that debugging features are not enabled in production builds.
1414
If <code>WebView.setWebContentsDebuggingEnabled(true)</code> is used, ensure that it is guarded by a flag indicating that this is a debug build.</p>
1515

1616
</recommendation>
1717
<example>
1818

19-
<p>In the code below, the BAD case shows debugging always being enabled,
20-
whereas the GOOD case only enables debugging if the <code>android:debuggable</code> attribute is set to <code>true</code>.</p>
19+
<p>In the code below, the BAD case shows WebView debugging always being enabled,
20+
whereas the GOOD case only enables it if the <code>android:debuggable</code> attribute is set to <code>true</code>.</p>
2121

2222
<sample src="WebviewDebuggingEnabled.java" />
2323

0 commit comments

Comments
 (0)