Taus
75cfec863f
Merge pull request #4828 from yoff/yoff-python-add-source-nodes
...
Python: add source nodes
2021-01-05 15:07:51 +01:00
Rasmus Wriedt Larsen
49f902d28b
Merge pull request #4757 from yoff/python-dataflow-synthetic-callables
...
Python: Enclosing callable for synthetic arguments
2020-12-18 16:06:26 +01:00
Rasmus Lerchedahl Petersen
e6e1cc2398
Python: Remember to accept failing tests
2020-12-18 13:38:14 +01:00
Rasmus Lerchedahl Petersen
0629d3e6e7
Python: Enclosing callable for synthetic arguments
2020-12-18 10:45:24 +01:00
Rasmus Lerchedahl Petersen
a16d58dfc0
Python: Add tests cases with synthetic arguments
2020-12-18 10:41:42 +01:00
Rasmus Wriedt Larsen
e5e8ec6ecc
Python: Add a few test-cases for barrier guards and references
...
I'm not sure references is the best name, but it's the best I could come up with
jsut now
2020-12-07 15:27:20 +01:00
CodeQL CI
e266cedc84
Merge pull request #4700 from RasmusWL/python-add-code-injection-FP
...
Approved by tausbn
2020-12-02 16:29:21 +00:00
Rasmus Wriedt Larsen
a0c7365ae6
Python: Proper models of json.loads and json.dumps
2020-11-27 15:57:56 +01:00
Rasmus Wriedt Larsen
cc9a7fe4fe
Python: Move BarrierGuards to own file
2020-11-27 12:09:57 +01:00
Rasmus Wriedt Larsen
cafe55f5c7
Merge pull request #4701 from yoff/python-fix-return-node-enclosing-callable
...
Python: Use default `getEnclosingCallable` for `RetrunNode`
2020-11-25 10:36:41 +01:00
Rasmus Lerchedahl Petersen
88643da01f
Python: Use default getEnclosingCallable
...
for `RetrunNode`
2020-11-25 08:19:07 +01:00
Rasmus Lerchedahl Petersen
36d9097d03
Python: Add test for inner return
2020-11-25 07:09:27 +01:00
Rasmus Lerchedahl Petersen
34896ae0d7
Python: Fix failing test
2020-11-25 07:09:27 +01:00
yoff
215986bce5
Apply suggestions from code review
...
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com >
2020-11-24 14:12:23 +01:00
Rasmus Lerchedahl Petersen
05d156ba0f
Python: add comments
2020-11-24 14:11:14 +01:00
Rasmus Lerchedahl Petersen
39c5e0d487
Python: update test expectations
2020-11-23 16:46:35 +01:00
Rasmus Lerchedahl Petersen
38bb06a207
Merge remote-tracking branch 'upstream/main' into python-dataflow-variable-capture
2020-11-23 16:40:20 +01:00
Rasmus Wriedt Larsen
f35ffa5632
Python: Add support for x in ["safe", "also_safe"] (and not in)
2020-11-23 10:42:24 +01:00
Rasmus Wriedt Larsen
431aab45f7
Python: Add support for x != "safe" BarrierGuard
2020-11-23 10:36:55 +01:00
Rasmus Wriedt Larsen
18041fd059
Python: Expand string-const-compare tests
...
Also moved file to reflect that. Added tests of
+ `!=`
+ `in`
+ `not in`
2020-11-23 10:36:49 +01:00
Rasmus Wriedt Larsen
08bcba98e6
Python: Add BarrierGuard test with exception inside unsafe branch
2020-11-20 11:55:07 +01:00
Rasmus Wriedt Larsen
34f78d4211
Python: Add BarrierGuard test with return inside unsafe branch
2020-11-20 11:52:36 +01:00
Rasmus Wriedt Larsen
12b36b2245
Python: Highlight that safe or also_safe doesn't clear taint :(
2020-11-20 10:43:46 +01:00
Rasmus Wriedt Larsen
1a52f17da3
Python: Add StringConstCompare BarrierGuard
2020-11-20 10:40:04 +01:00
Rasmus Wriedt Larsen
a82936c904
Python: Enable test for sanitizer-guard and logic expressions
...
`not` is not working properly, but otherwise pretty good
2020-11-20 10:06:25 +01:00
Rasmus Wriedt Larsen
b3d3d6e142
Python: Move logical test of sanitizers
...
Don't know why it would ever have been under default sanitizers :D
2020-11-19 16:46:07 +01:00
Rasmus Lerchedahl Petersen
7cbbf3bbf7
Python: slightly nicer test
2020-11-19 16:20:57 +01:00
Rasmus Lerchedahl Petersen
39f134c1c1
Python: reorganized and added to tests
2020-11-19 12:06:58 +01:00
Rasmus Wriedt Larsen
ab856d6c01
Python: Show getCallableForArgument can have multiple results
2020-11-18 10:44:32 +01:00
Rasmus Lerchedahl Petersen
71830abda0
Python: remaining c# tests, except lambdas
...
both via nonlocal and via dict
2020-11-17 08:28:11 +01:00
Rasmus Lerchedahl Petersen
27b4c67b9f
Python: Start of tests for captured variables
2020-11-16 17:25:39 +01:00
Rasmus Wriedt Larsen
611398586d
Merge pull request #4649 from yoff/python-dataflow-cfgparameters
...
Python: Make `ParameterNode` a `CfgNode`
2020-11-11 10:22:12 +01:00
Anders Schack-Mulligen
89ef6ea4eb
C++/C#/Java/JavaScript/Python: Autoformat set literals.
2020-11-10 13:32:27 +01:00
Rasmus Lerchedahl Petersen
109d55eb25
Python: Make ParameterNode a CfgNode
...
Add a step from that `CfgNode` to the corresponding `EssaNode`.
The intended effect is seen in `ImpliesDataflow.expected`.
The efeect seen in other `.expected`-files is that parameter nodes
change type, that the extra steps are seen, and that flow from
`EssaVar`s is mirrored in flow from `CfgNode`s.
There is one surprise, which is the `.0` node in
`coverage/localFlow.expected`.
2020-11-10 11:35:50 +01:00
Rasmus Lerchedahl Petersen
6cecd3ba83
Python: Move and rename query
2020-11-05 11:49:39 +01:00
Rasmus Lerchedahl Petersen
38b2bb2828
Python: Add testfile with regressions
2020-11-04 15:55:59 +01:00
Rasmus Lerchedahl Petersen
6df3b8d524
Python: Update query and expectation
2020-11-04 15:17:38 +01:00
Rasmus Lerchedahl Petersen
9baa7b73da
Merge branch 'main' of github.com:github/codeql into SharedDataflow_PointsToImpliesDataflow
2020-11-04 15:05:59 +01:00
Jonas Jensen
5680b2df13
Merge remote-tracking branch 'upstream/main' into better-syntax-for-false-positives-and-negatives-inline-expectation
...
Required fixing up semantic conflicts in tests.
Conflicts:
python/ql/test/experimental/library-tests/frameworks/stdlib/Decoding.py
2020-11-03 09:47:26 +01:00
Taus Brock-Nannestad
5dadb0f476
Python: Fix imports in tests
2020-11-02 23:02:29 +01:00
Rasmus Wriedt Larsen
247fd4f5f3
Python: Make encoding/decoding preserve taint automatically
...
With the way we have set things up, there is no way to opt out of this behavior.
2020-11-02 14:53:30 +01:00
Mathias Vorreiter Pedersen
45b24a9bc8
Python: Update inline-expectation tests
2020-10-30 16:53:33 +01:00
Rasmus Wriedt Larsen
5874a7b422
Merge pull request #4488 from yoff/SharedDataflow_ArgumentPassingTests
...
Python: Shared dataflow, argument passing tests
2020-10-21 12:01:37 +02:00
Rasmus Lerchedahl Petersen
9ee5a01d7e
Python: Reword comment on isBarrierIn
2020-10-21 10:30:40 +02:00
yoff
17155b64f5
Merge pull request #4514 from tausbn/python-add-module-boundary-flow-steps
...
Python: Add module boundary flow steps
2020-10-20 14:36:10 +02:00
Taus Brock-Nannestad
a21c29507c
Python: Fix false negative
...
I'm slightly suspicious of this fix -- it seems to work, but it makes
me wonder if we're potentially missing other kinds of flow, by not
handling other kinds of definitions.
Also, I feel like this should really be attached to an appropriate
post-update node of the given argument. As it is written now, the flow
will go from the argument _before_ the call, which obviously misses a
step if the argument is modified by the call. In practice, I would
expect this to be rather rare.
2020-10-20 13:16:54 +02:00
Taus Brock-Nannestad
860cafed4d
Python: Mark failing test as false negative
2020-10-20 13:11:06 +02:00
Rasmus Wriedt Larsen
045a6c3cb5
Python: Add test for tricky module member for type-tracking
...
Local testing shows that the `getDefinition` result for this is a `SSA filter definition`,
and not an `AssignmentDefinition`.
2020-10-20 12:20:35 +02:00
Taus Brock-Nannestad
7755993dd3
Python: Add jump steps for module attribute reads.
...
This is the quick-and-dirty solution, as discussed.
An even quicker-and-dirtier solution would have used
`ModuleValue::attr` and take the `getOrigin` of that as the source of
the jump step. However, this turns out to be a bad choice, since
`attr` might fail to have a value for the given attribute (for a
variety of reasons). Thus, we instead appeal to a helper predicate
that keeps track of which names are defined by which right-hand-sides
in a given module. (Observe that type tracking works correctly for `x`
in `mymodule.py`, even though `x` is never assigned a value in the
eyes of the Value API.)
This means that points-to is only used to actually figure out if the
object we're looking an attribute up on is a module or not. This is
the next thing to replace in order to eliminate the dependence on
points-to, but this will require some care to ensure that all module
lookups are handled correctly.
Only two test files needed to be changed for the tests to pass. The
first was the fixed false negative in the type tracker, and the other
was a bunch of missing flow in the regression test. I have manually
removed the `# Flow not found` annotations to make them consistent
with the output. Pay particular attention to the annotation on line
117 -- I believe it was misplaced and should have been on line 106
instead (where, indeed, we now have flow where none appeared before).
2020-10-19 19:13:32 +02:00
Taus Brock-Nannestad
60fcb5e7d5
Python: Add PEP-328 test example
...
Based on https://www.python.org/dev/peps/pep-0328/#guido-s-decision
Original "code" is in the Public Domain.
2020-10-16 12:03:43 +02:00