File tree Expand file tree Collapse file tree 5 files changed +13
-14
lines changed
test/query-tests/security/CWE-489 Expand file tree Collapse file tree 5 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 1
- // TODO: Fix up metadata
2
1
/**
3
- * @name Debuggable set to true
4
- * @description The 'debuggable' attribute in the application section of the AndroidManifest.xml file should never be enabled in production builds // TODO: edit to be in-line wth guidelines
2
+ * @name Debuggable attribute enabled
3
+ * @description An enabled debugger can allow for entry points in the application or reveal sensitive information.
5
4
* @kind problem
6
5
* @problem.severity warning
7
- * @id java/android/debuggable-true // TODO: consider editing
8
- * @tags security // TODO: look into CWEs some more
6
+ * @id java/android/debuggable-attribute-enabled
7
+ * @tags security
9
8
* external/cwe/cwe-489
10
- * external/cwe/cwe-710
11
- * @precision high // TODO: adjust once review query results and FP ratio
12
- * @security-severity 0.1 // TODO: auto-calculated: https://github.blog/changelog/2021-07-19-codeql-code-scanning-new-severity-levels-for-security-alerts/
9
+ * @precision very-high
10
+ * @security-severity 0.1
13
11
*/
14
12
15
13
import java
@@ -18,5 +16,6 @@ import semmle.code.xml.AndroidManifest
18
16
from AndroidXmlAttribute androidXmlAttr
19
17
where
20
18
androidXmlAttr .getName ( ) = "debuggable" and
21
- androidXmlAttr .getValue ( ) = "true"
22
- select androidXmlAttr , "Warning: 'android:debuggable=true' set"
19
+ androidXmlAttr .getValue ( ) = "true" and
20
+ not androidXmlAttr .getLocation ( ) .toString ( ) .matches ( "%/build/%" )
21
+ select androidXmlAttr , "The 'debuggable' attribute is enabled."
Original file line number Diff line number Diff line change 1
- | TestTrue.xml:7:5:17:30 | debuggable=true | Warning: 'android: debuggable=true' set |
1
+ | TestTrue.xml:7:5:17:30 | debuggable=true | Warning: debuggable attribute enabled |
Original file line number Diff line number Diff line change 24
24
<category android : name =" android.intent.category.LAUNCHER" />
25
25
</intent-filter >
26
26
</activity >
27
- </application > <!-- test -->
27
+ </application >
28
28
29
29
</manifest >
Original file line number Diff line number Diff line change 23
23
<category android : name =" android.intent.category.LAUNCHER" />
24
24
</intent-filter >
25
25
</activity >
26
- </application > <!-- test -->
26
+ </application >
27
27
28
28
</manifest >
Original file line number Diff line number Diff line change 24
24
<category android : name =" android.intent.category.LAUNCHER" />
25
25
</intent-filter >
26
26
</activity >
27
- </application > <!-- test -->
27
+ </application >
28
28
29
29
</manifest >
You can’t perform that action at this time.
0 commit comments