Skip to content

Commit f815152

Browse files
author
Alvaro Muñoz
authored
Merge pull request #12 from GitHubSecurityLab/rename_query_ids
Rename query IDs
2 parents d2cd3bc + 87e2257 commit f815152

File tree

68 files changed

+197
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+197
-166
lines changed

csharp/src/audit/CWE-078/CommandInjectionAudit.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @problem.severity error
77
* @security-severity 2.0
88
* @precision low
9-
* @id cs/audit/command-line-injection
9+
* @id githubsecuritylab/audit/command-line-injection
1010
* @tags security
1111
* external/cwe/cwe-078
1212
* external/cwe/cwe-088

csharp/src/audit/CWE-094/CodeInjectionAudit.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @problem.severity warning
77
* @security-severity 2.0
88
* @precision low
9-
* @id cs/audit/code-injection
9+
* @id githubsecuritylab/audit/code-injection
1010
* @tags security
1111
* external/cwe/cwe-094
1212
* external/cwe/cwe-095

csharp/src/audit/CWE-502/UnsafeDeserializationAudit.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description Calling an unsafe deserializer with data controlled by an attacker
44
* can lead to denial of service and other security problems.
55
* @kind problem
6-
* @id cs/audit/unsafe-deserialization
6+
* @id githubsecuritylab/audit/unsafe-deserialization
77
* @problem.severity warning
88
* @security-severity 2.0
99
* @precision low
@@ -12,7 +12,6 @@
1212
* audit
1313
*/
1414

15-
// https://github.com/advanced-security/codeql-queries/blob/audit-csharp/codeql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserialization.ql
1615
import csharp
1716
import semmle.code.csharp.security.dataflow.UnsafeDeserializationQuery
1817

csharp/src/audit/CWE-611/UnsafeXMLResolverAudit.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
* @problem.severity warning
77
* @security-severity 2.0
88
* @precision low
9-
* @id cs/audit/insecure-xml-read
9+
* @id githubsecuritylab/audit/insecure-xml-read
1010
* @tags security
1111
* external/cwe/cwe-611
1212
* external/cwe/cwe-827
1313
* external/cwe/cwe-776
1414
* audit
1515
*/
1616

17-
// https://github.com/advanced-security/codeql-queries/blob/c8cfb6a0cc44da3d2baae4b985262a84652f71ee/csharp/ql/src/Security Features/CWE-611/UseXmlSecureResolver.ql#L22s
1817
import csharp
1918
import semmle.code.csharp.security.xml.InsecureXMLQuery
2019

csharp/src/library_sources/ExternalAPIsUsedWithUntrustedData.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description This reports the external APIs that are used with untrusted data, along with how
44
* frequently the API is called, and how many unique sources of untrusted data flow
55
* to it.
6-
* @id cs/count-untrusted-data-external-api
6+
* @id githubsecuritylab/count-untrusted-data-external-api
77
* @kind table
88
* @tags security external/cwe/cwe-20
99
*/

csharp/src/security/CWE-328/WeakHashingAlgorithms.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @security-severity 5.0
77
* @sub-severity medium
88
* @precision medium
9-
* @id cs/weak-cryptographic-hash-algorithms
9+
* @id githubsecuritylab/weak-cryptographic-hash-algorithms
1010
* @tags security
1111
* audit
1212
* external/cwe/cwe-328

csharp/src/security/CWE-328/WeakPasswordHashing.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @problem.severity warning
66
* @security-severity 7.5
77
* @precision high
8-
* @id csharp/weak-password-hashing
8+
* @id githubsecuritylab/weak-password-hashing
99
* @tags security
1010
* external/cwe/cwe-327
1111
* external/cwe/cwe-328

csharp/src/security/CWE-328/WeakSensitiveDataHashing.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @problem.severity warning
66
* @security-severity 7.5
77
* @precision high
8-
* @id csharp/weak-sensitive-data-hashing
8+
* @id githubsecuritylab/weak-sensitive-data-hashing
99
* @tags security
1010
* external/cwe/cwe-327
1111
* external/cwe/cwe-328

csharp/src/security/CWE-760/HardcodedSalt.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @problem.severity error
66
* @security-severity 6.1
77
* @precision medium
8-
* @id cs/hardcoded-salt
8+
* @id githubsecuritylab/hardcoded-salt
99
* @tags security
1010
* external/cwe/cwe-760
1111
*/

csharp/src/security/CWE-798/HardcodedCredentialsSymmetricSecurityKey.ql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@
55
* @problem.severity error
66
* @security-severity 9.8
77
* @precision high
8-
* @id cs/hardcoded-credentials-symmetricsecuritykey
8+
* @id githubsecuritylab/hardcoded-credentials-symmetricsecuritykey
99
* @tags security
1010
* external/cwe/cwe-259
1111
* external/cwe/cwe-321
1212
* external/cwe/cwe-798
1313
*/
1414

1515
import csharp
16-
1716
private import DataFlow::PathGraph
18-
1917
private import github.HardcodedCredentials
2018

