@@ -14,74 +14,6 @@ private import semmle.python.dataflow.new.RemoteFlowSources
1414private import semmle.python.dataflow.new.TaintTracking
1515private import experimental.semmle.python.Frameworks
1616
17- /**
18- * Since there is both XML module in normal and experimental Concepts,
19- * we have to rename the experimental module as this.
20- */
21- module ExperimentalXML {
22- /**
23- * A kind of XML vulnerability.
24- *
25- * See https://pypi.org/project/defusedxml/#python-xml-libraries
26- */
27- class XMLVulnerabilityKind extends string {
28- XMLVulnerabilityKind ( ) {
29- this in [ "Billion Laughs" , "Quadratic Blowup" , "XXE" , "DTD retrieval" ]
30- }
31-
32- /** Holds for Billion Laughs vulnerability kind. */
33- predicate isBillionLaughs ( ) { this = "Billion Laughs" }
34-
35- /** Holds for Quadratic Blowup vulnerability kind. */
36- predicate isQuadraticBlowup ( ) { this = "Quadratic Blowup" }
37-
38- /** Holds for XXE vulnerability kind. */
39- predicate isXxe ( ) { this = "XXE" }
40-
41- /** Holds for DTD retrieval vulnerability kind. */
42- predicate isDtdRetrieval ( ) { this = "DTD retrieval" }
43- }
44-
45- /**
46- * A data-flow node that parses XML.
47- *
48- * Extend this class to model new APIs. If you want to refine existing API models,
49- * extend `XMLParsing` instead.
50- */
51- class XMLParsing extends DataFlow:: Node instanceof XMLParsing:: Range {
52- /**
53- * Gets the argument containing the content to parse.
54- */
55- DataFlow:: Node getAnInput ( ) { result = super .getAnInput ( ) }
56-
57- /**
58- * Holds if this XML parsing is vulnerable to `kind`.
59- */
60- predicate vulnerableTo ( XMLVulnerabilityKind kind ) { super .vulnerableTo ( kind ) }
61- }
62-
63- /** Provides classes for modeling XML parsing APIs. */
64- module XMLParsing {
65- /**
66- * A data-flow node that parses XML.
67- *
68- * Extend this class to model new APIs. If you want to refine existing API models,
69- * extend `XMLParsing` instead.
70- */
71- abstract class Range extends DataFlow:: Node {
72- /**
73- * Gets the argument containing the content to parse.
74- */
75- abstract DataFlow:: Node getAnInput ( ) ;
76-
77- /**
78- * Holds if this XML parsing is vulnerable to `kind`.
79- */
80- abstract predicate vulnerableTo ( XMLVulnerabilityKind kind ) ;
81- }
82- }
83- }
84-
8517/** Provides classes for modeling LDAP query execution-related APIs. */
8618module LdapQuery {
8719 /**
0 commit comments