Rasmus Wriedt Larsen
d607c13ab6
Python: Taint tests: include elment for forgotten MISSING
2021-04-19 15:01:42 +02:00
Rasmus Wriedt Larsen
9585390941
Python: Taint tests, report error location first
...
To better match the standard output from inline expectation tests
2021-04-19 14:59:47 +02:00
Rasmus Wriedt Larsen
b2cb284ff2
Python: Add more examples of what is ok with new taint tests
2021-04-19 14:56:20 +02:00
Rasmus Lerchedahl Petersen
a8280f9b12
Python: update test expectation
2021-04-16 08:25:29 +02:00
Rasmus Wriedt Larsen
3e7dc12246
Python: Port taint tests to use inline expectations
...
The meat of this PR is described in the new python/ql/test/experimental/meta/InlineTaintTest.qll file:
> Defines a InlineExpectationsTest for checking whether any arguments in
> `ensure_tainted` and `ensure_not_tainted` calls are tainted.
>
> Also defines query predicates to ensure that:
> - if any arguments to `ensure_not_tainted` are tainted, their annotation is marked with `SPURIOUS`.
> - if any arguments to `ensure_tainted` are not tainted, their annotation is marked with `MISSING`.
>
> The functionality of this module is tested in `ql/test/experimental/meta/inline-taint-test-demo`.
2021-04-15 18:00:33 +02:00
Rasmus Lerchedahl Petersen
3eb1813584
Python: update test expectations
2021-04-15 10:47:49 +02:00
Rasmus Wriedt Larsen
364d48948f
Merge pull request #3810 from dilanbhalla/syntaxpython
...
Python: Function/Class Naming Convention (Syntax)
2021-04-12 10:42:17 +02:00
jorgectf
5d25a27d62
Add .expected
2021-04-09 22:28:03 +02:00
jorgectf
0e51dbec86
Polish tests
2021-04-09 21:29:56 +02:00
jorgectf
f02c2855ad
Generate .expected
2021-04-09 01:28:38 +02:00
jorgectf
632dc61d5e
Create qlref
2021-04-09 01:28:22 +02:00
jorgectf
e9c4574552
Apply structure
2021-04-09 01:26:53 +02:00
jorgectf
5787406a0d
Add .expected
2021-04-09 00:51:26 +02:00
jorgectf
1320eeee53
Add qlref
2021-04-09 00:51:15 +02:00
jorgectf
015d203fcb
Improve tests, move them and create qhelp examples
2021-04-09 00:50:47 +02:00
jorgectf
7819d1a30b
Generate .expected
2021-04-08 23:45:26 +02:00
jorgectf
4f85de87de
Add qlref
2021-04-08 23:45:12 +02:00
jorgectf
95bfdc4955
Move tests to /test
2021-04-08 23:45:03 +02:00
thank_you
719c30bd92
Fix file name and adjust where the test points to
2021-04-07 16:42:51 -04:00
thank_you
3f0c758622
Add required __raw__ keyword
...
This __raw__ keyword is required for the actual mongoengine vulnerability. More info can be found below:
http://docs.mongoengine.org/guide/querying.html?highlight=inc__#raw-queries
2021-04-05 19:07:13 -04:00
jorgectf
5a1dc48e48
Fix Mongoengine test
2021-03-31 17:50:31 +02:00
jorgectf
4579132f22
Add left tests
2021-03-30 21:14:33 +02:00
jorgectf
517a9202ce
PR init
2021-03-30 17:51:17 +02:00
Rasmus Wriedt Larsen
1f5e52e822
Python: Cleanup "first" type-tracking predicate to be private
...
Since it's exposed nicely in the version that doesn't have a
`DataFlow::TypeTracker` parameter, these should be private.
Also found one instance where I had accidentially used DataFlow::Node instead of
LocalSourceNode
2021-03-23 16:40:56 +01:00
Rasmus Wriedt Larsen
d9079e34e3
Python: Move framework tests out of experimental
...
Since they are not experimental anymore 😄
2021-03-19 15:51:54 +01:00
yoff
37036b5e76
Merge pull request #5437 from RasmusWL/small-pyyaml-improvements
...
Python: Small PyYAML improvements
2021-03-19 11:15:49 +01:00
Rasmus Wriedt Larsen
7543f10593
Python: Reorganize PyYAML tests a bit
2021-03-19 09:53:25 +01:00
yoff
746e9948b0
Merge pull request #5075 from RasmusWL/crypto
...
Python: Port py/weak-crypto-key to use type-tracking
2021-03-18 20:53:28 +01:00
Rasmus Wriedt Larsen
42b2c3ed52
Python: Model C-based loaders for PyYAML
...
Not really that important. But easy to do while I was working on this library.
2021-03-18 11:55:01 +01:00
Rasmus Wriedt Larsen
54e6f51512
Python: Add example of C-based PyYAML loaders
...
```
In [6]: yaml.load("!!python/object/new:os.system [echo EXPLOIT!]", yaml.CLoader)
EXPLOIT!
Out[6]: 0
```
2021-03-18 11:50:59 +01:00
Rasmus Wriedt Larsen
14e9bda5de
Python: Refactor PyYAML tests a bit
2021-03-18 11:39:47 +01:00
Rasmus Wriedt Larsen
d52d328587
Python: Use new API::builtin in stdlib modeling
2021-03-17 15:50:01 +01:00
Taus Brock-Nannestad
978200e2ad
Python: Distinguish between Python 2 and 3
...
Also moves the filtering on `name` to before the big disjunction in
`MkModuleImport`.
2021-03-12 12:35:23 +01:00
Taus Brock-Nannestad
c7b2b719cf
Python: Support builtins in API graphs
2021-03-11 23:03:18 +01:00
Taus
d2ed216670
Merge pull request #5280 from RasmusWL/highlight-tornado-uri
...
Python: Highlight how request.uri works in Tornado
2021-03-04 23:31:02 +01:00
Rasmus Wriedt Larsen
a387496832
Python: Highlight how request.uri works in Tornado
2021-02-26 16:23:21 +01:00
yoff
e3b3825ab0
Merge pull request #5151 from RasmusWL/django-get-redirect-url
...
Python: Model get_redirect_url in django
2021-02-25 23:07:33 +01:00
Rasmus Lerchedahl Petersen
5b51a3461d
Python: Force read- and store steps to add nodes.
...
This gives muche nicer path explanations on some snapshots.
It is achieved by making stepped-to nodes `CastNode`s.
This seems somewhat reasonable as types then to change, when we move
between content and container.
We could probably refine it, though.
2021-02-25 11:49:57 +01:00
Rasmus Wriedt Larsen
27987717dc
Merge branch 'main' into crypto
2021-02-25 11:30:32 +01:00
yoff
9eed17f647
Merge pull request #5152 from RasmusWL/improve-pyyaml-support
...
Python: Improve pyyaml support
2021-02-23 19:58:04 +01:00
Taus
53711dc82f
Merge pull request #5238 from RasmusWL/no-flow-default-value
...
Python: Highlight missing flow from default value in functions
2021-02-23 13:27:41 +01:00
Rasmus Wriedt Larsen
e160c855ad
Merge pull request #5233 from yoff/python-for-tuple-iteration
...
Python: `for`-iteration of tuples
2021-02-22 15:28:13 +01:00
Rasmus Wriedt Larsen
5249b54a9b
Python: Highlight missing flow from default value in functions
...
Although it is becoming non-trivial to get an overview of what tests we have and
don't have, I didn't find any that highlighted this one
I used all 3 variants of parameters, just to be sure :)
2021-02-22 14:52:51 +01:00
Rasmus Lerchedahl Petersen
d23a8ad016
Python: elide test output
2021-02-21 13:12:54 +01:00
Rasmus Lerchedahl Petersen
46faba69ff
Python: Fix for-iteration of tuples
2021-02-21 12:41:16 +01:00
Rasmus Lerchedahl Petersen
0aecf33fe6
Python: test iteration through overflow parameters
...
These are in a tuple, so the for-step does not fire
2021-02-21 12:33:04 +01:00
Rasmus Wriedt Larsen
bfbaa85272
Python: Add test of public_key method with cryptodome
...
Added in 3.10 release https://github.com/Legrandin/pycryptodome/blob/master/Changelog.rst#3100-6-february-2021
2021-02-19 15:03:47 +01:00
Rasmus Wriedt Larsen
d5ff477644
Python: Add modeling for pycryptodome PyPI package
2021-02-19 13:59:18 +01:00
Rasmus Wriedt Larsen
6e4c627209
Python: Add modeling for pycryptodomex PyPI package
2021-02-19 13:59:17 +01:00
Rasmus Wriedt Larsen
bd40965afe
Python: Add modeling for cryptography PyPI package
2021-02-19 13:59:17 +01:00