Skip to content

Commit 7b629f5

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Shared: include 'qltest%' and 'test-%'
1 parent 76508d1 commit 7b629f5

File tree

11 files changed

+56
-33
lines changed

11 files changed

+56
-33
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/SharedModelValidation.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ValidSinkKind extends string {
2929
or
3030
this.matches([
3131
// shared
32-
"encryption-%",
32+
"encryption-%", "qltest%", "test-%",
3333
// Java-only currently, but may be shared in the future
3434
"regex-use%",
3535
// JavaScript-only currently, but may be shared in the future
@@ -53,11 +53,15 @@ class ValidSourceKind extends string {
5353
// C#
5454
"file", "file-write",
5555
// JavaScript
56-
"database-access-result"
56+
"database-access-result", "remote-flow"
5757
]
5858
or
59-
// Swift
60-
this.matches("%string-%length")
59+
this.matches([
60+
// shared
61+
"qltest%", "test-%",
62+
// Swift
63+
"%string-%length"
64+
])
6165
}
6266
}
6367

go/ql/lib/semmle/go/dataflow/SharedModelValidation.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ValidSinkKind extends string {
2929
or
3030
this.matches([
3131
// shared
32-
"encryption-%",
32+
"encryption-%", "qltest%", "test-%",
3333
// Java-only currently, but may be shared in the future
3434
"regex-use%",
3535
// JavaScript-only currently, but may be shared in the future
@@ -53,11 +53,15 @@ class ValidSourceKind extends string {
5353
// C#
5454
"file", "file-write",
5555
// JavaScript
56-
"database-access-result"
56+
"database-access-result", "remote-flow"
5757
]
5858
or
59-
// Swift
60-
this.matches("%string-%length")
59+
this.matches([
60+
// shared
61+
"qltest%", "test-%",
62+
// Swift
63+
"%string-%length"
64+
])
6165
}
6266
}
6367

java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ module ModelValidation {
318318
or
319319
exists(string kind, string msg | sinkModel(_, _, _, _, _, _, _, kind, _) |
320320
not kind instanceof ValidSinkKind and
321-
not kind.matches("qltest%") and
322321
msg = "Invalid kind \"" + kind + "\" in sink model." and
323322
// The part of this message that refers to outdated sink kinds can be deleted after June 1st, 2024.
324323
if kind instanceof OutdatedSinkKind
@@ -328,7 +327,6 @@ module ModelValidation {
328327
or
329328
exists(string kind | sourceModel(_, _, _, _, _, _, _, kind, _) |
330329
not kind instanceof ValidSourceKind and
331-
not kind.matches("qltest%") and
332330
result = "Invalid kind \"" + kind + "\" in source model."
333331
)
334332
or

java/ql/lib/semmle/code/java/dataflow/SharedModelValidation.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ValidSinkKind extends string {
2929
or
3030
this.matches([
3131
// shared
32-
"encryption-%",
32+
"encryption-%", "qltest%", "test-%",
3333
// Java-only currently, but may be shared in the future
3434
"regex-use%",
3535
// JavaScript-only currently, but may be shared in the future
@@ -53,11 +53,15 @@ class ValidSourceKind extends string {
5353
// C#
5454
"file", "file-write",
5555
// JavaScript
56-
"database-access-result"
56+
"database-access-result", "remote-flow"
5757
]
5858
or
59-
// Swift
60-
this.matches("%string-%length")
59+
this.matches([
60+
// shared
61+
"qltest%", "test-%",
62+
// Swift
63+
"%string-%length"
64+
])
6165
}
6266
}
6367

javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModels.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,6 @@ module ModelOutput {
663663
or
664664
exists(string kind | sinkModel(_, _, kind) |
665665
not kind instanceof ValidSinkKind and
666-
not kind.matches("test-%") and
667666
result = "Invalid kind \"" + kind + "\" in sink model."
668667
)
669668
or

javascript/ql/lib/semmle/javascript/frameworks/data/internal/SharedModelValidation.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ValidSinkKind extends string {
2929
or
3030
this.matches([
3131
// shared
32-
"encryption-%",
32+
"encryption-%", "qltest%", "test-%",
3333
// Java-only currently, but may be shared in the future
3434
"regex-use%",
3535
// JavaScript-only currently, but may be shared in the future
@@ -53,11 +53,15 @@ class ValidSourceKind extends string {
5353
// C#
5454
"file", "file-write",
5555
// JavaScript
56-
"database-access-result"
56+
"database-access-result", "remote-flow"
5757
]
5858
or
59-
// Swift
60-
this.matches("%string-%length")
59+
this.matches([
60+
// shared
61+
"qltest%", "test-%",
62+
// Swift
63+
"%string-%length"
64+
])
6165
}
6266
}
6367

python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModels.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,6 @@ module ModelOutput {
663663
or
664664
exists(string kind | sinkModel(_, _, kind) |
665665
not kind instanceof ValidSinkKind and
666-
not kind.matches("test-%") and
667666
result = "Invalid kind \"" + kind + "\" in sink model."
668667
)
669668
or

python/ql/lib/semmle/python/frameworks/data/internal/SharedModelValidation.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ValidSinkKind extends string {
2929
or
3030
this.matches([
3131
// shared
32-
"encryption-%",
32+
"encryption-%", "qltest%", "test-%",
3333
// Java-only currently, but may be shared in the future
3434
"regex-use%",
3535
// JavaScript-only currently, but may be shared in the future
@@ -53,11 +53,15 @@ class ValidSourceKind extends string {
5353
// C#
5454
"file", "file-write",
5555
// JavaScript
56-
"database-access-result"
56+
"database-access-result", "remote-flow"
5757
]
5858
or
59-
// Swift
60-
this.matches("%string-%length")
59+
this.matches([
60+
// shared
61+
"qltest%", "test-%",
62+
// Swift
63+
"%string-%length"
64+
])
6165
}
6266
}
6367

ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModels.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,6 @@ module ModelOutput {
663663
or
664664
exists(string kind | sinkModel(_, _, kind) |
665665
not kind instanceof ValidSinkKind and
666-
not kind.matches("test-%") and
667666
result = "Invalid kind \"" + kind + "\" in sink model."
668667
)
669668
or

ruby/ql/lib/codeql/ruby/frameworks/data/internal/SharedModelValidation.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ValidSinkKind extends string {
2929
or
3030
this.matches([
3131
// shared
32-
"encryption-%",
32+
"encryption-%", "qltest%", "test-%",
3333
// Java-only currently, but may be shared in the future
3434
"regex-use%",
3535
// JavaScript-only currently, but may be shared in the future
@@ -53,11 +53,15 @@ class ValidSourceKind extends string {
5353
// C#
5454
"file", "file-write",
5555
// JavaScript
56-
"database-access-result"
56+
"database-access-result", "remote-flow"
5757
]
5858
or
59-
// Swift
60-
this.matches("%string-%length")
59+
this.matches([
60+
// shared
61+
"qltest%", "test-%",
62+
// Swift
63+
"%string-%length"
64+
])
6165
}
6266
}
6367

0 commit comments

Comments
 (0)