@@ -59,8 +59,8 @@ class XercesDOMParserClass extends Class {
59
59
/**
60
60
* The `SAXParser` class.
61
61
*/
62
- class SAXParser extends Class {
63
- SAXParser ( ) { this .hasName ( "SAXParser" ) }
62
+ class SAXParserClass extends Class {
63
+ SAXParserClass ( ) { this .hasName ( "SAXParser" ) }
64
64
}
65
65
66
66
/**
@@ -112,7 +112,7 @@ class DisableDefaultEntityResolutionTranformer extends XXEFlowStateTranformer {
112
112
call .getTarget ( ) = f and
113
113
(
114
114
f .getDeclaringType ( ) instanceof AbstractDOMParserClass or
115
- f .getDeclaringType ( ) instanceof SAXParser
115
+ f .getDeclaringType ( ) instanceof SAXParserClass
116
116
) and
117
117
f .hasName ( "setDisableDefaultEntityResolution" ) and
118
118
this = call .getQualifier ( ) and
@@ -172,7 +172,7 @@ class CreateEntityReferenceNodesTranformer extends XXEFlowStateTranformer {
172
172
class ParseFunction extends Function {
173
173
ParseFunction ( ) {
174
174
this .getClassAndName ( "parse" ) instanceof AbstractDOMParserClass or
175
- this .getClassAndName ( "parse" ) instanceof SAXParser
175
+ this .getClassAndName ( "parse" ) instanceof SAXParserClass
176
176
}
177
177
}
178
178
@@ -213,9 +213,9 @@ class XXEConfiguration extends DataFlow::Configuration {
213
213
// source is the write on `this` of a call to the `SAXParser`
214
214
// constructor.
215
215
exists ( CallInstruction call |
216
+ call .getStaticCallTarget ( ) = any ( SAXParserClass c ) .getAConstructor ( ) and
216
217
node .asInstruction ( ) .( WriteSideEffectInstruction ) .getDestinationAddress ( ) =
217
218
call .getThisArgument ( ) and
218
- call .getStaticCallTarget ( ) .( Constructor ) .getDeclaringType ( ) instanceof SAXParser and
219
219
encodeXercesFlowState ( flowstate , 0 , 1 ) // default configuration
220
220
)
221
221
}
0 commit comments