Skip to content

Commit f34e23b

Browse files
Jami CogswellJami Cogswell
authored andcommitted
adjusted comments and precision level
1 parent ac07544 commit f34e23b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22

33
private import semmle.code.xml.AndroidManifest
44

5-
/** An implicitly exported Android component */
5+
/**
6+
* An Android component without an `exported` attribute explicitly set
7+
* that also has an `intent-filter` element.
8+
*/
69
class ImplicitlyExportedAndroidComponent extends AndroidComponentXmlElement {
710
ImplicitlyExportedAndroidComponent() {
811
this.hasAnIntentFilterElement() and
912
not this.hasExportedAttribute() and
13+
// Components with category LAUNCHER or with action MAIN need to be exported since
14+
// they are entry-points to the application. As a result, we do not consider these
15+
// components to be implicitly exported since the developer intends them to be exported anyways.
1016
not this.getAnIntentFilterElement().getACategoryElement().getCategoryName() =
1117
"android.intent.category.LAUNCHER" and
1218
not this.getAnIntentFilterElement().getAnActionElement().getActionName() =
1319
"android.intent.action.MAIN" and
20+
// The `permission` attribute can be used to limit components' exposure to other applications.
21+
// As a result, we do not consider components with an explicitly set `permission` attribute to be
22+
// implicitly exported since the developer has already limited access to such components.
1423
not this.requiresPermissions() and
1524
not this.getParent().(AndroidApplicationXmlElement).requiresPermissions() and
1625
not this.getFile().(AndroidManifestXmlFile).isInBuildDirectory()

java/ql/src/Security/CWE/CWE-926/ImplicitlyExportedAndroidComponent.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @id java/android/implicitly-exported-component
88
* @tags security
99
* external/cwe/cwe-926
10-
* @precision medium
10+
* @precision high
1111
*/
1212

1313
import java

0 commit comments

Comments
 (0)