Anders Schack-Mulligen
cbcdf1f8b5
Python: Update expected output (interesting).
2024-04-12 09:20:33 +02:00
Anders Schack-Mulligen
bfcfedab8c
Python: Update expected output (uninteresting).
2024-04-12 09:20:30 +02:00
yoff
1048cf7c5e
Merge pull request #15711 from RasmusWL/tt-content
...
Python: Add type tracking for content
2024-04-09 10:37:43 +02:00
yoff
c520cb6d58
Merge branch 'main' into python/test-MaD-keyword-argument
2024-03-22 10:56:08 +01:00
Rasmus Lerchedahl Petersen
eef60c9ad2
python: add test for "ReturnValue.TupleElement[0,1]"
...
also synchronise files
2024-03-22 10:54:12 +01:00
yoff
ee411cc53a
Merge pull request #15936 from yoff/python/test-conflicting-summaries
...
Python: No `fieldFlowBranchLimit` for `SummarizedCallable`s
2024-03-19 16:56:56 +01:00
yoff
f025430431
Merge pull request #15319 from Sim4n6/main
...
[Python] Add Unicode DoS (qhelp, tests and the query)
2024-03-19 10:00:30 +01:00
Tom Hvitved
e53357d376
Update expected test output
2024-03-18 14:49:32 +01:00
Sim4n6
1af8167354
updated the .expected file
2024-03-18 13:26:20 +00:00
Tom Hvitved
a13391bda1
Merge pull request #15802 from hvitved/dataflow/variable-capture-overlapping-paths
...
Variable capture: Avoid overlapping and false-positive data flow paths
2024-03-18 10:45:55 +01:00
Rasmus Lerchedahl Petersen
2a0c451d2d
python: No fieldFlowBranchLimit for SummarizedCallables
...
Like https://github.com/github/codeql/pull/15689 for Ruby.
2024-03-18 10:29:36 +01:00
Rasmus Lerchedahl Petersen
45c65b48aa
python: make it a real package
...
so python2 also respects it
2024-03-18 08:49:31 +01:00
Rasmus Lerchedahl Petersen
cfbc3f73ec
Pyhton: add test for conflicting summaries
...
We noticed that when
- a function has more than one summary (with different charpred)
- one summary is subsumed by a subpath (or something happens around the function being extracted)
- the function is called multiple times(we needed at least three)
one of the summaries would no longer lead to flow.
2024-03-15 15:13:39 +01:00
Sim4n6
3acdd3382c
Update the expected file
2024-03-15 14:17:23 +01:00
Sim4n6
3d8868a6c3
Add routes for bad_5 and bad_6, and fix routes for good_3 and good_4
2024-03-15 14:17:23 +01:00
Sim4n6
342465057c
Add Unicode DoS (CWE-770)
2024-03-15 14:17:23 +01:00
Rasmus Wriedt Larsen
7eb4419342
Python: Restrict type-tracking content to only be precise
...
At least for now :)
2024-03-15 10:24:57 +01:00
Rasmus Wriedt Larsen
6babb2ff90
Python: Accept .expected for typetracking-summaries
2024-03-15 10:24:33 +01:00
Rasmus Wriedt Larsen
7a3ee0f5f8
Python: Make IterableSequenceNode LocalSourceNode
...
We do this to remove the inconsistencies, and to be ready for a future
where type-tracking support content tracker of depth > 1.
It works because targets of loadSteps needs to be LocalSourceNodes
predicate loadStep(Node nodeFrom, LocalSourceNode nodeTo, Content content) {
2024-03-14 10:46:29 +01:00
Rasmus Wriedt Larsen
6ffaad1bc8
Python: Expand type-tracking tests with nested tuples
...
I was initially surprised to see that this didn't work, until I
remembered that type-tracking only works with content of depth 1.
2024-03-14 10:44:25 +01:00
Rasmus Wriedt Larsen
7de304bf16
Python: Add proper type-tracking tests for content
...
Instead of just relying on the call-graph tests
2024-03-14 10:43:28 +01:00
Rasmus Wriedt Larsen
fa0c4e18fc
Python: Expand dict-content tt test even more
...
While it might be useful to track content to any lookup, it's not
something we do right now.
2024-03-14 10:43:28 +01:00
Rasmus Wriedt Larsen
4d78762ba8
Python: Ignore consistency failure
2024-03-14 10:43:28 +01:00
Rasmus Wriedt Larsen
8a7ffac19c
Python: Accept consistency failure
2024-03-14 10:43:28 +01:00
Rasmus Wriedt Larsen
92729dbbd6
Python: Support iterable unpacking in type-tracking
2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
0cf3fe4a4c
Python: Expand dict update tests
2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
dac2b57bb0
Python: type-track through dict-updates
2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
73fe596753
Python: type-tracking through dictionary construction
2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
ece8245a4b
Python: type-track through tuple content
2024-03-14 10:42:38 +01:00
Rasmus Wriedt Larsen
a95bb7c86b
Python: Expand function reference in content test
2024-03-14 10:42:38 +01:00
Rasmus Lerchedahl Petersen
533b63743b
Python: test MaD syntax for keyword argument
...
use the combined positional/keyword syntax as
that is what we will probably mostly use.
2024-03-13 15:28:34 +01:00
Rasmus Lerchedahl Petersen
6d8d106d91
Python: add test for ReturnValue.TupleElement[n]
2024-03-08 11:18:51 +01:00
Tom Hvitved
24e35f6f3d
Update expected test output
2024-03-08 10:00:43 +01:00
Rasmus Wriedt Larsen
16cb6c2044
Python: Fix validTest expectations
...
Co-authored-by: yoff <lerchedahl@gmail.com >
2024-03-04 11:41:47 +01:00
Rasmus Wriedt Larsen
eeda4355f1
Python: Fix missing DictionaryElementContent
2024-03-01 15:21:13 +01:00
Rasmus Wriedt Larsen
30b7fadbb8
Python: Add test
2024-03-01 15:19:56 +01:00
Rasmus Wriedt Larsen
cdf4dd16f0
Python: Fix module level flow for iterable unpacking
...
(and for * patterns in match)
Since `PhaseDependentFlow` uses the following predicate, that relies on
.getScope() to be present for there to be any importTimeFlow (flow at
toplevel scope), it's important that data-flow nodes implement `.getScope`.
```
private predicate isTopLevel(Node node) { node.getScope() instanceof Module }
```
By implementing getScope, we can now rely on default implementation of
`getEnclosingCallable` in DataFlow::Node:
```
/** Gets the enclosing callable of this node. */
DataFlowCallable getEnclosingCallable() { result = getCallableScope(this.getScope()) }
```
2024-02-28 16:39:08 +01:00
Rasmus Wriedt Larsen
e4699e092d
Python: Add test for iterable unpacking on module level
...
Currently doesn't work :O
2024-02-28 16:10:29 +01:00
Rasmus Wriedt Larsen
eb401a205d
Python: Fix test exclusion for stdlib Python 3.12
2024-02-14 16:53:19 +01:00
Rasmus Wriedt Larsen
59014787a1
Python: Fix DataflowQueryTest
...
You're only allowed to have `result=OK` if there is a sink on that line...
2024-02-14 15:44:40 +01:00
Rasmus Wriedt Larsen
cd596f5d05
Python: Reformat test-file
...
All those newlines are not good for inline expectations
2024-02-14 15:44:06 +01:00
Rasmus Wriedt Larsen
9ae3ea81ff
Python: Remove spurious results in stdlib
2024-02-14 14:47:28 +01:00
Rasmus Wriedt Larsen
ad39b8c68b
Python: Accept .expected changes
2024-02-14 14:46:33 +01:00
Rasmus Wriedt Larsen
9399258e3b
Merge branch 'main' into amammad-python-bombs
2024-02-14 13:37:59 +01:00
Anders Schack-Mulligen
088a0a54ba
Python: Add empty provenance column to expected files.
2024-02-09 11:32:08 +01:00
erik-krogh
8be7eadace
delete outdated deprecations
2024-01-22 09:11:35 +01:00
Rasmus Wriedt Larsen
95c24275f2
Merge pull request #15044 from RasmusWL/automated-subclass-models
...
Python: Automated subclass models
2024-01-05 10:43:48 +01:00
Rasmus Lerchedahl Petersen
da4aef80e9
Revert "Python: make it a real consistency check"
...
This reverts commit 45411f4a93 .
2023-12-20 16:15:17 +01:00
Rasmus Lerchedahl Petersen
d039ceb689
Python: add test for fields
2023-12-20 15:23:45 +01:00
Rasmus Lerchedahl Petersen
706e9dc896
Python: fix compilation
2023-12-20 15:23:33 +01:00