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 1111 * external/cwe/cwe-400
1212 */
1313
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+
1540private import RegexInjectionFlow:: PathGraph
1641
1742from RegexInjectionFlow:: PathNode sourceNode , RegexInjectionFlow:: PathNode sinkNode
You can’t perform that action at this time.
0 commit comments