Skip to content

Commit 0e9da4a

Browse files
committed
Python: Resolve name conflict over XML module
Not the prettiest solution... but it works ¯\_(ツ)_/¯
1 parent 6b14c1d commit 0e9da4a

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

python/ql/src/experimental/Security/CWE-611/SimpleXmlRpcServer.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ from DataFlow::CallCfgNode call, string kinds
1717
where
1818
call = API::moduleImport("xmlrpc").getMember("server").getMember("SimpleXMLRPCServer").getACall() and
1919
kinds =
20-
strictconcat(XML::XMLVulnerabilityKind kind |
20+
strictconcat(ExperimentalXML::XMLVulnerabilityKind kind |
2121
kind.isBillionLaughs() or kind.isQuadraticBlowup()
2222
|
2323
kind, ", "

python/ql/src/experimental/semmle/python/Concepts.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ private import semmle.python.dataflow.new.RemoteFlowSources
1414
private import semmle.python.dataflow.new.TaintTracking
1515
private import experimental.semmle.python.Frameworks
1616

17-
module XML {
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 {
1822
/**
1923
* A kind of XML vulnerability.
2024
*

python/ql/src/experimental/semmle/python/frameworks/Xml.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ private import semmle.python.dataflow.new.DataFlow
88
private import experimental.semmle.python.Concepts
99
private import semmle.python.ApiGraphs
1010

11+
module XML = ExperimentalXML;
12+
1113
private module XmlEtree {
1214
/**
1315
* Provides models for `xml.etree` parsers

python/ql/src/experimental/semmle/python/security/dataflow/XmlEntityInjectionCustomizations.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module XmlEntityInjection {
5454
* See `XML::XMLParsing`.
5555
*/
5656
class XMLParsingInputAsSink extends Sink {
57-
XML::XMLParsing xmlParsing;
57+
ExperimentalXML::XMLParsing xmlParsing;
5858

5959
XMLParsingInputAsSink() { this = xmlParsing.getAnInput() }
6060

0 commit comments

Comments
 (0)