Add Werkzeug source

This commit is contained in:
Ahmed Farid
2022-08-23 12:51:48 +01:00
committed by GitHub
parent ee05e2ca76
commit 93257be913

View File

@@ -157,6 +157,25 @@ private class TornadoClientSuppliedsecret extends ClientSuppliedsecret {
}
}
private class WerkzeugClientSuppliedsecret extends ClientSuppliedsecret {
WerkzeugClientSuppliedsecret() {
exists(RemoteFlowSource rfs, DataFlow::AttrRead get |
rfs.getSourceType() = "werkzeug.datastructures" and this.getFunction() = get
|
// `get` is a call to datastructures.headers.get or datastructures.headers.get_all or datastructures.headers.getlist
// datastructures.headers
get.getObject()
.(DataFlow::AttrRead)
// request
.getObject()
.getALocalSource() = rfs and
get.getAttributeName() in ["get", "get_all", "getlist"] and
get.getObject().(DataFlow::AttrRead).getAttributeName() = "Headers" and
this.getArg(0).asExpr().(StrConst).getText().toLowerCase() = sensitiveheaders()
)
}
}
/** A string for `match` that identifies strings that look like they represent Sensitive Headers. */
private string sensitiveheaders() {
result =