Skip to content

Commit 7e5970f

Browse files
Java: Fix typos/formatting in setJavascriptEnabled query
Typos and formatting changes. Co-authored-by: Tony Torralba <[email protected]>
1 parent b4cd1ee commit 7e5970f

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

java/ql/src/Security/CWE/CWE-079/AndroidWebViewSettingsEnabledJavaScript.qhelp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ man-in-the-middle attack, where the attacker can inject arbitrary JavaScript.
1111

1212
<p>
1313
You can enable or disbale Javascript execution using
14-
the <code>setJavaScriptEnabled</code> method of the settings of a webview.
14+
the <code>setJavaScriptEnabled</code> method of the settings of a WebView.
1515
</p>
1616
</overview>
1717

1818
<recommendation>
19-
<p>If Javascript does not need to be enabled, call <code>setJavaScriptEnabled(false)</code> on the settings of the webview.</p>
19+
<p>If Javascript does not need to be enabled, call <code>setJavaScriptEnabled(false)</code> on the settings of the WebView.</p>
2020

21-
<p>If JavaScript is necessary, only load content from trusted servers using encrypted channels, such as https with certificate verification.</p>
21+
<p>If JavaScript is necessary, only load content from trusted servers using encrypted channels, such as HTTPS with certificate verification.</p>
2222
</recommendation>
2323

2424
<example>
25-
<p>In the following (bad) example, a webview has JavaScript enabled in its settings.</p>
25+
<p>In the following (bad) example, a WebView has JavaScript enabled in its settings.</p>
2626

2727
<sample src="WebSettingsEnableJavascript.java"/>
2828

29-
<p>In the following (good) example, a webview explicitly disallows JavaScript execution.</p>
29+
<p>In the following (good) example, a WebView explicitly disallows JavaScript execution.</p>
3030

3131
<sample src="WebSettingsDisableJavascript.java"/>
3232

java/ql/src/Security/CWE/CWE-079/AndroidWebViewSettingsEnabledJavaScript.ql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import semmle.code.java.frameworks.android.WebView
1515

1616
from MethodAccess ma
1717
where
18-
(
19-
ma.getMethod() instanceof AllowJavaScriptMethod and
20-
ma.getArgument(0).(CompileTimeConstantExpr).getBooleanValue() = true
21-
)
18+
ma.getMethod() instanceof AllowJavaScriptMethod and
19+
ma.getArgument(0).(CompileTimeConstantExpr).getBooleanValue() = true
2220
select ma, "JavaScript execution enabled in WebView."

0 commit comments

Comments
 (0)