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
1515 * injection vulnerabilities, as well as extension points for adding your own.
1616 */
1717module RegexInjection {
18+ /**
19+ * A data flow source for regular expression injection vulnerabilities.
20+ */
21+ abstract class Source extends DataFlow:: Node { }
22+
1823 /**
1924 * A data flow sink for regular expression injection vulnerabilities.
2025 */
@@ -27,6 +32,11 @@ module RegexInjection {
2732 */
2833 abstract class Barrier extends DataFlow:: Node { }
2934
35+ /**
36+ * An active threat-model source, considered as a flow source.
37+ */
38+ private class ActiveThreatModelSourceAsSource extends Source , ActiveThreatModelSource { }
39+
3040 /**
3141 * A sink for `a` in `Regex::new(a)` when `a` is not a literal.
3242 */
Original file line number Diff line number Diff line change 1717private import rust
1818private import codeql.rust.dataflow.DataFlow
1919private import codeql.rust.dataflow.TaintTracking
20- private import codeql.rust.Concepts
2120private import codeql.rust.security.regex.RegexInjectionExtensions
2221
2322/**
@@ -26,7 +25,7 @@ private import codeql.rust.security.regex.RegexInjectionExtensions
2625module RegexInjectionConfig implements DataFlow:: ConfigSig {
2726 import RegexInjection
2827
29- predicate isSource ( DataFlow:: Node source ) { source instanceof ActiveThreatModelSource }
28+ predicate isSource ( DataFlow:: Node source ) { source instanceof Source }
3029
3130 predicate isSink ( DataFlow:: Node sink ) { sink instanceof Sink }
3231
You can’t perform that action at this time.
0 commit comments