21-
2219
from DataFlow::PathNode source, DataFlow::PathNode sink, LiteralToSecurityKeyConfig config
2320
where config.hasFlowPath(source, sink)
2421
select source, sink, source, "Hard-coded credential $@ used as SymmetricSecurityKey $@",

go/src/audit/CWE-078/ArgumentInjection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @problem.severity error
77
* @security-severity 9.8
88
* @precision high
9-
* @id go/injection
9+
* @id githubsecuritylab/audit/argument-injection
1010
* @tags security
1111
* external/cwe/cwe-078
1212
* audit

go/src/audit/CWE-089/SqlInjectionAudit.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
* @security-severity 2.5
66
* @sub-severity low
77
* @precision very-low
8-
* @id go/audit/sql-injection
8+
* @id githubsecuritylab/audit/sql-injection
99
* @tags security
1010
* external/cwe/cwe-089
1111
* audit
1212
*/
13+
1314
import go
1415
import semmle.go.security.SqlInjection
1516
import DataFlow::PathGraph

go/src/audit/explore/Dependencies.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @name External dependencies
33
* @description Count the number of dependencies that a Java project has on external packages.
44
* @kind treemap
5-
* @id githubsecuritylab/external-dependencies
5+
* @id githubsecuritylab/audit/external-dependencies
66
* @metricType externalDependency
77
* @tags audit
88
*/

go/src/audit/explore/Files.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @name Files
33
* @description List of all files in the repository
44
* @kind table
5-
* @id githubsecuritylab/files
5+
* @id githubsecuritylab/audit/files
66
* @tags audit
77
*/
88

go/src/audit/explore/RemoteFlowSources.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @name Attack Surface
33
* @description Application attack surface
44
* @kind table
5-
* @id githubsecuritylab/attack-surface
5+
* @id githubsecuritylab/audit/attack-surface
66
* @tags audit
77
*/
88

go/src/security/CWE-078/CommandInjection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @problem.severity error
77
* @security-severity 9.8
88
* @precision high
9-
* @id go/command-injection
9+
* @id githubsecuritylab/command-injection
1010
* @tags security
1111
* external/cwe/cwe-078
1212
*/

go/src/security/CWE-117/LogInjection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @problem.severity error
77
* @security-severity 7.8
88
* @precision high
9-
* @id go/log-injection
9+
* @id githubsecuritylab/log-injection
1010
* @tags security
1111
* external/cwe/cwe-117
1212
*/

java/src/CVEs/.gitkeep

Whitespace-only changes.

java/src/CVEs/CVE-2021-44228.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @kind path-problem
55
* @problem.severity error
66
* @precision high
7-
* @id seclab/log4shell
7+
* @id githubsecuritylab/log4shell
88
* @tags security
99
*/
1010

java/src/CVEs/CVE-2022-33980.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @kind path-problem
44
* @problem.severity error
55
* @precision high
6-
* @id java/acc-script-injection
6+
* @id githubsecuritylab/acc-script-injection
77
* @tags security
88
* external/cwe/cwe-094
99
*/

java/src/CVEs/CVE-2022-42889.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @kind path-problem
44
* @problem.severity error
55
* @precision high
6-
* @id java/act-script-injection
6+
* @id githubsecuritylab/act-script-injection
77
* @tags security
88
* external/cwe/cwe-094
99
*/

java/src/audit/CWE-079/XSSJSPLenient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cross-Site Scripting (XSS) in JSP (Lenient)
22

