@@ -66,7 +66,7 @@ private module XmlEtree {
6666
6767 override DataFlow:: Node getAnInput ( ) { result in [ this .getArg ( 0 ) , this .getArgByName ( "data" ) ] }
6868
69- override predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) {
69+ override predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
7070 kind .isBillionLaughs ( ) or kind .isQuadraticBlowup ( )
7171 }
7272 }
@@ -103,7 +103,7 @@ private module XmlEtree {
103103 ]
104104 }
105105
106- override predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) {
106+ override predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
107107 // note: it does not matter what `xml.etree` parser you are using, you cannot
108108 // change the security features anyway :|
109109 kind .isBillionLaughs ( ) or kind .isQuadraticBlowup ( )
@@ -218,7 +218,7 @@ private module SaxBasedParsing {
218218
219219 override DataFlow:: Node getAnInput ( ) { result in [ this .getArg ( 0 ) , this .getArgByName ( "source" ) ] }
220220
221- override predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) {
221+ override predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
222222 // always vuln to these
223223 ( kind .isBillionLaughs ( ) or kind .isQuadraticBlowup ( ) )
224224 or
@@ -251,7 +251,7 @@ private module SaxBasedParsing {
251251 ]
252252 }
253253
254- override predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) {
254+ override predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
255255 // always vuln to these
256256 ( kind .isBillionLaughs ( ) or kind .isQuadraticBlowup ( ) )
257257 or
@@ -290,7 +290,7 @@ private module SaxBasedParsing {
290290
291291 DataFlow:: Node getParserArg ( ) { result in [ this .getArg ( 1 ) , this .getArgByName ( "parser" ) ] }
292292
293- override predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) {
293+ override predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
294294 this .getParserArg ( ) = saxParserWithFeatureExternalGesTurnedOn ( ) and
295295 ( kind .isXxe ( ) or kind .isDtdRetrieval ( ) )
296296 or
@@ -317,7 +317,7 @@ private module Lxml {
317317 */
318318 abstract class InstanceSource extends DataFlow:: LocalSourceNode {
319319 /** Holds if this instance is vulnerable to `kind`. */
320- abstract predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) ;
320+ abstract predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) ;
321321 }
322322
323323 /**
@@ -331,7 +331,7 @@ private module Lxml {
331331 }
332332
333333 // NOTE: it's not possible to change settings of a parser after constructing it
334- override predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) {
334+ override predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
335335 kind .isXxe ( ) and
336336 (
337337 // resolve_entities has default True
@@ -360,7 +360,7 @@ private module Lxml {
360360 API:: moduleImport ( "lxml" ) .getMember ( "etree" ) .getMember ( "get_default_parser" ) .getACall ( )
361361 }
362362
363- override predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) {
363+ override predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
364364 // as highlighted by
365365 // https://lxml.de/apidoc/lxml.etree.html?highlight=xmlparser#lxml.etree.XMLParser
366366 // by default XXE is allow. so as long as the default parser has not been
@@ -385,7 +385,7 @@ private module Lxml {
385385
386386 /** Gets a reference to an `lxml.etree` parser instance, that is vulnerable to `kind`. */
387387 DataFlow:: Node instanceVulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
388- exists ( InstanceSource origin | result = instance ( origin ) and origin .vulnerable ( kind ) )
388+ exists ( InstanceSource origin | result = instance ( origin ) and origin .vulnerableTo ( kind ) )
389389 }
390390
391391 /**
@@ -396,7 +396,7 @@ private module Lxml {
396396
397397 override DataFlow:: Node getAnInput ( ) { result in [ this .getArg ( 0 ) , this .getArgByName ( "data" ) ] }
398398
399- override predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) {
399+ override predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
400400 this .calls ( instanceVulnerableTo ( kind ) , "feed" )
401401 }
402402 }
@@ -435,7 +435,7 @@ private module Lxml {
435435
436436 DataFlow:: Node getParserArg ( ) { result in [ this .getArg ( 1 ) , this .getArgByName ( "parser" ) ] }
437437
438- override predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) {
438+ override predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
439439 this .getParserArg ( ) = XMLParser:: instanceVulnerableTo ( kind )
440440 or
441441 kind .isXxe ( ) and
@@ -455,7 +455,7 @@ private module Xmltodict {
455455 result in [ this .getArg ( 0 ) , this .getArgByName ( "xml_input" ) ]
456456 }
457457
458- override predicate vulnerable ( XML:: XMLVulnerabilityKind kind ) {
458+ override predicate vulnerableTo ( XML:: XMLVulnerabilityKind kind ) {
459459 ( kind .isBillionLaughs ( ) or kind .isQuadraticBlowup ( ) ) and
460460 this .getArgByName ( "disable_entities" ) .getALocalSource ( ) .asExpr ( ) = any ( False f )
461461 }
0 commit comments