Commit Graph

19087 Commits

Author SHA1 Message Date
James Fletcher
b05cc2eafd Merge pull request #4475 from github/banner-template
[CodeQL docs] Update footer in Sphinx template
2020-10-15 14:39:52 +01:00
James Fletcher
fb05f02489 Apply suggestions from code review
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2020-10-15 14:24:28 +01:00
CodeQL CI
ab7d28b3fb Merge pull request #4482 from RasmusWL/promote-script
Approved by tausbn
2020-10-15 06:15:55 -07:00
Jonathan Leitschuh
a9c5551284 Fix formatting in Lang.qll 2020-10-15 08:52:02 -04:00
Erik Krogh Kristensen
ff054b985b add change note 2020-10-15 14:51:02 +02:00
Erik Krogh Kristensen
8206933e85 add test for home grown CSRF protection 2020-10-15 14:51:02 +02:00
Erik Krogh Kristensen
4d1a9740f0 add support for home made CSRF protection middlewares in js/missing-token-validation 2020-10-15 14:50:59 +02:00
Geoffrey White
1b8d14077a Merge pull request #4481 from rvermeulen/patch-1
C++: Fix qldoc for getIncludeText
2020-10-15 13:00:33 +01:00
Erik Krogh Kristensen
1d2ca42d49 update expected output 2020-10-15 13:42:13 +02:00
Erik Krogh Kristensen
d629eea54e aggregate the arguments of a call into a synthetic node 2020-10-15 13:35:19 +02:00
Erik Krogh Kristensen
5770d0256f fixing printing of NameConstants 2020-10-15 13:32:22 +02:00
Rasmus Wriedt Larsen
43cee8567c Python: Add script to promote experimental security queries 2020-10-15 13:25:01 +02:00
Erik Krogh Kristensen
2a5dd2c8a3 fix pretty-printing of number literals 2020-10-15 13:04:52 +02:00
Rasmus Lerchedahl Petersen
cc7d32c27c Merge branch 'python-port-unsafe-deserialization' of github.com:yoff/codeql into python-port-unsafe-deserialization 2020-10-15 13:01:38 +02:00
Erik Krogh Kristensen
1d4a605517 remove location for synthetic nodes 2020-10-15 12:57:46 +02:00
Erik Krogh Kristensen
9da8c23717 change the order of the children from FunctionDef 2020-10-15 12:57:17 +02:00
Rasmus Lerchedahl Petersen
172e058438 Python: unsafe -> mayExecuteInput 2020-10-15 12:56:29 +02:00
Rasmus Lerchedahl Petersen
00566f0eee Python: Extend DataFlow::CfgNode when appropriate 2020-10-15 12:40:16 +02:00
yoff
c36ad7dd9b Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
2020-10-15 12:35:21 +02:00
Tamás Vajk
e62c9b1382 Merge pull request #4472 from tamasvajk/feature/cleanup-3
C#: Change public fields to properties
2020-10-15 12:16:53 +02:00
Erik Krogh Kristensen
11ee7c7946 update expected output 2020-10-15 12:06:17 +02:00
Erik Krogh Kristensen
f9f29f53cf remove locations where we have no exact location 2020-10-15 11:59:51 +02:00
Tom Hvitved
36f6e97cad Merge pull request #4371 from hvitved/csharp/library-flow-refactor
C#: Reimplement flow-summary compilation
2020-10-15 11:56:32 +02:00
Erik Krogh Kristensen
2bb8b78a29 remove "</>" from the end when printing HTML 2020-10-15 11:56:00 +02:00
Remco Vermeulen
7848c5f54d Fix qldoc for getIncludeText
The '<' was HTML encoded for some reason.
2020-10-15 11:49:18 +02:00
Erik Krogh Kristensen
a019312953 improve printing of JS object literals 2020-10-15 11:47:45 +02:00
Rasmus Lerchedahl Petersen
9c8e968cba Python: Fix bad merge 2020-10-15 11:47:34 +02:00
Erik Krogh Kristensen
ab7542c0d2 improve printing of JSON values 2020-10-15 11:05:22 +02:00
Taus
c8b93148a2 Merge pull request #4424 from RasmusWL/python-model-python2-specific-command-execution
Python: model Python 2 specific command execution
2020-10-15 10:52:43 +02:00
Erik Krogh Kristensen
1ebd49b0eb remove location from "mapping i" print node 2020-10-15 10:51:34 +02:00
Erik Krogh Kristensen
3e2d266343 improve YAMLMapping printing 2020-10-15 10:49:37 +02:00
Anders Schack-Mulligen
60ce02ac18 Merge pull request #4469 from JLLeitschuh/additional-file-taint
Java: Track taint through java.io.File::toPath & java.nio.file.Path::toFile
2020-10-15 10:46:35 +02:00
Erik Krogh Kristensen
1b908ce030 improve printing of DeclStmt, and remove escaped whitespace chars from printed output 2020-10-15 10:43:32 +02:00
Tom Hvitved
8728017328 C#: Increase fieldFlowBranchLimit in test
68014fd3bf means that more accessors are properly
extracted, and consequently the calls to `get_Item` in the test have more dispatch
targets. Increasing `fieldFlowBranchLimit` makes the test pass again.
2020-10-15 10:40:19 +02:00
Rasmus Wriedt Larsen
c5810d623b Merge pull request #4474 from tausbn/python-fix-tostring-divergence
Python: Fix divergence in tuple/subscripted type `toString`
2020-10-15 10:29:33 +02:00
Erik Krogh Kristensen
c033ae9b7f add one more case to getAPrimaryQlClass 2020-10-15 10:05:07 +02:00
Arthur Baars
a10c0138e9 Merge commit '78c58c24158e3ee4fd78318194d56591af90da69' into lgtm.com 2020-10-15 10:00:43 +02:00
Rasmus Wriedt Larsen
ce967e1249 Merge branch 'main' into python-model-python2-specific-command-execution 2020-10-15 10:00:02 +02:00
Erik Krogh Kristensen
ab10c28cc4 change the default sorting order for print children to be location based 2020-10-15 09:53:52 +02:00
Rasmus Lerchedahl Petersen
0766eef49b Merge branch 'main' of github.com:github/codeql into SharedDataflow_ArgumentPassing 2020-10-15 09:49:21 +02:00
Erik Krogh Kristensen
74243d39aa remove location for arguments/parameters print node 2020-10-15 09:48:55 +02:00
Robert Marsh
fade75b0fb C++: add operator-- tests for insert iterators 2020-10-14 15:54:34 -07:00
Dave Bartolomeo
dfb687fd47 C++: Add ability to dump local dataflow info in IR dumps
This change adds a new module, `PrintIRLocalFlow.qll`, which can be imported into any query that uses both `PrintIR.qll` and the IR dataflow library. The IR dump printed by `PrintIR.qll` will be annotated with information about how each operand and instruction participates in dataflow.

