mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Python: Resolve name conflict over XML module
Not the prettiest solution... but it works ¯\_(ツ)_/¯
This commit is contained in:
committed by
Rasmus Wriedt Larsen
parent
6b14c1d6b9
commit
0e9da4aadb
@@ -17,7 +17,7 @@ from DataFlow::CallCfgNode call, string kinds
|
||||
where
|
||||
call = API::moduleImport("xmlrpc").getMember("server").getMember("SimpleXMLRPCServer").getACall() and
|
||||
kinds =
|
||||
strictconcat(XML::XMLVulnerabilityKind kind |
|
||||
strictconcat(ExperimentalXML::XMLVulnerabilityKind kind |
|
||||
kind.isBillionLaughs() or kind.isQuadraticBlowup()
|
||||
|
|
||||
kind, ", "
|
||||
|
||||
@@ -14,7 +14,11 @@ private import semmle.python.dataflow.new.RemoteFlowSources
|
||||
private import semmle.python.dataflow.new.TaintTracking
|
||||
private import experimental.semmle.python.Frameworks
|
||||
|
||||
module XML {
|
||||
/**
|
||||
* Since there is both XML module in normal and experimental Concepts,
|
||||
* we have to rename the experimental module as this.
|
||||
*/
|
||||
module ExperimentalXML {
|
||||
/**
|
||||
* A kind of XML vulnerability.
|
||||
*
|
||||
|
||||
@@ -8,6 +8,8 @@ private import semmle.python.dataflow.new.DataFlow
|
||||
private import experimental.semmle.python.Concepts
|
||||
private import semmle.python.ApiGraphs
|
||||
|
||||
module XML = ExperimentalXML;
|
||||
|
||||
private module XmlEtree {
|
||||
/**
|
||||
* Provides models for `xml.etree` parsers
|
||||
|
||||
@@ -54,7 +54,7 @@ module XmlEntityInjection {
|
||||
* See `XML::XMLParsing`.
|
||||
*/
|
||||
class XMLParsingInputAsSink extends Sink {
|
||||
XML::XMLParsing xmlParsing;
|
||||
ExperimentalXML::XMLParsing xmlParsing;
|
||||
|
||||
XMLParsingInputAsSink() { this = xmlParsing.getAnInput() }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user