Commit Graph

19087 Commits

Author SHA1 Message Date
Robert Marsh
28fa26629c C++: output iterator flow with user-defined operators 2020-10-13 16:30:47 -07:00
Robert Marsh
6552499545 C++: add model for iter-returning functions 2020-10-13 16:19:15 -07:00
Robert Marsh
4b6ecfb0b1 C++: remove some constexprs in qltest 2020-10-13 16:19:15 -07:00
Robert Marsh
45a27d3296 C++: add tests for back_inserter iterator flow 2020-10-13 16:19:15 -07:00
Robert Marsh
108cc9ea47 C++: fix assignment to *iter++ 2020-10-13 16:19:15 -07:00
Robert Marsh
f39195e339 C++: add tests for assignments to *iter++ 2020-10-13 16:19:15 -07:00
Ian Lynagh
9238503bc3 C++: Make unnamed parameters follow the "(unnamed ...)" naming 2020-10-14 00:10:56 +01:00
Ian Lynagh
7680080701 C++: Accept unnamed-function changes to tests 2020-10-13 23:52:33 +01:00
Taus Brock-Nannestad
7d86b53b71 Python: Fix unwanted module type tracking 2020-10-13 22:47:57 +02:00
Taus Brock-Nannestad
76e5b59dab Python: Add test case for unwanted module type tracking 2020-10-13 22:47:03 +02:00
Robert Marsh
b49aa677d0 Merge pull request #4459 from geoffw0/setex
C++: Additional taint flows through std::set
2020-10-13 15:17:54 -04:00
yoff
1f2390455c Update python/ql/src/experimental/dataflow/internal/DataFlowPrivate.qll
Co-authored-by: Taus <tausbn@github.com>
2020-10-13 19:15:33 +02:00
Rasmus Lerchedahl Petersen
5d66c485d5 Python: IPA type for arguemnt mappings
Not sure how arg2 in line 118 is achieved
2020-10-13 19:12:52 +02:00
Dave Bartolomeo
fba4313457 Merge remote-tracking branch 'upstream/main' into work 2020-10-13 13:07:28 -04:00
Dave Bartolomeo
93f5ae4763 Clean up test formatting and accept new lines in results 2020-10-13 12:57:52 -04:00
Taus
83937bacae Merge pull request #4448 from RasmusWL/python-simplify-import-modeling
Python: simplify import modeling
2020-10-13 18:08:07 +02:00
Dave Bartolomeo
dfe69d8ada Update taint test to propagate through string constructor 2020-10-13 12:06:34 -04:00
Rasmus Wriedt Larsen
2c5996f694 Python: Refactor subprocess_attr type-tracker
Co-authored-by: Taus <tausbn@github.com>
2020-10-13 17:21:21 +02:00
Taus Brock-Nannestad
fdb489fc93 Python: Remove flow between ESSA variables
This required a minor change in the type tracker implementation, but
apart from that no other changes appear to be needed. Seems to clean
up the test output quite a bit.
2020-10-13 16:35:41 +02:00
yoff
05b744701e Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2020-10-13 15:31:50 +02:00
Rasmus Wriedt Larsen
b895641a83 Merge pull request #4464 from tausbn/python-remove-dataflowcfgnode
Python: Get rid of `DataFlowCfgNode`
2020-10-13 15:08:28 +02:00
Rasmus Wriedt Larsen
76c9b8c49f Python: Expose importNode instead of importModule/importMember
Since predicate name `import` is not allowed, I adopted `importNode` as it sort
of matches what `exprNode` does.

---

Due to only using `importMember` in `os_attr` we previously didn't handle
`import os.path as alias` :|

