@@ -44,94 +44,84 @@ class LogOutput extends DataFlow::Node {
44
44
DataFlow:: Node getAnInput ( ) { result = range .getAnInput ( ) }
45
45
}
46
46
47
- /** Provides classes for modeling XML parsing APIs. */
48
- module XMLParsing {
47
+ module XML {
49
48
/**
50
49
* A data-flow node that collects functions parsing XML.
51
50
*
52
51
* Extend this class to model new APIs. If you want to refine existing API models,
53
52
* extend `XMLParsing` instead.
54
53
*/
55
- abstract class Range extends DataFlow:: Node {
54
+ class XMLParsing extends DataFlow:: Node instanceof XMLParsing :: Range {
56
55
/**
57
56
* Gets the argument containing the content to parse.
58
57
*/
59
- abstract DataFlow:: Node getAnInput ( ) ;
58
+ DataFlow:: Node getAnInput ( ) { result = super . getAnInput ( ) }
60
59
61
60
/**
62
- * Holds if the parser may be parsing the input dangerously.
63
- *
64
- * Specifically, this predicate holds whether the XML parsing parses/extends external
65
- * entities in the parsed XML stream.
61
+ * Holds if the parsing method or the parser holding it is vulnerable to `kind`.
66
62
*/
67
- abstract predicate mayBeDangerous ( ) ;
63
+ predicate vulnerable ( string kind ) { super . vulnerable ( kind ) }
68
64
}
69
- }
70
65
71
- /**
72
- * A data-flow node that collects functions parsing XML.
73
- *
74
- * Extend this class to model new APIs. If you want to refine existing API models,
75
- * extend `XMLParsing` instead.
76
- */
77
- class XMLParsing extends DataFlow :: Node instanceof XMLParsing:: Range {
78
- /**
79
- * Gets the argument containing the content to parse.
80
- *
81
- * Specifically, this predicate holds whether the XML parsing parses/extends external
82
- * entities in the parsed XML stream.
83
- */
84
- DataFlow :: Node getAnInput ( ) { result = super . getAnInput ( ) }
85
-
86
- /**
87
- * Holds if the parser may be parsing the input dangerously.
88
- */
89
- predicate mayBeDangerous ( ) { super . mayBeDangerous ( ) }
90
- }
66
+ /** Provides classes for modeling XML parsing APIs. */
67
+ module XMLParsing {
68
+ /* *
69
+ * A data-flow node that collects functions parsing XML.
70
+ *
71
+ * Extend this class to model new APIs. If you want to refine existing API models,
72
+ * extend ` XMLParsing` instead.
73
+ */
74
+ abstract class Range extends DataFlow :: Node {
75
+ /* *
76
+ * Gets the argument containing the content to parse.
77
+ */
78
+ abstract DataFlow :: Node getAnInput ( ) ;
79
+
80
+ /**
81
+ * Holds if the parsing method or the parser holding it is vulnerable to `kind`.
82
+ */
83
+ abstract predicate vulnerable ( string kind ) ;
84
+ }
85
+ }
91
86
92
- /** Provides classes for modeling XML parsers. */
93
- module XMLParser {
94
87
/**
95
88
* A data-flow node that collects XML parsers.
96
89
*
97
90
* Extend this class to model new APIs. If you want to refine existing API models,
98
91
* extend `XMLParser` instead.
99
92
*/
100
- abstract class Range extends DataFlow:: Node {
93
+ class XMLParser extends DataFlow:: Node instanceof XMLParser :: Range {
101
94
/**
102
95
* Gets the argument containing the content to parse.
103
96
*/
104
- abstract DataFlow:: Node getAnInput ( ) ;
97
+ DataFlow:: Node getAnInput ( ) { result = super . getAnInput ( ) }
105
98
106
99
/**
107
- * Holds if the parser may be dangerously configured.
108
- *
109
- * Specifically, this predicate holds whether the XML parser parses/extends external
110
- * entities in the parsed XML stream.
100
+ * Holds if the parser is vulnerable to `kind`.
111
101
*/
112
- abstract predicate mayBeDangerous ( ) ;
102
+ predicate vulnerable ( string kind ) { super . vulnerable ( kind ) }
113
103
}
114
- }
115
-
116
- /**
117
- * A data-flow node that collects XML parsers.
118
- *
119
- * Extend this class to model new APIs. If you want to refine existing API models,
120
- * extend `XMLParser` instead.
121
- */
122
- class XMLParser extends DataFlow:: Node instanceof XMLParser:: Range {
123
- /**
124
- * Gets the argument containing the content to parse.
125
- */
126
- DataFlow:: Node getAnInput ( ) { result = super .getAnInput ( ) }
127
104
128
- /**
129
- * Holds if the parser may be dangerously configured.
130
- *
131
- * Specifically, this predicate holds whether the XML parser parses/extends external
132
- * entities in the parsed XML stream.
133
- */
134
- predicate mayBeDangerous ( ) { super .mayBeDangerous ( ) }
105
+ /** Provides classes for modeling XML parsers. */
106
+ module XMLParser {
107
+ /**
108
+ * A data-flow node that collects XML parsers.
109
+ *
110
+ * Extend this class to model new APIs. If you want to refine existing API models,
111
+ * extend `XMLParser` instead.
112
+ */
113
+ abstract class Range extends DataFlow:: Node {
114
+ /**
115
+ * Gets the argument containing the content to parse.
116
+ */
117
+ abstract DataFlow:: Node getAnInput ( ) ;
118
+
119
+ /**
120
+ * Holds if the parser is vulnerable to `kind`.
121
+ */
122
+ abstract predicate vulnerable ( string kind ) ;
123
+ }
124
+ }
135
125
}
136
126
137
127
/** Provides classes for modeling LDAP query execution-related APIs. */
0 commit comments