Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 18ce257

Browse files
committed
Move RegexInjectionSink to query config (qll)
1 parent 53d61c4 commit 18ce257

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

python/ql/src/experimental/semmle/python/Concepts.qll

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,3 @@ class RegexEscape extends DataFlow::Node {
7676

7777
DataFlow::CallCfgNode getEscapeMethod() { result = range.getEscapeMethod() }
7878
}
79-
80-
class RegexInjectionSink extends DataFlow::Node {
81-
Attribute regexMethod;
82-
83-
RegexInjectionSink() {
84-
exists(RegexExecution reExec |
85-
this = reExec.getRegexNode() and
86-
regexMethod = reExec.getRegexMethod().getFunction().asExpr().(Attribute)
87-
)
88-
}
89-
90-
Attribute getRegexMethod() { result = regexMethod }
91-
}

python/ql/src/experimental/semmle/python/security/injection/RegexInjection.qll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ import semmle.python.dataflow.new.DataFlow
99
import semmle.python.dataflow.new.TaintTracking
1010
import semmle.python.dataflow.new.RemoteFlowSources
1111

12+
class RegexInjectionSink extends DataFlow::Node {
13+
Attribute regexMethod;
14+
15+
RegexInjectionSink() {
16+
exists(RegexExecution reExec |
17+
this = reExec.getRegexNode() and
18+
regexMethod = reExec.getRegexMethod().getFunction().asExpr().(Attribute)
19+
)
20+
}
21+
22+
Attribute getRegexMethod() { result = regexMethod }
23+
}
24+
1225
/**
1326
* A taint-tracking configuration for detecting regular expression injections.
1427
*/

0 commit comments

Comments
 (0)