Skip to content

Commit 1d7cec6

Browse files
committed
Python: xml.sax.parse is not a method call
And it's not possible to provide a parser argument either
1 parent e112697 commit 1d7cec6

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3482,7 +3482,7 @@ private module StdlibPrivate {
34823482
* - https://docs.python.org/3.10/library/xml.sax.html#xml.sax.parse
34833483
* - https://docs.python.org/3.10/library/xml.sax.html#xml.sax.parseString
34843484
*/
3485-
private class XMLSaxParsing extends DataFlow::MethodCallNode, XML::XMLParsing::Range {
3485+
private class XMLSaxParsing extends DataFlow::CallCfgNode, XML::XMLParsing::Range {
34863486
XMLSaxParsing() {
34873487
this =
34883488
API::moduleImport("xml").getMember("sax").getMember(["parse", "parseString"]).getACall()
@@ -3501,10 +3501,6 @@ private module StdlibPrivate {
35013501
override predicate vulnerableTo(XML::XMLParsingVulnerabilityKind kind) {
35023502
// always vuln to these
35033503
(kind.isBillionLaughs() or kind.isQuadraticBlowup())
3504-
or
3505-
// can be vuln to other things if features has been turned on
3506-
this.getObject() = saxParserWithFeatureExternalGesTurnedOn() and
3507-
(kind.isXxe() or kind.isDtdRetrieval())
35083504
}
35093505

35103506
override predicate mayExecuteInput() { none() }

0 commit comments

Comments
 (0)