Python: Rename to XmlParsing

To follow our style guide
This commit is contained in:
Rasmus Wriedt Larsen
2022-04-05 11:06:22 +02:00
parent d2b03bb480
commit ab59d5c786
7 changed files with 16 additions and 16 deletions

View File

@@ -580,9 +580,9 @@ module XML {
* A data-flow node that parses XML.
*
* Extend this class to model new APIs. If you want to refine existing API models,
* extend `XMLParsing` instead.
* extend `XmlParsing` instead.
*/
class XMLParsing extends Decoding instanceof XMLParsing::Range {
class XmlParsing extends Decoding instanceof XmlParsing::Range {
/**
* Holds if this XML parsing is vulnerable to `kind`.
*/
@@ -590,12 +590,12 @@ module XML {
}
/** Provides classes for modeling XML parsing APIs. */
module XMLParsing {
module XmlParsing {
/**
* A data-flow node that parses XML.
*
* Extend this class to model new APIs. If you want to refine existing API models,
* extend `XMLParsing` instead.
* extend `XmlParsing` instead.
*/
abstract class Range extends Decoding::Range {
/**

View File

@@ -196,7 +196,7 @@ private module Lxml {
/**
* A call to the `feed` method of an `lxml` parser.
*/
private class LXMLParserFeedCall extends DataFlow::MethodCallNode, XML::XMLParsing::Range {
private class LXMLParserFeedCall extends DataFlow::MethodCallNode, XML::XmlParsing::Range {
LXMLParserFeedCall() { this.calls(instance(_), "feed") }
override DataFlow::Node getAnInput() { result in [this.getArg(0), this.getArgByName("data")] }
@@ -233,7 +233,7 @@ private module Lxml {
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.parse
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.parseid
*/
private class LXMLParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
private class LXMLParsing extends DataFlow::CallCfgNode, XML::XmlParsing::Range {
LXMLParsing() {
this =
API::moduleImport("lxml")
@@ -305,7 +305,7 @@ private module Lxml {
* See
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.iterparse
*/
private class LXMLIterparseCall extends DataFlow::CallCfgNode, XML::XMLParsing::Range,
private class LXMLIterparseCall extends DataFlow::CallCfgNode, XML::XmlParsing::Range,
FileSystemAccess::Range {
LXMLIterparseCall() {
this = API::moduleImport("lxml").getMember("etree").getMember("iterparse").getACall()

View File

@@ -3236,7 +3236,7 @@ private module StdlibPrivate {
/**
* A call to the `feed` method of an `xml.etree` parser.
*/
private class XMLEtreeParserFeedCall extends DataFlow::MethodCallNode, XML::XMLParsing::Range {
private class XMLEtreeParserFeedCall extends DataFlow::MethodCallNode, XML::XmlParsing::Range {
XMLEtreeParserFeedCall() { this.calls(instance(), "feed") }
override DataFlow::Node getAnInput() { result in [this.getArg(0), this.getArgByName("data")] }
@@ -3274,7 +3274,7 @@ private module StdlibPrivate {
* - https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.parse
* - https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.iterparse
*/
private class XMLEtreeParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
private class XMLEtreeParsing extends DataFlow::CallCfgNode, XML::XmlParsing::Range {
XMLEtreeParsing() {
this =
API::moduleImport("xml")
@@ -3445,7 +3445,7 @@ private module StdlibPrivate {
*
* See https://docs.python.org/3/library/xml.sax.reader.html#xml.sax.xmlreader.XMLReader.parse
*/
private class XMLSaxInstanceParsing extends DataFlow::MethodCallNode, XML::XMLParsing::Range,
private class XMLSaxInstanceParsing extends DataFlow::MethodCallNode, XML::XmlParsing::Range,
FileSystemAccess::Range {
XMLSaxInstanceParsing() {
this =
@@ -3496,7 +3496,7 @@ private module StdlibPrivate {
* - https://docs.python.org/3.10/library/xml.sax.html#xml.sax.parse
* - https://docs.python.org/3.10/library/xml.sax.html#xml.sax.parseString
*/
private class XMLSaxParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
private class XMLSaxParsing extends DataFlow::CallCfgNode, XML::XmlParsing::Range {
XMLSaxParsing() {
this =
API::moduleImport("xml").getMember("sax").getMember(["parse", "parseString"]).getACall()
@@ -3562,7 +3562,7 @@ private module StdlibPrivate {
* - https://docs.python.org/3/library/xml.dom.minidom.html#xml.dom.minidom.parse
* - https://docs.python.org/3/library/xml.dom.pulldom.html#xml.dom.pulldom.parse
*/
private class XMLDomParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
private class XMLDomParsing extends DataFlow::CallCfgNode, XML::XmlParsing::Range {
XMLDomParsing() {
this =
API::moduleImport("xml")

View File

@@ -20,7 +20,7 @@ private module Xmltodict {
/**
* A call to `xmltodict.parse`.
*/
private class XMLtoDictParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
private class XMLtoDictParsing extends DataFlow::CallCfgNode, XML::XmlParsing::Range {
XMLtoDictParsing() { this = API::moduleImport("xmltodict").getMember("parse").getACall() }
override DataFlow::Node getAnInput() {

View File

@@ -40,7 +40,7 @@ module XmlBomb {
*/
class XmlParsingWithEntityResolution extends Sink {
XmlParsingWithEntityResolution() {
exists(XML::XMLParsing parsing, XML::XMLParsingVulnerabilityKind kind |
exists(XML::XmlParsing parsing, XML::XMLParsingVulnerabilityKind kind |
(kind.isBillionLaughs() or kind.isQuadraticBlowup()) and
parsing.vulnerableTo(kind) and
this = parsing.getAnInput()

View File

@@ -40,7 +40,7 @@ module Xxe {
*/
class XmlParsingWithExternalEntityResolution extends Sink {
XmlParsingWithExternalEntityResolution() {
exists(XML::XMLParsing parsing, XML::XMLParsingVulnerabilityKind kind |
exists(XML::XmlParsing parsing, XML::XMLParsingVulnerabilityKind kind |
kind.isXxe() and
parsing.vulnerableTo(kind) and
this = parsing.getAnInput()

View File

@@ -547,7 +547,7 @@ class XmlParsingTest extends InlineExpectationsTest {
override predicate hasActualResult(Location location, string element, string tag, string value) {
exists(location.getFile().getRelativePath()) and
exists(XML::XMLParsing parsing, XML::XMLParsingVulnerabilityKind kind |
exists(XML::XmlParsing parsing, XML::XMLParsingVulnerabilityKind kind |
parsing.vulnerableTo(kind) and
location = parsing.getLocation() and
element = parsing.toString() and