3-
This query is similar to [CWE-079/XSSJSP](https://github.com/advanced-security/codeql-queries/blob/main/java/CWE-079/XSSJSP.ql) but it is lenient with the analysis leading potentially to more results (including false positives).
3+
This query is similar to CWE-079/XSSJSP but is lenient with the analysis leading potentially to more results (including false positives).
44

55
## Summary
66

java/src/audit/CWE-079/XSSJSPLenient.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @problem.severity error
66
* @security-severity 6.1
77
* @precision high
8-
* @id java/xss-jsp
8+
* @id githubsecuritylab/xss-jsp
99
* @tags security
1010
* external/cwe/cwe-079
1111
* audit

java/src/library_sources/ExternalAPIsUsedWithUntrustedData.ql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/**
2+
* @name Frequency counts for external APIs that are used with untrusted data
3+
* @description This reports the external APIs that are used with untrusted data, along with how
4+
* frequently the API is called, and how many unique sources of untrusted data flow
5+
* to it.
6+
* @id githubsecuritylab/count-untrusted-data-external-api
7+
* @kind table
8+
* @tags security external/cwe/cwe-20
9+
*/
10+
111
import java
212
import semmle.code.java.dataflow.DataFlow
313
import ExternalAPIs

java/src/security/.gitkeep

Whitespace-only changes.

java/src/security/CWE-078/CommandInjectionRuntimeExec.ql

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,34 @@
55
* @problem.severity error
66
* @security-severity 6.1
77
* @precision high
8-
* @id java/command-line-injection-extra
8+
* @id githubsecuritylab/command-line-injection-extra
99
* @tags security
1010
* external/cwe/cwe-078
1111
*/
1212

13-
1413
import DataFlow::PathGraph
1514
import github.CommandInjectionRuntimeExec
1615

17-
class RemoteSource extends Source { RemoteSource() { this instanceof RemoteFlowSource } }
16+
class RemoteSource extends Source {
17+
RemoteSource() { this instanceof RemoteFlowSource }
18+
}
1819

19-
from DataFlow::PathNode source, DataFlow::PathNode sink, ExecTaintConfiguration2 conf, MethodAccess call, DataFlow::Node sourceCmd, DataFlow::Node sinkCmd, ExecTaintConfiguration confCmd
20-
where call.getMethod() instanceof RuntimeExecMethod
21-
// this is a command-accepting call to exec, e.g. rt.exec(new String[]{"/bin/sh", ...})
22-
and (
23-
confCmd.hasFlow(sourceCmd, sinkCmd)
24-
and sinkCmd.asExpr() = call.getArgument(0)
25-
)
26-
// it is tainted by untrusted user input
27-
and (
28-
conf.hasFlow(source.getNode(), sink.getNode())
29-
and sink.getNode().asExpr() = call.getArgument(0)
30-
)
31-
select sink, source, sink, "Call to dangerous java.lang.Runtime.exec() with command '$@' with arg from untrusted input '$@'",
32-
sourceCmd, sourceCmd.toString(),
33-
source.getNode(), source.toString()
20+
from
21+
DataFlow::PathNode source, DataFlow::PathNode sink, ExecTaintConfiguration2 conf,
22+
MethodAccess call, DataFlow::Node sourceCmd, DataFlow::Node sinkCmd,
23+
ExecTaintConfiguration confCmd
24+
where
25+
call.getMethod() instanceof RuntimeExecMethod and
26+
// this is a command-accepting call to exec, e.g. rt.exec(new String[]{"/bin/sh", ...})
27+
(
28+
confCmd.hasFlow(sourceCmd, sinkCmd) and
29+
sinkCmd.asExpr() = call.getArgument(0)
30+
) and
31+
// it is tainted by untrusted user input
32+
(
33+
conf.hasFlow(source.getNode(), sink.getNode()) and
34+
sink.getNode().asExpr() = call.getArgument(0)
35+
)
36+
select sink, source, sink,
37+
"Call to dangerous java.lang.Runtime.exec() with command '$@' with arg from untrusted input '$@'",
38+
sourceCmd, sourceCmd.toString(), source.getNode(), source.toString()

java/src/security/CWE-078/CommandInjectionRuntimeExecLocal.ql

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,35 @@
55
* @problem.severity error
66
* @security-severity 6.1
77
* @precision high
8-
* @id java/command-line-injection-extra-local
8+
* @id githubsecuritylab/command-line-injection-extra-local
99
* @tags security
1010
* local
1111
* external/cwe/cwe-078
1212
*/
1313

14-
1514
import DataFlow::PathGraph
1615
import github.CommandInjectionRuntimeExec
1716

18-
class LocalSource extends Source { LocalSource() { this instanceof LocalUserInput } }
17+
class LocalSource extends Source {
18+
LocalSource() { this instanceof LocalUserInput }
19+
}
1920

20-
from DataFlow::PathNode source, DataFlow::PathNode sink, ExecTaintConfiguration2 conf, MethodAccess call, DataFlow::Node sourceCmd, DataFlow::Node sinkCmd, ExecTaintConfiguration confCmd
21-
where call.getMethod() instanceof RuntimeExecMethod
22-
// this is a command-accepting call to exec, e.g. rt.exec(new String[]{"/bin/sh", ...})
23-
and (
24-
confCmd.hasFlow(sourceCmd, sinkCmd)
25-
and sinkCmd.asExpr() = call.getArgument(0)
26-
)
27-
// it is tainted by untrusted user input
28-
and (
29-
conf.hasFlow(source.getNode(), sink.getNode())
30-
and sink.getNode().asExpr() = call.getArgument(0)
31-
)
32-
select sink, source, sink, "Call to dangerous java.lang.Runtime.exec() with command '$@' with arg from untrusted input '$@'",
33-
sourceCmd, sourceCmd.toString(),
34-
source.getNode(), source.toString()
21+
from
22+
DataFlow::PathNode source, DataFlow::PathNode sink, ExecTaintConfiguration2 conf,
23+
MethodAccess call, DataFlow::Node sourceCmd, DataFlow::Node sinkCmd,
24+
ExecTaintConfiguration confCmd
25+
where
26+
call.getMethod() instanceof RuntimeExecMethod and
27+
// this is a command-accepting call to exec, e.g. rt.exec(new String[]{"/bin/sh", ...})
28+
(
29+
confCmd.hasFlow(sourceCmd, sinkCmd) and
30+
sinkCmd.asExpr() = call.getArgument(0)
31+
) and
32+
// it is tainted by untrusted user input
33+
(
34+
conf.hasFlow(source.getNode(), sink.getNode()) and
35+
sink.getNode().asExpr() = call.getArgument(0)
36+
)
37+
select sink, source, sink,
38+
"Call to dangerous java.lang.Runtime.exec() with command '$@' with arg from untrusted input '$@'",
39+
sourceCmd, sourceCmd.toString(), source.getNode(), source.toString()

0 commit comments

Comments
 (0)