File tree Expand file tree Collapse file tree
python/ql/src/experimental/semmle/python/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,12 +163,16 @@ private module Xml {
163163 override DataFlow:: Node getAnInput ( ) { none ( ) }
164164
165165 override predicate vulnerable ( string kind ) {
166- kind = "XXE" and not this .getArgByName ( "resolve_entities" ) .asExpr ( ) = any ( False f )
166+ kind = "XXE" and
167+ not (
168+ exists ( this .getArgByName ( "resolve_entities" ) ) or
169+ this .getArgByName ( "resolve_entities" ) .getALocalSource ( ) .asExpr ( ) = any ( False f )
170+ )
167171 or
168172 kind = [ "Billion Laughs" , "Quadratic Blowup" ] and
169173 (
170- this .getArgByName ( "huge_tree" ) .asExpr ( ) = any ( True t ) and
171- not this .getArgByName ( "resolve_entities" ) .asExpr ( ) = any ( False f )
174+ this .getArgByName ( "huge_tree" ) .getALocalSource ( ) . asExpr ( ) = any ( True t ) and
175+ not this .getArgByName ( "resolve_entities" ) .getALocalSource ( ) . asExpr ( ) = any ( False f )
172176 )
173177 }
174178 }
@@ -231,7 +235,7 @@ private module Xml {
231235
232236 override predicate vulnerable ( string kind ) {
233237 kind = [ "Billion Laughs" , "Quadratic Blowup" ] and
234- this .getAMethodCall ( "disable_entities" ) .asExpr ( ) = any ( False f )
238+ this .getArgByName ( "disable_entities" ) . getALocalSource ( ) .asExpr ( ) = any ( False f )
235239 }
236240 }
237241
You can’t perform that action at this time.
0 commit comments