Skip to content

Commit d7c08f7

Browse files
committed
Merge branch 'master' of github.com:github/codeql into SharedDataflow_Classes
2 parents d32e277 + 63115a3 commit d7c08f7

File tree

137 files changed

+4006
-1922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+4006
-1922
lines changed

.codeqlmanifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{ "provide": [ "*/ql/src/qlpack.yml",
22
"*/ql/test/qlpack.yml",
3+
"*/ql/examples/qlpack.yml",
34
"*/upgrades/qlpack.yml",
45
"misc/legacy-support/*/qlpack.yml",
56
"misc/suite-helpers/qlpack.yml" ] }

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"omnisharp.autoStart": false
3+
}

change-notes/1.25/analysis-csharp.md

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,51 @@ The following changes in version 1.25 affect C# analysis in all applications.
2828
such as `A<int>.B`, no longer are considered unbound generics. (Such nested types do,
2929
however, still have relevant `.getSourceDeclaration()`s, for example `A<>.B`.)
3030
* The data-flow library has been improved, which affects most security queries by potentially
31-
adding more results. Flow through methods now takes nested field reads/writes into account.
32-
For example, the library is able to track flow from `"taint"` to `Sink()` via the method
33-
`GetF2F1()` in
34-
```csharp
35-
class C1
36-
{
37-
string F1;
38-
}
39-
40-
class C2
41-
{
42-
C1 F2;
43-
44-
string GetF2F1() => F2.F1; // Nested field read
45-
46-
void M()
47-
{
48-
F2 = new C1() { F1 = "taint" };
49-
Sink(GetF2F1()); // NEW: "taint" reaches here
50-
}
51-
}
52-
```
31+
adding more results:
32+
- Flow through methods now takes nested field reads/writes into account.
33+
For example, the library is able to track flow from `"taint"` to `Sink()` via the method
34+
`GetF2F1()` in
35+
```csharp
36+
class C1
37+
{
38+
string F1;
39+
}
40+
41+
class C2
42+
{
43+
C1 F2;
44+
45+
string GetF2F1() => F2.F1; // Nested field read
46+
47+
void M()
48+
{
49+
F2 = new C1() { F1 = "taint" };
50+
Sink(GetF2F1()); // NEW: "taint" reaches here
51+
}
52+
}
53+
```
54+
- Flow through collections is now modeled precisely. For example, instead of modeling an array
55+
store `a[i] = x` as a taint-step from `x` to `a`, we now model it as a data-flow step that
56+
stores `x` into `a`. To get the value back out, a matching read step must be taken.
57+
58+
For source-code based data-flow analysis, the following constructs are modeled as stores into
59+
collections:
60+
- Direct array assignments, `a[i] = x`.
61+
- Array initializers, `new [] { x }`.
62+
- C# 6-style array initializers, `new C() { Array = { [i] = x } }`.
63+
- Call arguments that match a `params` parameter, where the C# compiler creates an array under-the-hood.
64+
- `yield return` statements.
65+
66+
The following source-code constructs read from a collection:
67+
- Direct array reads, `a[i]`.
68+
- `foreach` statements.
69+
70+
For calls out to library code, existing flow summaries have been refined to precisely
71+
capture how they interact with collection contents. For example, a call to
72+
`System.Collections.Generic.List<T>.Add(T)` stores the value of the argument into the
73+
qualifier, and a call to `System.Collections.Generic.List<T>.get_Item(int)` (that is, an
74+
indexer call) reads contents out of the qualifier. Moreover, the effect of
75+
collection-clearing methods such as `System.Collections.Generic.List<T>.Clear()` is now
76+
also modeled.
5377

5478
## Changes to autobuilder

