File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
python/ql/lib/semmle/python/frameworks Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -129,11 +129,6 @@ module Lxml {
129129 any ( True t )
130130 )
131131 or
132- kind .isXmlBomb ( ) and
133- this .getKeywordParameter ( "huge_tree" ) .getAValueReachingSink ( ) .asExpr ( ) = any ( True t ) and
134- not this .getKeywordParameter ( "resolve_entities" ) .getAValueReachingSink ( ) .asExpr ( ) =
135- any ( False t )
136- or
137132 kind .isDtdRetrieval ( ) and
138133 this .getKeywordParameter ( "load_dtd" ) .getAValueReachingSink ( ) .asExpr ( ) = any ( True t ) and
139134 this .getKeywordParameter ( "no_network" ) .getAValueReachingSink ( ) .asExpr ( ) = any ( False t )
@@ -305,9 +300,8 @@ module Lxml {
305300 // note that there is no `resolve_entities` argument, so it's not possible to turn off XXE :O
306301 kind .isXxe ( )
307302 or
308- kind .isXmlBomb ( ) and
309- this .getKeywordParameter ( "huge_tree" ) .getAValueReachingSink ( ) .asExpr ( ) = any ( True t )
310- or
303+ // libxml2 has built-in protection against XML bombs via entity reference loop detection,
304+ // so lxml is not vulnerable to XML bomb attacks.
311305 kind .isDtdRetrieval ( ) and
312306 this .getKeywordParameter ( "load_dtd" ) .getAValueReachingSink ( ) .asExpr ( ) = any ( True t ) and
313307 this .getKeywordParameter ( "no_network" ) .getAValueReachingSink ( ) .asExpr ( ) = any ( False t )
You can’t perform that action at this time.
0 commit comments