Python: fix QL alert

This commit is contained in:
Rasmus Lerchedahl Petersen
2023-09-29 12:06:51 +02:00
parent 2d845e3e55
commit e1708054a4

View File

@@ -153,14 +153,15 @@ private module PyMongo {
/** The `$where` query operator executes a string as JavaScript. */
private class WhereQueryOperator extends DataFlow::Node, Decoding::Range {
API::Node dictionary;
DataFlow::Node query;
WhereQueryOperator() {
dictionary =
mongoCollection().getMember(mongoCollectionMethodName()).getACall().getParameter(0) and
query = dictionary.getSubscript("$where").asSink() and
this = dictionary.getAValueReachingSink()
exists(API::Node dictionary |
dictionary =
mongoCollection().getMember(mongoCollectionMethodName()).getACall().getParameter(0) and
query = dictionary.getSubscript("$where").asSink() and
this = dictionary.getAValueReachingSink()
)
}
override DataFlow::Node getAnInput() { result = query }