File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
lib/codeql/rust/security/regex
src/queries/security/CWE-020 Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ private import codeql.rust.Concepts
15
15
* injection vulnerabilities, as well as extension points for adding your own.
16
16
*/
17
17
module RegexInjection {
18
+ /**
19
+ * A data flow source for regular expression injection vulnerabilities.
20
+ */
21
+ abstract class Source extends DataFlow:: Node { }
22
+
18
23
/**
19
24
* A data flow sink for regular expression injection vulnerabilities.
20
25
*/
@@ -27,6 +32,11 @@ module RegexInjection {
27
32
*/
28
33
abstract class Barrier extends DataFlow:: Node { }
29
34
35
+ /**
36
+ * An active threat-model source, considered as a flow source.
37
+ */
38
+ private class ActiveThreatModelSourceAsSource extends Source , ActiveThreatModelSource { }
39
+
30
40
/**
31
41
* A sink for `a` in `Regex::new(a)` when `a` is not a literal.
32
42
*/
Original file line number Diff line number Diff line change 17
17
private import rust
18
18
private import codeql.rust.dataflow.DataFlow
19
19
private import codeql.rust.dataflow.TaintTracking
20
- private import codeql.rust.Concepts
21
20
private import codeql.rust.security.regex.RegexInjectionExtensions
22
21
23
22
/**
@@ -26,7 +25,7 @@ private import codeql.rust.security.regex.RegexInjectionExtensions
26
25
module RegexInjectionConfig implements DataFlow:: ConfigSig {
27
26
import RegexInjection
28
27
29
- predicate isSource ( DataFlow:: Node source ) { source instanceof ActiveThreatModelSource }
28
+ predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
30
29
31
30
predicate isSink ( DataFlow:: Node sink ) { sink instanceof Sink }
32
31
You can’t perform that action at this time.
0 commit comments