@@ -44,94 +44,84 @@ class LogOutput extends DataFlow::Node {
4444 DataFlow:: Node getAnInput ( ) { result = range .getAnInput ( ) }
4545}
4646
47- /** Provides classes for modeling XML parsing APIs. */
48- module XMLParsing {
47+ module XML {
4948 /**
5049 * A data-flow node that collects functions parsing XML.
5150 *
5251 * Extend this class to model new APIs. If you want to refine existing API models,
5352 * extend `XMLParsing` instead.
5453 */
55- abstract class Range extends DataFlow:: Node {
54+ class XMLParsing extends DataFlow:: Node instanceof XMLParsing :: Range {
5655 /**
5756 * Gets the argument containing the content to parse.
5857 */
59- abstract DataFlow:: Node getAnInput ( ) ;
58+ DataFlow:: Node getAnInput ( ) { result = super . getAnInput ( ) }
6059
6160 /**
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`.
6662 */
67- abstract predicate mayBeDangerous ( ) ;
63+ predicate vulnerable ( string kind ) { super . vulnerable ( kind ) }
6864 }
69- }
7065
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+ }
9186
92- /** Provides classes for modeling XML parsers. */
93- module XMLParser {
9487 /**
9588 * A data-flow node that collects XML parsers.
9689 *
9790 * Extend this class to model new APIs. If you want to refine existing API models,
9891 * extend `XMLParser` instead.
9992 */
100- abstract class Range extends DataFlow:: Node {
93+ class XMLParser extends DataFlow:: Node instanceof XMLParser :: Range {
10194 /**
10295 * Gets the argument containing the content to parse.
10396 */
104- abstract DataFlow:: Node getAnInput ( ) ;
97+ DataFlow:: Node getAnInput ( ) { result = super . getAnInput ( ) }
10598
10699 /**
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`.
111101 */
112- abstract predicate mayBeDangerous ( ) ;
102+ predicate vulnerable ( string kind ) { super . vulnerable ( kind ) }
113103 }
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 ( ) }
127104
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+ }
135125}
136126
137127/** Provides classes for modeling LDAP query execution-related APIs. */
0 commit comments