Skip to content

Commit bdf0f58

Browse files
atorralbafelicitymayaschackmull
authored
QLDoc improvements from code review
Co-authored-by: Felicity Chapman <[email protected]> Co-authored-by: Anders Schack-Mulligen <[email protected]>
1 parent 4622d85 commit bdf0f58

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
lgtm,codescanning
2-
* The query "Unsafe resource fetching in Android webview" (`java/android/unsafe-android-webview-fetch`) has been promoted from experimental to the main query pack. Its results will now appear by default. This query was originally [submitted as an experimental query by @luchua-bc](https://github.com/github/codeql/pull/3706).
2+
* The query "Unsafe resource fetching in Android WebView" (`java/android/unsafe-android-webview-fetch`) has been promoted from experimental to the main query pack. Its results will now appear by default. This query was originally [submitted as an experimental query by @luchua-bc](https://github.com/github/codeql/pull/3706).

java/ql/src/Security/CWE/CWE-749/UnsafeAndroidAccess.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* @name Unsafe resource fetching in Android webview
3-
* @description JavaScript rendered inside WebViews can access any protected
4-
* application file and web resource from any origin
2+
* @name Unsafe resource fetching in Android WebView
3+
* @description JavaScript rendered inside WebViews can access protected
4+
* application files and web resources from any origin exposing them to attack.
55
* @kind path-problem
66
* @problem.severity warning
77
* @precision medium
@@ -17,5 +17,5 @@ import DataFlow::PathGraph
1717

1818
from DataFlow::PathNode source, DataFlow::PathNode sink, FetchUntrustedResourceConfiguration conf
1919
where conf.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "Unsafe resource fetching in Android webview due to $@.",
20+
select sink.getNode(), source, sink, "Unsafe resource fetching in Android WebView due to $@.",
2121
source.getNode(), sink.getNode().(UrlResourceSink).getSinkType()

java/ql/src/semmle/code/java/security/UnsafeAndroidAccess.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ private import semmle.code.java.dataflow.ExternalFlow
1414
*/
1515
abstract class UrlResourceSink extends DataFlow::Node {
1616
/**
17-
* Returns a description of this vulnerability,
17+
* Gets a description of this vulnerability.
1818
*/
1919
abstract string getSinkType();
2020
}
2121

2222
/**
23-
* Cross-origin access enabled resource fetch.
23+
* A cross-origin access enabled resource fetch.
2424
*
25-
* It requires JavaScript to be enabled too to be considered a valid sink.
25+
* Only considered a valid sink when JavaScript is also enabled.
2626
*/
2727
private class CrossOriginUrlResourceSink extends JavaScriptEnabledUrlResourceSink {
2828
CrossOriginUrlResourceSink() {
@@ -61,7 +61,7 @@ private class JavaScriptEnabledUrlResourceSink extends UrlResourceSink {
6161
}
6262

6363
/**
64-
* Methods allowing any-local-file and cross-origin access in the WebSettings class
64+
* A method allowing any-local-file and cross-origin access in the WebSettings class.
6565
*/
6666
private class CrossOriginAccessMethod extends Method {
6767
CrossOriginAccessMethod() {
@@ -71,7 +71,7 @@ private class CrossOriginAccessMethod extends Method {
7171
}
7272

7373
/**
74-
* `setJavaScriptEnabled` method for the webview
74+
* The `setJavaScriptEnabled` method for the webview.
7575
*/
7676
private class AllowJavaScriptMethod extends Method {
7777
AllowJavaScriptMethod() {
@@ -81,7 +81,7 @@ private class AllowJavaScriptMethod extends Method {
8181
}
8282

8383
/**
84-
* Holds if a call to `v.setJavaScriptEnabled(true)` exists
84+
* Holds if a call to `v.setJavaScriptEnabled(true)` exists.
8585
*/
8686
private predicate isJSEnabled(Variable v) {
8787
exists(MethodAccess jsa |

java/ql/src/semmle/code/java/security/UnsafeAndroidAccessQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import semmle.code.java.security.RequestForgery
77
import semmle.code.java.security.UnsafeAndroidAccess
88

99
/**
10-
* Taint configuration tracking flow from untrusted inputs to a resource fetching call.
10+
* A taint configuration tracking flow from untrusted inputs to a resource fetching call.
1111
*/
1212
class FetchUntrustedResourceConfiguration extends TaintTracking::Configuration {
1313
FetchUntrustedResourceConfiguration() { this = "FetchUntrustedResourceConfiguration" }

0 commit comments

Comments
 (0)