File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
src/experimental/semmle/python/frameworks
test/experimental/library-tests/frameworks/XML Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -341,7 +341,8 @@ private module Lxml {
341341 )
342342 or
343343 ( kind .isBillionLaughs ( ) or kind .isQuadraticBlowup ( ) ) and
344- this .getArgByName ( "huge_tree" ) .getALocalSource ( ) .asExpr ( ) = any ( True t )
344+ this .getArgByName ( "huge_tree" ) .getALocalSource ( ) .asExpr ( ) = any ( True t ) and
345+ not this .getArgByName ( "resolve_entities" ) .getALocalSource ( ) .asExpr ( ) = any ( False t )
345346 or
346347 kind .isDtdRetrieval ( ) and
347348 this .getArgByName ( "load_dtd" ) .getALocalSource ( ) .asExpr ( ) = any ( True t ) and
Original file line number Diff line number Diff line change 4747
4848# Safe for both Billion laughs and XXE
4949parser = lxml .etree .XMLParser (resolve_entities = False , huge_tree = True )
50- lxml .etree .fromstring (x , parser = parser ) # $ input=x SPURIOUS: vuln='Billion Laughs' vuln='Quadratic Blowup'
50+ lxml .etree .fromstring (x , parser = parser ) # $ input=x
5151
5252# DTD retrival vuln (also XXE)
5353parser = lxml .etree .XMLParser (load_dtd = True , no_network = False )
You can’t perform that action at this time.
0 commit comments