Python: Modernise cherrypy library

This commit is contained in:
Rasmus Wriedt Larsen
2019-09-27 11:02:22 +02:00
parent 18b28b1b57
commit ff28b3f1b4
3 changed files with 7 additions and 8 deletions

View File

@@ -3,8 +3,8 @@ import semmle.python.web.Http
module CherryPy {
FunctionObject expose() {
result = ModuleObject::named("cherrypy").attr("expose")
FunctionValue expose() {
result = Value::named("cherrypy.expose")
}
}
@@ -12,9 +12,9 @@ module CherryPy {
class CherryPyExposedFunction extends Function {
CherryPyExposedFunction() {
this.getADecorator().refersTo(CherryPy::expose())
this.getADecorator().pointsTo(CherryPy::expose())
or
this.getADecorator().(Call).getFunc().refersTo(CherryPy::expose())
this.getADecorator().(Call).getFunc().pointsTo(CherryPy::expose())
}
}
@@ -23,10 +23,10 @@ class CherryPyRoute extends CallNode {
CherryPyRoute() {
/* cherrypy.quickstart(root, script_name, config) */
ModuleObject::named("cherrypy").attr("quickstart").(FunctionObject).getACall() = this
Value::named("cherrypy.quickstart").(FunctionValue).getACall() = this
or
/* cherrypy.tree.mount(root, script_name, config) */
this.getFunction().(AttrNode).getObject("mount").refersTo(ModuleObject::named("cherrypy").attr("tree"))
this.getFunction().(AttrNode).getObject("mount").pointsTo(Value::named("cherrypy.tree"))
}
ClassObject getAppClass() {

View File

@@ -54,7 +54,7 @@ class CherryPyExposedFunctionParameter extends TaintSource {
class CherryPyRequestSource extends TaintSource {
CherryPyRequestSource() {
this.(ControlFlowNode).refersTo(ModuleObject::named("cherrypy").attr("request"))
this.(ControlFlowNode).pointsTo(Value::named("cherrypy.request"))
}
override predicate isSourceOf(TaintKind kind) {