File tree Expand file tree Collapse file tree 2 files changed +26
-32
lines changed
lib/codeql/rust/security/regex
src/queries/security/CWE-730 Expand file tree Collapse file tree 2 files changed +26
-32
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11
11
* external/cwe/cwe-400
12
12
*/
13
13
14
- private import codeql.rust.security.regex.RegexInjectionQuery
14
+ private import rust
15
+ private import codeql.rust.dataflow.DataFlow
16
+ private import codeql.rust.dataflow.TaintTracking
17
+ private import codeql.rust.Concepts
18
+ private import codeql.rust.security.regex.RegexInjectionExtensions
19
+
20
+ /**
21
+ * A taint configuration for detecting regular expression injection vulnerabilities.
22
+ */
23
+ module RegexInjectionConfig implements DataFlow:: ConfigSig {
24
+ predicate isSource ( DataFlow:: Node source ) { source instanceof ThreatModelSource }
25
+
26
+ predicate isSink ( DataFlow:: Node sink ) { sink instanceof RegexInjectionSink }
27
+
28
+ predicate isBarrier ( DataFlow:: Node barrier ) { barrier instanceof RegexInjectionBarrier }
29
+
30
+ predicate isAdditionalFlowStep ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
31
+ any ( RegexInjectionAdditionalFlowStep s ) .step ( nodeFrom , nodeTo )
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Detect taint flow of tainted data that reaches a regular expression sink.
37
+ */
38
+ module RegexInjectionFlow = TaintTracking:: Global< RegexInjectionConfig > ;
39
+
15
40
private import RegexInjectionFlow:: PathGraph
16
41
17
42
from RegexInjectionFlow:: PathNode sourceNode , RegexInjectionFlow:: PathNode sinkNode
You can’t perform that action at this time.
0 commit comments