I did creat a hotfix for this (https://github.com/github/codeql/pull/4446), but
in doing so I realized the core of the problem: We're exposing ourselves to
making these kinds of mistakes by having BOTH importModule and importMember, and
we don't really gain anything from doing this!

We do loose the ability to easily only modeling `from mod import val` and not
`import mod.val`, but I don't think that will ever be relevant.

This change will also make us to recognize some invalid code, for example in

    import os.system as runtime_error

we would now model that `runtime_error` is a reference to the `os.system`
function (although the actual import would result in a runtime error).

Overall these are tradeoffs I'm willing to make, as it does makes things simpler
from a QL modeling point of view, and THAT sounds nice 👍
2020-10-13 15:03:22 +02:00
Tamas Vajk
ce9624e61d C#: Remove unneeded vscode settings from settings.json 2020-10-13 14:50:46 +02:00
Rasmus Wriedt Larsen
4bfd55f1af Python: Show problem with os.path modeling
This is not a very good test for showing that we don't handle direct imports,
but it was the best I had available without inventing something new. It's very
fragile, since any of these would propagate taint (due to handling all `join`
calls as if the qualifier was a string):

    ospath_alias.join(ts)
    ospath_alias.join(ts, "foo", "bar")

But this test DOES serve the purpose of illustrating that my fix works :D
2020-10-13 14:50:00 +02:00
Tamas Vajk
ce793c357f C#: Adjust parameters of DefinitionField ctor 2020-10-13 14:45:38 +02:00
Tamas Vajk
ea53ea0994 C#: Prefer keywords over type names 2020-10-13 14:45:38 +02:00
Tamas Vajk
8afac25120 C#: Add params modifier on override 2020-10-13 14:45:38 +02:00
Tamas Vajk
63e173198d C#: Make static member on generic class private 2020-10-13 14:45:38 +02:00
Tamas Vajk
6cf20d569d C#: Remove overrides that do nothing 2020-10-13 14:45:38 +02:00
Tamas Vajk
9b349eb844 C#: Use Contains instead of IndexOf 2020-10-13 14:45:38 +02:00
Tamas Vajk
5b33f43b78 C#: Use nameof 2020-10-13 14:45:38 +02:00
Tamas Vajk
f84669904b C#: Fix typo 2020-10-13 14:45:38 +02:00
Tamas Vajk
7075c6f8ca C#: Fix public property naming 2020-10-13 14:45:38 +02:00
Tamas Vajk
a4fec39c11 C#: Move fields to locals where possible 2020-10-13 14:45:38 +02:00
Tamas Vajk
b07aceff6b C#: Fix exception throwing 2020-10-13 14:45:37 +02:00
Tamas Vajk
6dfe90e479 C#: Change array-returning properties 2020-10-13 14:45:37 +02:00
Tamas Vajk
7721c7bba7 C#: Remove redundant conditions 2020-10-13 14:45:37 +02:00
Tamas Vajk
cbdd13127e C#: Convert publicly visible fields to properties 2020-10-13 14:45:37 +02:00
Tamas Vajk
d5382f2cfd C#: Fix modifier orders 2020-10-13 14:45:37 +02:00
Tamas Vajk
fbc128fcc7 C#: Fix type parameter names 2020-10-13 14:45:37 +02:00
Tamas Vajk
2e350caf9f C#: Fix private field and local variable naming 2020-10-13 14:45:37 +02:00
Tamas Vajk
ecb29a267b C#: Add editor config naming rules 2020-10-13 14:45:37 +02:00
Tamas Vajk
baf6f59bfc C#: Add braces to multiline block statements 2020-10-13 14:45:37 +02:00
Tamas Vajk
28694513a1 C#: Use pattern matching 2020-10-13 14:45:37 +02:00
Tamas Vajk
155453d9cb C#: Format single line if statements 2020-10-13 14:45:37 +02:00
Tamas Vajk
aec4481cfb C#: Use var everywhere 2020-10-13 14:45:37 +02:00
Tamas Vajk
7d544e34af C#: Add declaration visibility modifiers 2020-10-13 14:45:37 +02:00
Tamas Vajk
466e0cf085 C#: Remove naming styles from editor config, add IDE diagnostic severities 2020-10-13 13:27:46 +02:00
Tamas Vajk
ec6ed90c49 C#: Add final new line to files 2020-10-13 13:27:46 +02:00
Tamas Vajk
2e21564032 C#: Fix formatting with 'dotnet format' 2020-10-13 13:27:46 +02:00