@@ -14,6 +14,73 @@ private import semmle.python.dataflow.new.RemoteFlowSources
1414private import semmle.python.dataflow.new.TaintTracking
1515private import experimental.semmle.python.Frameworks
1616
17+ /** Provides classes for modeling Regular Expression-related APIs. */
18+ module RegexExecution {
19+ /**
20+ * A data-flow node that executes a regular expression.
21+ *
22+ * Extend this class to model new APIs. If you want to refine existing API models,
23+ * extend `RegexExecution` instead.
24+ */
25+ abstract class Range extends DataFlow:: Node {
26+ /**
27+ * Gets the argument containing the executed expression.
28+ */
29+ abstract DataFlow:: Node getRegexNode ( ) ;
30+
31+ /**
32+ * Gets the library used to execute the regular expression.
33+ */
34+ abstract string getRegexModule ( ) ;
35+ }
36+ }
37+
38+ /**
39+ * A data-flow node that executes a regular expression.
40+ *
41+ * Extend this class to refine existing API models. If you want to model new APIs,
42+ * extend `RegexExecution::Range` instead.
43+ */
44+ class RegexExecution extends DataFlow:: Node {
45+ RegexExecution:: Range range ;
46+
47+ RegexExecution ( ) { this = range }
48+
49+ DataFlow:: Node getRegexNode ( ) { result = range .getRegexNode ( ) }
50+
51+ string getRegexModule ( ) { result = range .getRegexModule ( ) }
52+ }
53+
54+ /** Provides classes for modeling Regular Expression escape-related APIs. */
55+ module RegexEscape {
56+ /**
57+ * A data-flow node that escapes a regular expression.
58+ *
59+ * Extend this class to model new APIs. If you want to refine existing API models,
60+ * extend `RegexEscape` instead.
61+ */
62+ abstract class Range extends DataFlow:: Node {
63+ /**
64+ * Gets the argument containing the escaped expression.
65+ */
66+ abstract DataFlow:: Node getRegexNode ( ) ;
67+ }
68+ }
69+
70+ /**
71+ * A data-flow node that escapes a regular expression.
72+ *
73+ * Extend this class to refine existing API models. If you want to model new APIs,
74+ * extend `RegexEscape::Range` instead.
75+ */
76+ class RegexEscape extends DataFlow:: Node {
77+ RegexEscape:: Range range ;
78+
79+ RegexEscape ( ) { this = range }
80+
81+ DataFlow:: Node getRegexNode ( ) { result = range .getRegexNode ( ) }
82+ }
83+
1784/** Provides classes for modeling LDAP query execution-related APIs. */
1885module LDAPQuery {
1986 /**
0 commit comments