|
1 | | -/** |
2 | | - * Provides default sources, sinks and sanitizers for detecting |
3 | | - * "regular expression injection" |
4 | | - * vulnerabilities, as well as extension points for adding your own. |
5 | | - */ |
| 1 | +/** DEPRECATED: use semmle.python.security.dataflow.RegexInjectionCustomizations instead. */ |
6 | 2 |
|
7 | | -private import python |
8 | | -private import semmle.python.Concepts |
9 | | -private import semmle.python.dataflow.new.DataFlow |
10 | | -private import semmle.python.dataflow.new.TaintTracking |
11 | | -private import semmle.python.dataflow.new.RemoteFlowSources |
| 3 | +private import semmle.python.security.dataflow.RegexInjectionCustomizations as New |
12 | 4 |
|
13 | | -/** |
14 | | - * Provides default sources, sinks and sanitizers for detecting |
15 | | - * "regular expression injection" |
16 | | - * vulnerabilities, as well as extension points for adding your own. |
17 | | - */ |
18 | | -module RegexInjection { |
19 | | - /** |
20 | | - * A data flow source for "regular expression injection" vulnerabilities. |
21 | | - */ |
22 | | - abstract class Source extends DataFlow::Node { } |
23 | | - |
24 | | - /** |
25 | | - * A sink for "regular expression injection" vulnerabilities is the execution of a regular expression. |
26 | | - * If you have a custom way to execute regular expressions, you can extend `RegexExecution::Range`. |
27 | | - */ |
28 | | - class Sink extends DataFlow::Node { |
29 | | - RegexExecution regexExecution; |
30 | | - |
31 | | - Sink() { this = regexExecution.getRegex() } |
32 | | - |
33 | | - /** Gets the call that executes the regular expression marked by this sink. */ |
34 | | - RegexExecution getRegexExecution() { result = regexExecution } |
35 | | - } |
36 | | - |
37 | | - /** |
38 | | - * A sanitizer for "regular expression injection" vulnerabilities. |
39 | | - */ |
40 | | - abstract class Sanitizer extends DataFlow::Node { } |
41 | | - |
42 | | - /** |
43 | | - * A sanitizer guard for "regular expression injection" vulnerabilities. |
44 | | - */ |
45 | | - abstract class SanitizerGuard extends DataFlow::BarrierGuard { } |
46 | | - |
47 | | - /** |
48 | | - * A source of remote user input, considered as a flow source. |
49 | | - */ |
50 | | - class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { } |
51 | | - |
52 | | - /** |
53 | | - * A regex escaping, considered as a sanitizer. |
54 | | - */ |
55 | | - class RegexEscapingAsSanitizer extends Sanitizer { |
56 | | - RegexEscapingAsSanitizer() { |
57 | | - // Due to use-use flow, we want the output rather than an input |
58 | | - // (so the input can still flow to other sinks). |
59 | | - this = any(RegexEscaping esc).getOutput() |
60 | | - } |
61 | | - } |
62 | | -} |
| 5 | +/** DEPRECATED: use semmle.python.security.dataflow.RegexInjectionCustomizations instead. */ |
| 6 | +deprecated module RegexInjection = New::RegexInjection; |
0 commit comments