Skip to content

Commit ab59d5c

Browse files
committed
Python: Rename to XmlParsing
To follow our style guide
1 parent d2b03bb commit ab59d5c

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

python/ql/lib/semmle/python/Concepts.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,22 +580,22 @@ module XML {
580580
* A data-flow node that parses XML.
581581
*
582582
* Extend this class to model new APIs. If you want to refine existing API models,
583-
* extend `XMLParsing` instead.
583+
* extend `XmlParsing` instead.
584584
*/
585-
class XMLParsing extends Decoding instanceof XMLParsing::Range {
585+
class XmlParsing extends Decoding instanceof XmlParsing::Range {
586586
/**
587587
* Holds if this XML parsing is vulnerable to `kind`.
588588
*/
589589
predicate vulnerableTo(XMLParsingVulnerabilityKind kind) { super.vulnerableTo(kind) }
590590
}
591591

592592
/** Provides classes for modeling XML parsing APIs. */
593-
module XMLParsing {
593+
module XmlParsing {
594594
/**
595595
* A data-flow node that parses XML.
596596
*
597597
* Extend this class to model new APIs. If you want to refine existing API models,
598-
* extend `XMLParsing` instead.
598+
* extend `XmlParsing` instead.
599599
*/
600600
abstract class Range extends Decoding::Range {
601601
/**

python/ql/lib/semmle/python/frameworks/Lxml.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private module Lxml {
196196
/**
197197
* A call to the `feed` method of an `lxml` parser.
198198
*/
199-
private class LXMLParserFeedCall extends DataFlow::MethodCallNode, XML::XMLParsing::Range {
199+
private class LXMLParserFeedCall extends DataFlow::MethodCallNode, XML::XmlParsing::Range {
200200
LXMLParserFeedCall() { this.calls(instance(_), "feed") }
201201

202202
override DataFlow::Node getAnInput() { result in [this.getArg(0), this.getArgByName("data")] }
@@ -233,7 +233,7 @@ private module Lxml {
233233
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.parse
234234
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.parseid
235235
*/
236-
private class LXMLParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
236+
private class LXMLParsing extends DataFlow::CallCfgNode, XML::XmlParsing::Range {
237237
LXMLParsing() {
238238
this =
239239
API::moduleImport("lxml")
@@ -305,7 +305,7 @@ private module Lxml {
305305
* See
306306
* - https://lxml.de/apidoc/lxml.etree.html?highlight=parseids#lxml.etree.iterparse
307307
*/
308-
private class LXMLIterparseCall extends DataFlow::CallCfgNode, XML::XMLParsing::Range,
308+
private class LXMLIterparseCall extends DataFlow::CallCfgNode, XML::XmlParsing::Range,
309309
FileSystemAccess::Range {
310310
LXMLIterparseCall() {
311311
this = API::moduleImport("lxml").getMember("etree").getMember("iterparse").getACall()

python/ql/lib/semmle/python/frameworks/Stdlib.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3236,7 +3236,7 @@ private module StdlibPrivate {
32363236
/**
32373237
* A call to the `feed` method of an `xml.etree` parser.
32383238
*/
3239-
private class XMLEtreeParserFeedCall extends DataFlow::MethodCallNode, XML::XMLParsing::Range {
3239+
private class XMLEtreeParserFeedCall extends DataFlow::MethodCallNode, XML::XmlParsing::Range {
32403240
XMLEtreeParserFeedCall() { this.calls(instance(), "feed") }
32413241

32423242
override DataFlow::Node getAnInput() { result in [this.getArg(0), this.getArgByName("data")] }
@@ -3274,7 +3274,7 @@ private module StdlibPrivate {
32743274
* - https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.parse
32753275
* - https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.iterparse
32763276
*/
3277-
private class XMLEtreeParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
3277+
private class XMLEtreeParsing extends DataFlow::CallCfgNode, XML::XmlParsing::Range {
32783278
XMLEtreeParsing() {
32793279
this =
32803280
API::moduleImport("xml")
@@ -3445,7 +3445,7 @@ private module StdlibPrivate {
34453445
*
34463446
* See https://docs.python.org/3/library/xml.sax.reader.html#xml.sax.xmlreader.XMLReader.parse
34473447
*/
3448-
private class XMLSaxInstanceParsing extends DataFlow::MethodCallNode, XML::XMLParsing::Range,
3448+
private class XMLSaxInstanceParsing extends DataFlow::MethodCallNode, XML::XmlParsing::Range,
34493449
FileSystemAccess::Range {
34503450
XMLSaxInstanceParsing() {
34513451
this =
@@ -3496,7 +3496,7 @@ private module StdlibPrivate {
34963496
* - https://docs.python.org/3.10/library/xml.sax.html#xml.sax.parse
34973497
* - https://docs.python.org/3.10/library/xml.sax.html#xml.sax.parseString
34983498
*/
3499-
private class XMLSaxParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
3499+
private class XMLSaxParsing extends DataFlow::CallCfgNode, XML::XmlParsing::Range {
35003500
XMLSaxParsing() {
35013501
this =
35023502
API::moduleImport("xml").getMember("sax").getMember(["parse", "parseString"]).getACall()
@@ -3562,7 +3562,7 @@ private module StdlibPrivate {
35623562
* - https://docs.python.org/3/library/xml.dom.minidom.html#xml.dom.minidom.parse
35633563
* - https://docs.python.org/3/library/xml.dom.pulldom.html#xml.dom.pulldom.parse
35643564
*/
3565-
private class XMLDomParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
3565+
private class XMLDomParsing extends DataFlow::CallCfgNode, XML::XmlParsing::Range {
35663566
XMLDomParsing() {
35673567
this =
35683568
API::moduleImport("xml")

python/ql/lib/semmle/python/frameworks/Xmltodict.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ private module Xmltodict {
2020
/**
2121
* A call to `xmltodict.parse`.
2222
*/
23-
private class XMLtoDictParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
23+
private class XMLtoDictParsing extends DataFlow::CallCfgNode, XML::XmlParsing::Range {
2424
XMLtoDictParsing() { this = API::moduleImport("xmltodict").getMember("parse").getACall() }
2525

2626
override DataFlow::Node getAnInput() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module XmlBomb {
4040
*/
4141
class XmlParsingWithEntityResolution extends Sink {
4242
XmlParsingWithEntityResolution() {
43-
exists(XML::XMLParsing parsing, XML::XMLParsingVulnerabilityKind kind |
43+
exists(XML::XmlParsing parsing, XML::XMLParsingVulnerabilityKind kind |
4444
(kind.isBillionLaughs() or kind.isQuadraticBlowup()) and
4545
parsing.vulnerableTo(kind) and
4646
this = parsing.getAnInput()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module Xxe {
4040
*/
4141
class XmlParsingWithExternalEntityResolution extends Sink {
4242
XmlParsingWithExternalEntityResolution() {
43-
exists(XML::XMLParsing parsing, XML::XMLParsingVulnerabilityKind kind |
43+
exists(XML::XmlParsing parsing, XML::XMLParsingVulnerabilityKind kind |
4444
kind.isXxe() and
4545
parsing.vulnerableTo(kind) and
4646
this = parsing.getAnInput()

python/ql/test/experimental/meta/ConceptsTest.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ class XmlParsingTest extends InlineExpectationsTest {
547547

548548
override predicate hasActualResult(Location location, string element, string tag, string value) {
549549
exists(location.getFile().getRelativePath()) and
550-
exists(XML::XMLParsing parsing, XML::XMLParsingVulnerabilityKind kind |
550+
exists(XML::XmlParsing parsing, XML::XMLParsingVulnerabilityKind kind |
551551
parsing.vulnerableTo(kind) and
552552
location = parsing.getLocation() and
553553
element = parsing.toString() and

0 commit comments

Comments
 (0)