change-notes/1.25/analysis-javascript.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
- [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
77
- [bluebird](http://bluebirdjs.com/)
88
- [express](https://www.npmjs.com/package/express)
9+
- [execa](https://www.npmjs.com/package/execa)
910
- [fancy-log](https://www.npmjs.com/package/fancy-log)
1011
- [fastify](https://www.npmjs.com/package/fastify)
12+
- [foreground-child](https://www.npmjs.com/package/foreground-child)
1113
- [fstream](https://www.npmjs.com/package/fstream)
1214
- [jGrowl](https://github.com/stanlemon/jGrowl)
1315
- [jQuery](https://jquery.com/)
@@ -17,6 +19,7 @@
1719
- [mssql](https://www.npmjs.com/package/mssql)
1820
- [mysql](https://www.npmjs.com/package/mysql)
1921
- [npmlog](https://www.npmjs.com/package/npmlog)
22+
- [opener](https://www.npmjs.com/package/opener)
2023
- [pg](https://www.npmjs.com/package/pg)
2124
- [sequelize](https://www.npmjs.com/package/sequelize)
2225
- [spanner](https://www.npmjs.com/package/spanner)

cpp/ql/examples/qlpack.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: codeql-cpp-examples
2+
version: 0.0.0
3+
libraryPathDependencies: codeql-cpp

cpp/ql/src/codeql-suites/cpp-lgtm-full.qls

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,10 @@
99
tags contain:
1010
- ide-contextual-queries/local-definitions
1111
- ide-contextual-queries/local-references
12+
- query: Metrics/Dependencies/ExternalDependencies.ql
13+
- query: Metrics/Dependencies/ExternalDependenciesSourceLinks.ql
14+
- query: Metrics/Files/FLinesOfCode.ql
15+
- query: Metrics/Files/FLinesOfCommentedOutCode.ql
16+
- query: Metrics/Files/FLinesOfComments.ql
17+
- query: Metrics/Files/FLinesOfDuplicatedCode.ql
18+
- query: Metrics/Files/FNumberOfTests.ql

cpp/ql/src/semmle/code/cpp/Variable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ class TemplateVariable extends Variable {
582582
* float a;
583583
* }
584584
*
585-
* template<type T>
585+
* template<typename T>
586586
* void myTemplateFunction() {
587587
* T b;
588588
* }

csharp/.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"github.vscode-codeql",
4+
"ms-dotnettools.csharp",
5+
"formulahendry.dotnet-test-explorer",
6+
"hbenl.vscode-test-explorer"
7+
],
8+
"unwantedRecommendations": []
9+
}

csharp/.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"dotnet-test-explorer.enableTelemetry": false,
3+
"dotnet-test-explorer.testProjectPath": "**/*Tests.@(csproj|vbproj|fsproj)",
4+
"dotnet-test-explorer.testArguments": "/property:GenerateTargetFrameworkAttribute=false",
5+
"csharp.supressBuildAssetsNotification": true,
6+
"csharp.suppressDotnetRestoreNotification": true
7+
}

csharp/.vscode/tasks.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "dotnet build",
6+
"command": "dotnet",
7+
"type": "shell",
8+
"args": [
9+
"build",
10+
// Ask dotnet build to generate full paths for file names.
11+
"/property:GenerateFullPaths=true",
12+
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
13+
"/consoleloggerparameters:NoSummary"
14+
],
15+
"group": "build",
16+
"presentation": {
17+
"reveal": "always"
18+
},
19+
"problemMatcher": "$msCompile"
20+
},
21+
{
22+
"label": "dotnet rebuild",
23+
"command": "dotnet",
24+
"type": "shell",
25+
"args": [
26+
"build",
27+
"--no-incremental",
28+
"/property:GenerateFullPaths=true",
29+
"/consoleloggerparameters:NoSummary"
30+
],
31+
"group": "build",
32+
"presentation": {
33+
"reveal": "always"
34+
},
35+
"problemMatcher": "$msCompile"
36+
},
37+
{
38+
"label": "dotnet test",
39+
"command": "dotnet",
40+
"type": "shell",
41+
"args": [
42+
"test",
43+
"/property:GenerateFullPaths=true",
44+
"/consoleloggerparameters:NoSummary"
45+
],
46+
"group": "test",
47+
"presentation": {
48+
"reveal": "always"
49+
},
50+
"problemMatcher": "$msCompile"
51+
}
52+
]
53+
}

0 commit comments

Comments
 (0)