Skip to content

Commit 516b29d

Browse files
authored
Merge pull request #544 from pavgust/fix/python-hotfixes
Pull recent Python fixes to RC branch
2 parents 8e54c7a + a1772a9 commit 516b29d

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

python/ql/src/default.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* WARNING: Use of this module is DEPRECATED.
3+
* All new queries should use `import python`.
4+
*/
5+
import python

python/ql/src/semmle/python/security/Paths.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ query predicate parents(TaintedNode child, TaintedNode parent) {
2020
child = first_child(parent) or
2121
exists(TaintedNode prev |
2222
parents(prev, parent) and
23-
child = next_sibling(child)
23+
child = next_sibling(prev)
2424
)
2525
}

python/ql/test/query-tests/Security/CWE-022/PathInjection.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ parents
2828
| ../lib/os/path.py:4:14:4:14 | externally controlled string | path_injection.py:16:30:16:60 | externally controlled string |
2929
| ../lib/os/path.py:4:14:4:14 | externally controlled string | path_injection.py:25:30:25:60 | externally controlled string |
3030
| ../lib/os/path.py:4:14:4:14 | externally controlled string | path_injection.py:34:30:34:60 | externally controlled string |
31+
| ../lib/os/path.py:5:12:5:12 | externally controlled string | path_injection.py:16:30:16:60 | externally controlled string |
32+
| ../lib/os/path.py:5:12:5:12 | externally controlled string | path_injection.py:25:30:25:60 | externally controlled string |
33+
| ../lib/os/path.py:5:12:5:12 | externally controlled string | path_injection.py:34:30:34:60 | externally controlled string |
3134
#select
3235
| path_injection.py:10:14:10:44 | argument to open() | path_injection.py:9:12:9:23 | dict of externally controlled string | path_injection.py:10:14:10:44 | externally controlled string | This path depends on $@. | path_injection.py:9:12:9:23 | flask.request.args | a user-provided value |
3336
| path_injection.py:17:14:17:18 | argument to open() | path_injection.py:15:12:15:23 | dict of externally controlled string | path_injection.py:17:14:17:18 | normalized path | This path depends on $@. | path_injection.py:15:12:15:23 | flask.request.args | a user-provided value |

python/ql/test/query-tests/Security/CWE-079/ReflectedXss.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ edges
99
| reflected_xss.py:12:18:12:45 | externally controlled string | reflected_xss.py:13:51:13:60 | externally controlled string |
1010
parents
1111
| ../lib/flask/__init__.py:14:19:14:20 | externally controlled string | reflected_xss.py:8:26:8:53 | externally controlled string |
12+
| ../lib/flask/__init__.py:15:19:15:20 | externally controlled string | reflected_xss.py:8:26:8:53 | externally controlled string |
13+
| ../lib/flask/__init__.py:16:25:16:26 | externally controlled string | reflected_xss.py:8:26:8:53 | externally controlled string |
1214
#select
1315
| ../lib/flask/__init__.py:16:25:16:26 | flask.response.argument | reflected_xss.py:7:18:7:29 | dict of externally controlled string | ../lib/flask/__init__.py:16:25:16:26 | externally controlled string | Cross-site scripting vulnerability due to $@. | reflected_xss.py:7:18:7:29 | flask.request.args | user-provided value |

python/ql/test/query-tests/Security/CWE-209/StackTraceExposure.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ edges
66
| test.py:37:25:37:27 | exception info | test.py:37:12:37:27 | exception info |
77
parents
88
| test.py:36:18:36:20 | exception info | test.py:34:29:34:31 | exception info |
9+
| test.py:37:12:37:27 | exception info | test.py:34:29:34:31 | exception info |
10+
| test.py:37:25:37:27 | exception info | test.py:34:29:34:31 | exception info |
911
#select
1012
| test.py:16:16:16:37 | flask.routed.response | test.py:16:16:16:37 | exception info | test.py:16:16:16:37 | exception info | $@ may be exposed to an external user | test.py:16:16:16:37 | exception.info.source | Error information |
1113
| test.py:34:16:34:32 | flask.routed.response | test.py:33:15:33:36 | exception info | test.py:34:16:34:32 | exception info | $@ may be exposed to an external user | test.py:33:15:33:36 | exception.info.source | Error information |

0 commit comments

Comments
 (0)