File tree Expand file tree Collapse file tree 4 files changed +39
-2
lines changed
python/ql/test/library-tests/web/flask Expand file tree Collapse file tree 4 files changed +39
-2
lines changed Original file line number Diff line number Diff line change 6
6
| test.py:41:26:41:53 | flask.response.argument | externally controlled string |
7
7
| test.py:46:12:46:62 | flask.routed.response | externally controlled string |
8
8
| test.py:46:26:46:61 | flask.response.argument | externally controlled string |
9
+ | test.py:50:12:50:48 | flask.routed.response | externally controlled string |
10
+ | test.py:50:26:50:47 | flask.response.argument | externally controlled string |
11
+ | test.py:54:12:54:53 | flask.routed.response | externally controlled string |
12
+ | test.py:54:26:54:52 | flask.response.argument | externally controlled string |
13
+ | test.py:60:12:60:62 | flask.routed.response | externally controlled string |
14
+ | test.py:60:26:60:61 | flask.response.argument | externally controlled string |
15
+ | test.py:64:12:64:58 | flask.routed.response | externally controlled string |
16
+ | test.py:64:26:64:57 | flask.response.argument | externally controlled string |
Original file line number Diff line number Diff line change 1
- | / | Function hello |
1
+ | / | Function hello_world |
2
+ | /complex/<string(length=2):lang_code> | Function complex |
2
3
| /dangerous | Function dangerous |
3
4
| /dangerous-with-cfg-split | Function dangerous2 |
5
+ | /foo/<path:subpath> | Function foo |
6
+ | /hello/<name> | Function hello |
7
+ | /multiple/bar/<bar> | Function multiple |
4
8
| /safe | Function safe |
5
9
| /the/ | Function get |
6
10
| /unsafe | Function unsafe |
Original file line number Diff line number Diff line change 15
15
| test.py:45 | Attribute() | externally controlled string |
16
16
| test.py:46 | first_name | externally controlled string |
17
17
| test.py:46 | make_response() | flask.Response |
18
+ | test.py:50 | make_response() | flask.Response |
19
+ | test.py:54 | make_response() | flask.Response |
20
+ | test.py:60 | make_response() | flask.Response |
21
+ | test.py:64 | make_response() | flask.Response |
Original file line number Diff line number Diff line change 4
4
app = Flask (__name__ )
5
5
6
6
@app .route ("/" )
7
- def hello ():
7
+ def hello_world ():
8
8
return "Hello World!"
9
9
10
10
from flask .views import MethodView
@@ -44,3 +44,24 @@ def unsafe():
44
44
def safe ():
45
45
first_name = request .args .get ('name' , '' )
46
46
return make_response ("Your name is " + escape (first_name ))
47
+
48
+ @app .route ('/hello/<name>' )
49
+ def hello (name ):
50
+ return make_response ("Your name is " + name )
51
+
52
+ @app .route ('/foo/<path:subpath>' )
53
+ def foo (subpath ):
54
+ return make_response ("The subpath is " + subpath )
55
+
56
+ @app .route ('/multiple/' ) # TODO: not recognized as route
57
+ @app .route ('/multiple/foo/<foo>' ) # TODO: not recognized as route
58
+ @app .route ('/multiple/bar/<bar>' )
59
+ def multiple (foo = None , bar = None ):
60
+ return make_response ("foo={!r} bar={!r}" .format (foo , bar ))
61
+
62
+ @app .route ('/complex/<string(length=2):lang_code>' )
63
+ def complex (lang_code ):
64
+ return make_response ("lang_code {}" .format (lang_code ))
65
+
66
+ if __name__ == "__main__" :
67
+ app .run (debug = True )
You can’t perform that action at this time.
0 commit comments