mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Modernise cherrypy library
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user