Apply .getALocalSource() and fix xmltodict's vulnerable predicate

This commit is contained in:
jorgectf
2022-02-08 17:51:09 +01:00
parent 7c4a6a12b0
commit 01ad25f3f0

View File

@@ -163,12 +163,16 @@ private module Xml {
override DataFlow::Node getAnInput() { none() }
override predicate vulnerable(string kind) {
kind = "XXE" and not this.getArgByName("resolve_entities").asExpr() = any(False f)
kind = "XXE" and
not (
exists(this.getArgByName("resolve_entities")) or
this.getArgByName("resolve_entities").getALocalSource().asExpr() = any(False f)
)
or
kind = ["Billion Laughs", "Quadratic Blowup"] and
(
this.getArgByName("huge_tree").asExpr() = any(True t) and
not this.getArgByName("resolve_entities").asExpr() = any(False f)
this.getArgByName("huge_tree").getALocalSource().asExpr() = any(True t) and
not this.getArgByName("resolve_entities").getALocalSource().asExpr() = any(False f)
)
}
}
@@ -231,7 +235,7 @@ private module Xml {
override predicate vulnerable(string kind) {
kind = ["Billion Laughs", "Quadratic Blowup"] and
this.getAMethodCall("disable_entities").asExpr() = any(False f)
this.getArgByName("disable_entities").getALocalSource().asExpr() = any(False f)
}
}