Skip to content

Commit ff28b3f

Browse files
committed
Python: Modernise cherrypy library
1 parent 18b28b1 commit ff28b3f

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

python/ql/src/semmle/python/web/cherrypy/General.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import semmle.python.web.Http
33

44
module CherryPy {
55

6-
FunctionObject expose() {
7-
result = ModuleObject::named("cherrypy").attr("expose")
6+
FunctionValue expose() {
7+
result = Value::named("cherrypy.expose")
88
}
99

1010
}
1111

1212
class CherryPyExposedFunction extends Function {
1313

1414
CherryPyExposedFunction() {
15-
this.getADecorator().refersTo(CherryPy::expose())
15+
this.getADecorator().pointsTo(CherryPy::expose())
1616
or
17-
this.getADecorator().(Call).getFunc().refersTo(CherryPy::expose())
17+
this.getADecorator().(Call).getFunc().pointsTo(CherryPy::expose())
1818
}
1919

2020
}
@@ -23,10 +23,10 @@ class CherryPyRoute extends CallNode {
2323

2424
CherryPyRoute() {
2525
/* cherrypy.quickstart(root, script_name, config) */
26-
ModuleObject::named("cherrypy").attr("quickstart").(FunctionObject).getACall() = this
26+
Value::named("cherrypy.quickstart").(FunctionValue).getACall() = this
2727
or
2828
/* cherrypy.tree.mount(root, script_name, config) */
29-
this.getFunction().(AttrNode).getObject("mount").refersTo(ModuleObject::named("cherrypy").attr("tree"))
29+
this.getFunction().(AttrNode).getObject("mount").pointsTo(Value::named("cherrypy.tree"))
3030
}
3131

3232
ClassObject getAppClass() {

python/ql/src/semmle/python/web/cherrypy/Request.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CherryPyExposedFunctionParameter extends TaintSource {
5454
class CherryPyRequestSource extends TaintSource {
5555

5656
CherryPyRequestSource() {
57-
this.(ControlFlowNode).refersTo(ModuleObject::named("cherrypy").attr("request"))
57+
this.(ControlFlowNode).pointsTo(Value::named("cherrypy.request"))
5858
}
5959

6060
override predicate isSourceOf(TaintKind kind) {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
| ../../../query-tests/Security/lib/cherrypy/__init__.py:10 | _ThreadLocalProxy() | cherrypy.request |
2-
| ../../../query-tests/Security/lib/cherrypy/__init__.py:10 | request | cherrypy.request |
32
| test.py:10 | arg | externally controlled string |
43
| test.py:16 | arg | externally controlled string |

0 commit comments

Comments
 (0)