Skip to content

Commit 618a35b

Browse files
authored
Merge pull request #2664 from RasmusWL/python-fix-redirect-example
Python: Remove unused variable in example for py/url-redirection
2 parents d06e86f + 422658b commit 618a35b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

python/ql/src/Security/CWE-601/examples/redirect_bad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
@app.route('/')
66
def hello():
7-
target = files = request.args.get('target', '')
7+
target = request.args.get('target', '')
88
return redirect(target, code=302)

python/ql/src/Security/CWE-601/examples/redirect_good.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
@app.route('/')
88
def hello():
9-
target = files = request.args.get('target', '')
9+
target = request.args.get('target', '')
1010
if target == VALID_REDIRECT:
1111
return redirect(target, code=302)
1212
else:
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
edges
2-
| test.py:7:22:7:33 | dict of externally controlled string | test.py:7:22:7:51 | externally controlled string |
3-
| test.py:7:22:7:33 | dict of externally controlled string | test.py:7:22:7:51 | externally controlled string |
4-
| test.py:7:22:7:51 | externally controlled string | test.py:8:21:8:26 | externally controlled string |
5-
| test.py:7:22:7:51 | externally controlled string | test.py:8:21:8:26 | externally controlled string |
2+
| test.py:7:14:7:25 | dict of externally controlled string | test.py:7:14:7:43 | externally controlled string |
3+
| test.py:7:14:7:25 | dict of externally controlled string | test.py:7:14:7:43 | externally controlled string |
4+
| test.py:7:14:7:43 | externally controlled string | test.py:8:21:8:26 | externally controlled string |
5+
| test.py:7:14:7:43 | externally controlled string | test.py:8:21:8:26 | externally controlled string |
66
#select
7-
| test.py:8:21:8:26 | target | test.py:7:22:7:33 | dict of externally controlled string | test.py:8:21:8:26 | externally controlled string | Untrusted URL redirection due to $@. | test.py:7:22:7:33 | Attribute | a user-provided value |
7+
| test.py:8:21:8:26 | target | test.py:7:14:7:25 | dict of externally controlled string | test.py:8:21:8:26 | externally controlled string | Untrusted URL redirection due to $@. | test.py:7:14:7:25 | Attribute | a user-provided value |

python/ql/test/query-tests/Security/CWE-601/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@app.route('/')
66
def hello():
7-
target = files = request.args.get('target', '')
7+
target = request.args.get('target', '')
88
return redirect(target, code=302)
99

1010

0 commit comments

Comments
 (0)