mirror of
https://github.com/github/codeql.git
synced 2025-12-23 20:26:32 +01:00
adding starter files
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE qhelp PUBLIC
|
||||
"-//Semmle//qhelp//EN"
|
||||
"qhelp.dtd">
|
||||
<qhelp>
|
||||
|
||||
<overview>
|
||||
<p>TODO: Replace the following
|
||||
When a debugger is enabled it could allow for entry points in the application or reveal sensitive information.</p>
|
||||
|
||||
</overview>
|
||||
<recommendation>
|
||||
|
||||
<p>TODO: Replace the following
|
||||
In Android applications either set the <code>android:debuggable</code> attribute to <code>false</code>
|
||||
or do not include it in the manifest. The default value when not included is <code>false</code>.</p>
|
||||
|
||||
</recommendation>
|
||||
<example>
|
||||
|
||||
<p>TODO: Replace the following
|
||||
In the example below, the <code>android:debuggable</code> attribute is set to <code>true</code>.</p>
|
||||
|
||||
<!--<sample src="DebuggableTrue.xml" />-->
|
||||
|
||||
<p>The corrected version sets the <code>android:debuggable</code> attribute to <code>false</code>.</p>
|
||||
|
||||
<!--<sample src="DebuggableFalse.xml" />-->
|
||||
|
||||
</example>
|
||||
<references>
|
||||
|
||||
<li>
|
||||
TODO: REPLACE LINKS. Android Developers:
|
||||
<a href="https://developer.android.com/guide/topics/manifest/application-element#debug">The android:debuggable attribute</a>.
|
||||
</li>
|
||||
|
||||
</references>
|
||||
</qhelp>
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @name Implicitly imported Android component
|
||||
* @description TODO after more background reading
|
||||
* @kind problem (TODO: confirm after more background reading)
|
||||
* @problem.severity warning (TODO: confirm after more background reading)
|
||||
* @security-severity 0.1 (TODO: run script)
|
||||
* @id java/android/implicitly-imported-component
|
||||
* @tags security
|
||||
* external/cwe/cwe-926
|
||||
* @precision TODO after MRVA
|
||||
*/
|
||||
|
||||
import java
|
||||
import semmle.code.xml.AndroidManifest
|
||||
|
||||
// TODO: change query
|
||||
from AndroidXmlAttribute androidXmlAttr
|
||||
where
|
||||
androidXmlAttr.getName() = "debuggable" and
|
||||
androidXmlAttr.getValue() = "true" and
|
||||
not androidXmlAttr.getLocation().getFile().getRelativePath().matches("%build%")
|
||||
select androidXmlAttr, "The 'android:debuggable' attribute is enabled."
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: newQuery
|
||||
---
|
||||
* Added a new query, `java/android/implicitly-imported-component`, to detect if an Android component can become implicitly exported.
|
||||
@@ -0,0 +1,23 @@
|
||||
import java
|
||||
import semmle.code.xml.AndroidManifest
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
// TODO: update for implicit export query
|
||||
class DebuggableAttributeTrueTest extends InlineExpectationsTest {
|
||||
DebuggableAttributeTrueTest() { this = "DebuggableAttributeEnabledTest" }
|
||||
|
||||
override string getARelevantTag() { result = "hasDebuggableAttributeEnabled" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "hasDebuggableAttributeEnabled" and
|
||||
exists(AndroidXmlAttribute androidXmlAttr |
|
||||
androidXmlAttr.getName() = "debuggable" and
|
||||
androidXmlAttr.getValue() = "true" and
|
||||
not androidXmlAttr.getLocation().getFile().getRelativePath().matches("%build%")
|
||||
|
|
||||
androidXmlAttr.getLocation() = location and
|
||||
element = androidXmlAttr.toString() and
|
||||
value = ""
|
||||
)
|
||||
}
|
||||
}
|
||||
3
java/ql/test/query-tests/security/CWE-926/Test.java
Normal file
3
java/ql/test/query-tests/security/CWE-926/Test.java
Normal file
@@ -0,0 +1,3 @@
|
||||
public class Test {
|
||||
|
||||
}
|
||||
1
java/ql/test/query-tests/security/CWE-926/options
Normal file
1
java/ql/test/query-tests/security/CWE-926/options
Normal file
@@ -0,0 +1 @@
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/google-android-9.0.0
|
||||
Reference in New Issue
Block a user