@@ -109,15 +109,15 @@ private module Lxml {
109
109
*
110
110
* See https://lxml.de/apidoc/lxml.etree.html?highlight=xmlparser#lxml.etree.XMLParser
111
111
*/
112
- module XMLParser {
112
+ module XmlParser {
113
113
/**
114
114
* A source of instances of `lxml.etree` parsers, extend this class to model new instances.
115
115
*
116
116
* This can include instantiations of the class, return values from function
117
117
* calls, or a special parameter that will be set when functions are called by an external
118
118
* library.
119
119
*
120
- * Use the predicate `XMLParser ::instance()` to get references to instances of `lxml.etree` parsers.
120
+ * Use the predicate `XmlParser ::instance()` to get references to instances of `lxml.etree` parsers.
121
121
*/
122
122
abstract class InstanceSource extends DataFlow:: LocalSourceNode {
123
123
/** Holds if this instance is vulnerable to `kind`. */
@@ -129,8 +129,8 @@ private module Lxml {
129
129
*
130
130
* See https://lxml.de/apidoc/lxml.etree.html?highlight=xmlparser#lxml.etree.XMLParser
131
131
*/
132
- private class LXMLParser extends InstanceSource , DataFlow:: CallCfgNode {
133
- LXMLParser ( ) {
132
+ private class LxmlParser extends InstanceSource , DataFlow:: CallCfgNode {
133
+ LxmlParser ( ) {
134
134
this = API:: moduleImport ( "lxml" ) .getMember ( "etree" ) .getMember ( "XMLParser" ) .getACall ( )
135
135
}
136
136
@@ -159,8 +159,8 @@ private module Lxml {
159
159
*
160
160
* See https://lxml.de/apidoc/lxml.etree.html?highlight=xmlparser#lxml.etree.get_default_parser
161
161
*/
162
- private class LXMLDefaultParser extends InstanceSource , DataFlow:: CallCfgNode {
163
- LXMLDefaultParser ( ) {
162
+ private class LxmlDefaultParser extends InstanceSource , DataFlow:: CallCfgNode {
163
+ LxmlDefaultParser ( ) {
164
164
this =
165
165
API:: moduleImport ( "lxml" ) .getMember ( "etree" ) .getMember ( "get_default_parser" ) .getACall ( )
166
166
}
@@ -196,8 +196,8 @@ private module Lxml {
196
196
/**
197
197
* A call to the `feed` method of an `lxml` parser.
198
198
*/
199
- private class LXMLParserFeedCall extends DataFlow:: MethodCallNode , XML:: XmlParsing:: Range {
200
- LXMLParserFeedCall ( ) { this .calls ( instance ( _) , "feed" ) }
199
+ private class LxmlParserFeedCall extends DataFlow:: MethodCallNode , XML:: XmlParsing:: Range {
200
+ LxmlParserFeedCall ( ) { this .calls ( instance ( _) , "feed" ) }
201
201
202
202
override DataFlow:: Node getAnInput ( ) { result in [ this .getArg ( 0 ) , this .getArgByName ( "data" ) ] }
203
203
@@ -233,8 +233,8 @@ private module Lxml {
233
233
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.parse
234
234
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.parseid
235
235
*/
236
- private class LXMLParsing extends DataFlow:: CallCfgNode , XML:: XmlParsing:: Range {
237
- LXMLParsing ( ) {
236
+ private class LxmlParsing extends DataFlow:: CallCfgNode , XML:: XmlParsing:: Range {
237
+ LxmlParsing ( ) {
238
238
this =
239
239
API:: moduleImport ( "lxml" )
240
240
.getMember ( "etree" )
@@ -257,7 +257,7 @@ private module Lxml {
257
257
DataFlow:: Node getParserArg ( ) { result in [ this .getArg ( 1 ) , this .getArgByName ( "parser" ) ] }
258
258
259
259
override predicate vulnerableTo ( XML:: XmlParsingVulnerabilityKind kind ) {
260
- this .getParserArg ( ) = XMLParser :: instanceVulnerableTo ( kind )
260
+ this .getParserArg ( ) = XmlParser :: instanceVulnerableTo ( kind )
261
261
or
262
262
kind .isXxe ( ) and
263
263
not exists ( this .getParserArg ( ) )
@@ -284,8 +284,8 @@ private module Lxml {
284
284
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.parse
285
285
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.parseid
286
286
*/
287
- private class FileAccessFromLXMLParsing extends LXMLParsing , FileSystemAccess:: Range {
288
- FileAccessFromLXMLParsing ( ) {
287
+ private class FileAccessFromLxmlParsing extends LxmlParsing , FileSystemAccess:: Range {
288
+ FileAccessFromLxmlParsing ( ) {
289
289
this = API:: moduleImport ( "lxml" ) .getMember ( "etree" ) .getMember ( [ "parse" , "parseid" ] ) .getACall ( )
290
290
// I considered whether we should try to reduce FPs from people passing file-like
291
291
// objects, which will not be a file system access (and couldn't cause a
@@ -305,9 +305,9 @@ private module Lxml {
305
305
* See
306
306
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.iterparse
307
307
*/
308
- private class LXMLIterparseCall extends DataFlow:: CallCfgNode , XML:: XmlParsing:: Range ,
308
+ private class LxmlIterparseCall extends DataFlow:: CallCfgNode , XML:: XmlParsing:: Range ,
309
309
FileSystemAccess:: Range {
310
- LXMLIterparseCall ( ) {
310
+ LxmlIterparseCall ( ) {
311
311
this = API:: moduleImport ( "lxml" ) .getMember ( "etree" ) .getMember ( "iterparse" ) .getACall ( )
312
312
}
313
313
0 commit comments