For each operand and instruction, the following propeties are displayed:
- `flow`: Which local operands/instructions have flow to this node, and which local operands/instruction this node has flow to.
- `source`: `true` if this node is a source
- `sink`: `true` if this node is a sink
- `barrier`: Lists which kinds of barrier this node is. Can be zero or more of `full`, `in`, `out`, and `guard`. If the node is a guard barrier, the IR of the guarding instruction is also printed.

We already had a way to print additional properties for instructions and blocks, but not for operands. I added support for operand properties to `IRPropertyProvider`. These are now printed in a curly-brace-enclosed list immediately after the corresponding operand.

When printing flow, instructions are identified by their result ID (e.g., `m128`). Operands are identified by both the result ID of their instruction and their kind (e.g., `r145.left`). For flow from an operand to its use instruction, it just prints `result` at the operand, and prints only the operand kind on the instruction.

Example output:
```
#  344|     m344_34(vector<int, allocator<int>>)                                               = Chi                             : total:m344_20{flow:def->@, @->result}, partial:m344_33{flow:def->@, @->result}
#  344|         flow = total->@, partial->@, +m344_33->@, @->+r347_3, @->v347_7.side_effect, @->m347_9.total, @->m344_20.1
```
The `+` annotations indicate when the flow came from `isAdditionalFlowStep()`, rather than built-in local flow.
2020-10-14 18:09:54 -04:00
Dave Bartolomeo
794a6729bc C++: Add ability to dump local dataflow info in IR dumps
This change adds a new module, `PrintIRLocalFlow.qll`, which can be imported into any query that uses both `PrintIR.qll` and the IR dataflow library. The IR dump printed by `PrintIR.qll` will be annotated with information about how each operand and instruction participates in dataflow.

For each operand and instruction, the following propeties are displayed:
- `flow`: Which local operands/instructions have flow to this node, and which local operands/instruction this node has flow to.
- `source`: `true` if this node is a source
- `sink`: `true` if this node is a sink
- `barrier`: Lists which kinds of barrier this node is. Can be zero or more of `full`, `in`, `out`, and `guard`. If the node is a guard barrier, the IR of the guarding instruction is also printed.

We already had a way to print additional properties for instructions and blocks, but not for operands. I added support for operand properties to `IRPropertyProvider`. These are now printed in a curly-brace-enclosed list immediately after the corresponding operand.

When printing flow, instructions are identified by their result ID (e.g., `m128`). Operands are identified by both the result ID of their instruction and their kind (e.g., `r145.left`). For flow from an operand to its use instruction, it just prints `result` at the operand, and prints only the operand kind on the instruction.

Example output:
```
#  344|     m344_34(vector<int, allocator<int>>)                                               = Chi                             : total:m344_20{flow:def->@, @->result}, partial:m344_33{flow:def->@, @->result}
#  344|         flow = total->@, partial->@, +m344_33->@, @->+r347_3, @->v347_7.side_effect, @->m347_9.total, @->m344_20.1
```
The `+` annotations indicate when the flow came from `isAdditionalFlowStep()`, rather than built-in local flow.
2020-10-14 18:02:45 -04:00
Robert Marsh
126615a7ee C++: add prefix operator++ in inserter tests 2020-10-14 13:33:50 -07:00
Robert Marsh
fbe9bc8587 C++: add comments in new iterator models 2020-10-14 13:13:16 -07:00
Robert Marsh
a1a441d759 C++: output iterator flow through operator= models 2020-10-14 13:06:11 -07:00
Robert Marsh
f3843b8a40 Revert "C++: output iterator flow with user-defined operators"
This reverts commit 28fa26629c.
2020-10-14 13:01:37 -07:00
james
98d8ec488e add banner to sphinx template 2020-10-14 20:09:19 +01:00
Geoffrey White
09d4b3eb6d Merge branch 'main' into callderef 2020-10-14 17:41:14 +01:00