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 {
341
341
)
342
342
or
343
343
( 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 )
345
346
or
346
347
kind .isDtdRetrieval ( ) and
347
348
this .getArgByName ( "load_dtd" ) .getALocalSource ( ) .asExpr ( ) = any ( True t ) and
Original file line number Diff line number Diff line change 47
47
48
48
# Safe for both Billion laughs and XXE
49
49
parser = 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
51
51
52
52
# DTD retrival vuln (also XXE)
53
53
parser = lxml .etree .XMLParser (load_dtd = True , no_network = False )
You can’t perform that action at this time.
0 commit comments