mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Add tornado source
This commit is contained in:
@@ -46,6 +46,27 @@ private class DjangoClientSuppliedIpUsedInSecurityCheck extends ClientSuppliedIp
|
||||
}
|
||||
}
|
||||
|
||||
private class TornadoClientSuppliedIpUsedInSecurityCheck extends ClientSuppliedIpUsedInSecurityCheck {
|
||||
TornadoClientSuppliedIpUsedInSecurityCheck() {
|
||||
exists(RemoteFlowSource rfs, DataFlow::LocalSourceNode lsn |
|
||||
rfs.getSourceType() = "tornado.web.RequestHandler" and rfs.asCfgNode() = lsn.asCfgNode()
|
||||
|
|
||||
lsn.flowsTo(DataFlow::exprNode(this.getFunction()
|
||||
.asExpr()
|
||||
.(Attribute)
|
||||
.getObject()
|
||||
.(Attribute)
|
||||
.getObject()
|
||||
.(Attribute)
|
||||
.getObject())) and
|
||||
this.getFunction().asExpr().(Attribute).getName() in ["get", "get_list"] and
|
||||
this.getFunction().asExpr().(Attribute).getObject().(Attribute).getName() = "headers" and
|
||||
this.getArg(0).asCfgNode().getNode().(StrConst).getText().toLowerCase() =
|
||||
clientIpParameterName()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private string clientIpParameterName() {
|
||||
result in [
|
||||
"x-forwarded-for", "x_forwarded_for", "x-real-ip", "x_real_ip", "proxy-client-ip",
|
||||
|
||||
Reference in New Issue
Block a user