Erik Krogh Kristensen
e89e99deaa
Merge pull request #4461 from erik-krogh/pyPrint
...
Python: implement printAst for Python
2020-10-22 09:37:10 +02:00
Rasmus Wriedt Larsen
09a2a6cdfd
Python: Fix django re_path kwarg test
...
Since it was using the wrong keyword argument name before :D
2020-10-16 11:12:12 +02:00
Erik Krogh Kristensen
1d2ca42d49
update expected output
2020-10-15 13:42:13 +02:00
Erik Krogh Kristensen
9b7c59f4b4
implement printAst for Python
2020-10-12 21:17:46 +02:00
Taus Brock-Nannestad
b5d05f99c9
Python: Fix test output
2020-10-02 12:04:43 +02:00
Taus Brock-Nannestad
45eccb2521
Python: Fix test failures.
2020-07-07 17:01:17 +02:00
Taus Brock-Nannestad
f07a7bf8cf
Python: Autoformat everything using qlformat.
...
Will need subsequent PRs fixing up test failures (due to deprecated
methods moving around), but other than that everything should be
straight-forward.
2020-07-07 15:43:52 +02:00
Rasmus Wriedt Larsen
67be45f045
Merge branch 'master' into python-fix-django-taint-sinks
2020-07-02 11:55:42 +02:00
Rasmus Lerchedahl Petersen
f6c59abcd9
Merge branch 'master' of github.com:github/codeql into UnmatchableDollar
...
to make CodeScan happy
2020-06-24 11:04:07 +02:00
Taus Brock-Nannestad
48e3e9c0b4
Python: Do all the renames.
2020-06-19 17:02:47 +02:00
Taus Brock-Nannestad
06d6913a20
Python: Change "sanity" to "consistency".
2020-06-19 16:55:59 +02:00
Rasmus Wriedt Larsen
c0043eb9db
Python: Don't treat re.escape(...) as a regex
...
Fixes https://github.com/github/codeql/issues/3712
2020-06-15 11:54:14 +02:00
Rasmus Wriedt Larsen
7601bd497e
Python: Add tests for re.escape FP
2020-06-15 11:34:42 +02:00
semmle-qlci
f7c6b1364b
Merge pull request #3640 from RasmusWL/python-handle-3.8-enum-convert
...
Approved by tausbn
2020-06-10 17:19:22 +01:00
Rasmus Wriedt Larsen
baa415fec8
Python: Add points-to regression for metaclass
2020-06-08 15:03:46 +02:00
Rasmus Wriedt Larsen
1ff369f62d
Python: Update test results for fabric.api.execute
2020-06-04 16:30:03 +02:00
Rasmus Wriedt Larsen
6cba2fe4f8
Python: Model Django response sinks that are not vuln to XSS
...
Since HttpResponse is not *only* used for XSS, it is still valuable to know the
content is send as part of the response.
The *proper* solution to this problem of not all HttpResponses being vulnerable
to XSS is probably to define a new abstract class in Http.qll called
HttpResponseXSSVulnerableSink (or similar). I would like to model a few more
libraries/frameworks before fully comitting to an approach though.
2020-05-26 16:45:46 +02:00
Rasmus Wriedt Larsen
9c75a39b81
Python: Extend command-injection to handle fabric.api.execute
2020-05-26 10:22:27 +02:00
Rasmus Wriedt Larsen
e04d1ffcd2
Python: Add test for fabric.api.execute
2020-05-26 10:20:22 +02:00
semmle-qlci
8146073c74
Merge pull request #3553 from RasmusWL/python-fix-tainttracking-import
...
Approved by tausbn
2020-05-25 14:18:54 +01:00
Rasmus Wriedt Larsen
f602f3e1c7
Python: Use proper import for semmle.python.dataflow.TaintTracking
...
It was moved in 637677d515 , but imports were not
updated.
2020-05-25 13:45:49 +02:00
semmle-qlci
ac1a338390
Merge pull request #3407 from RasmusWL/python-add-BoundMethodValue-v2
...
Approved by tausbn
2020-05-25 12:00:45 +01:00
Rasmus Wriedt Larsen
49d7e12acd
Python: Remove unnecessary restriction from getNamedArgumentForCall
...
As agreed in https://github.com/github/codeql/pull/3407
2020-05-25 10:17:37 +02:00
Rasmus Wriedt Larsen
4fc3cae646
Python: Add test for how arguments to *args and **kwargs are handled
2020-05-25 10:16:10 +02:00
Rasmus Lerchedahl Petersen
4d6ad32f04
Python: Update test expectations.
...
As ar as I can tell, all these are improvements
2020-05-20 08:11:03 +02:00
Rasmus Wriedt Larsen
3774310985
Python: Reduce FPs in Django due to bad XSS taint-sinks
...
Fixes https://github.com/github/codeql-python-team/issues/38
2020-05-18 19:14:43 +02:00
Rasmus Wriedt Larsen
fa08676a1d
Python: Proper redirect taint sinks for Django
...
Also a major restructuring of the code. A bit controversial since it
renames/moves classes that are already public.
Fixes https://github.com/github/codeql/issues/3466
2020-05-18 19:14:29 +02:00
Rasmus Wriedt Larsen
72ea4ff0dc
Python: Add more tests of django responses
...
They clearly shouldn't all be XSS sinks
2020-05-18 16:56:47 +02:00
Rasmus Wriedt Larsen
8150c78ae0
Python: In flask, taint routed prameters for variable rules
...
Fixes https://github.com/github/codeql-python-team/issues/79
2020-05-12 15:02:32 +02:00
Rasmus Wriedt Larsen
7d5e35a7aa
Python: Expand flask tests to use "variable rules"
...
which is what flask calls them. wildcard rules in bottle, django doesn't even
give them a proper term :(
2020-05-12 14:23:24 +02:00
Rasmus Wriedt Larsen
07ae40206f
Python: Don't allow getParameter(-1) for BoundMethodValue
...
As per discussion in the PR
2020-05-05 11:37:10 +02:00
Rasmus Wriedt Larsen
affca1a728
Python: Add test-cases using keyword arguments for builtin function
2020-05-05 10:26:25 +02:00
Rasmus Wriedt Larsen
838106d49c
Python: Refactor get[Named]ArgumentForCall
...
Also fixed a bug for BoundMethodValue, as highlighted in the expected diff 👍
2020-05-04 20:51:23 +02:00
Rasmus Wriedt Larsen
bc92c26e12
Python: Add BoundMethodValue
2020-05-04 20:51:12 +02:00
Rasmus Wriedt Larsen
96fdb7a5b6
Python: Add tests for getParameter[byName]
...
These already have results for BoundMethodValue, although
1) it's a bit strange that `getParameter(-1)` has results
2) why does `Method(Function C.n, class C)` exists? this would only be relevant
if `n` was a classmethod, but it isn't. It's not a problem that it exsits per
se, but curious.
2020-05-04 20:51:04 +02:00
Rasmus Wriedt Larsen
e9859ad96d
Python: Fix getArgumentForCall when using keyword arguments
...
Yikes :|
2020-05-04 20:50:56 +02:00
Rasmus Wriedt Larsen
acb506db21
Python: Add test for getNamedArgumentForCall
...
and rename the one for getArgumentForCall
2020-05-04 20:50:32 +02:00
Rasmus Wriedt Larsen
9ec32ee1c1
Python: Add test-cases using keyword arguments
2020-05-04 20:50:19 +02:00
Rasmus Wriedt Larsen
fc0b0221f0
Python: Add test-cases for BuiltinFunction and BuiltinMethod
2020-05-04 20:50:14 +02:00
Rasmus Wriedt Larsen
f624754390
Python: Use Value in GetACAll test
...
That was not possible when using the old Object-API, but in Value-API getACall
is defined on all Values.
2020-05-04 20:50:06 +02:00
Rasmus Wriedt Larsen
06b67e0d32
Python: Modernise test/library-tests/PointsTo/calls/*
2020-05-04 20:49:57 +02:00
Rasmus Wriedt Larsen
a5289bd708
Python: Use Object in CallRefersTo test
...
Since other things than FunctionObject can be called ;)
2020-05-04 20:49:47 +02:00
Rasmus Wriedt Larsen
7b8b4af6d2
Python: Add test for call.getFunction().refersTo
...
Showing that
`call.getFunction().refersTo(func)` gives different results from
`call = func.getACall()`
2020-05-04 20:49:19 +02:00
Rasmus Wriedt Larsen
e569d7ae41
Merge branch 'master' into python-parse_qs
2020-04-30 17:05:17 +02:00
Rasmus Wriedt Larsen
e0b4518a3e
Merge branch 'master' into python-improve-file-taint
2020-04-30 11:24:29 +02:00
Taus
de08433bd3
Merge pull request #3212 from RasmusWL/python-fix-tests-filter
...
Python: Fix (some) shortcomings of tests filter
2020-04-27 11:26:35 +02:00
Taus
bcb980b3d5
Merge pull request #3302 from RasmusWL/python-str-taint-add-methods
...
Python: Add taint for string methods
2020-04-24 16:29:11 +02:00
semmle-qlci
4c7a5007d8
Merge pull request #3314 from RasmusWL/python-model-stdlib-http.server
...
Approved by tausbn
2020-04-24 15:27:21 +01:00
Taus
1d6b6a48ae
Merge pull request #2924 from BekaValentine/python-objectapi-to-valueapi-wrongnumberargumentsincall
...
Python: ObjectAPI to ValueAPI: WrongNumberArgumentsInCall
2020-04-23 17:56:39 +02:00
Rasmus Wriedt Larsen
fe50811bbf
Python: In taint test, list comprehension => for loop
...
Apparently they're not the same thing :(
2020-04-23 14:13:00 +02:00