Skip to content

Commit

Permalink
Merge pull request #28 from egregius313/egregisu313/webview-setAllowC…
Browse files Browse the repository at this point in the history
…ontentAccess-single-query

Merge `setAllowContentAccess` queries into singular query
  • Loading branch information
egregius313 authored Jan 3, 2023
2 parents 35de551 + 81df89f commit 69fd5e9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 32 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,19 @@ class WebViewDisallowContentAccessConfiguration extends TaintTracking::Configura
}
}

from WebViewSource source
where not any(WebViewDisallowContentAccessConfiguration cfg).hasFlow(source, _)
select source,
from Expr e
where
// explicit: setAllowContentAccess(true)
exists(MethodAccess ma |
ma = e and
ma.getMethod() instanceof AllowContentAccessMethod and
ma.getArgument(0).(CompileTimeConstantExpr).getBooleanValue() = true
)
or
// implicit: no setAllowContentAccess(false)
exists(WebViewSource source |
source.asExpr() = e and
not any(WebViewDisallowContentAccessConfiguration cfg).hasFlow(source, _)
)
select e,
"Sensitive information may be exposed via a malicious link due to access of content:// links being permitted."
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
category: newQuery
---
* Added a new query `java/android/websettings-content-access` to detect Android WebViews which do not disable access to `content://` urls.
* Added a new query `java/android/websettings-permit-contentacces` to detect Android WebViews which do not disable access to `content://` urls.
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
| WebViewContentAccess.java:15:9:15:57 | setAllowContentAccess(...) | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |
| WebViewContentAccess.java:38:9:38:55 | setAllowContentAccess(...) | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |
| WebViewContentAccess.java:41:25:41:49 | (...)... | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |
| WebViewContentAccess.java:43:9:43:44 | setAllowContentAccess(...) | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |
| WebViewContentAccess.java:46:25:46:41 | new WebView(...) | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |
| WebViewContentAccess.java:48:9:48:44 | setAllowContentAccess(...) | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |
| WebViewContentAccess.java:51:25:51:44 | getAWebView(...) | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |
| WebViewContentAccess.java:53:9:53:44 | setAllowContentAccess(...) | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |
| WebViewContentAccess.java:55:29:55:48 | getAWebView(...) | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |
| WebViewContentAccess.java:57:25:57:44 | getAWebView(...) | Sensitive information may be exposed via a malicious link due to access of content:// links being permitted. |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Security/CWE/CWE-200/AndroidWebViewSettingsContentAccess.ql
Security/CWE/CWE-200/AndroidWebViewSettingsPermitsContentAccess.ql

This file was deleted.

This file was deleted.

0 comments on commit 69fd5e9

Please sign in to comment.