Skip to content

Commit 1399610

Browse files
authored
Merge branch 'main' into encoding
2 parents 7be106d + ed0325f commit 1399610

File tree

20 files changed

+694
-486
lines changed

20 files changed

+694
-486
lines changed

cpp/ql/src/Security/CWE/CWE-078/ExecTainted.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class ExecState extends DataFlow::FlowState {
7777
ExecState() {
7878
this =
7979
"ExecState (" + fst.getLocation() + " | " + fst + ", " + snd.getLocation() + " | " + snd + ")" and
80-
interestingConcatenation(fst, snd)
80+
interestingConcatenation(pragma[only_bind_into](fst), pragma[only_bind_into](snd))
8181
}
8282

8383
DataFlow::Node getFstNode() { result = fst }

csharp/tools/tracing-config.lua

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,75 @@ function RegisterExtractorPack(id)
22
local extractor = GetPlatformToolsDirectory() ..
33
'Semmle.Extraction.CSharp.Driver'
44
if OperatingSystem == 'windows' then extractor = extractor .. '.exe' end
5+
6+
function DotnetMatcherBuild(compilerName, compilerPath, compilerArguments,
7+
_languageId)
8+
if compilerName ~= 'dotnet' and compilerName ~= 'dotnet.exe' then
9+
return nil
10+
end
11+
12+
-- The dotnet CLI has the following usage instructions:
13+
-- dotnet [sdk-options] [command] [command-options] [arguments]
14+
-- we are interested in dotnet build, which has the following usage instructions:
15+
-- dotnet [options] build [<PROJECT | SOLUTION>...]
16+
-- For now, parse the command line as follows:
17+
-- Everything that starts with `-` (or `/`) will be ignored.
18+
-- The first non-option argument is treated as the command.
19+
-- if that's `build`, we append `/p:UseSharedCompilation=false` to the command line,
20+
-- otherwise we do nothing.
21+
local match = false
22+
local argv = compilerArguments.argv
23+
if OperatingSystem == 'windows' then
24+
-- let's hope that this split matches the escaping rules `dotnet` applies to command line arguments
25+
-- or, at least, that it is close enough
26+
argv =
27+
NativeArgumentsToArgv(compilerArguments.nativeArgumentPointer)
28+
end
29+
for i, arg in ipairs(argv) do
30+
-- dotnet options start with either - or / (both are legal)
31+
local firstCharacter = string.sub(arg, 1, 1)
32+
if not (firstCharacter == '-') and not (firstCharacter == '/') then
33+
Log(1, 'Dotnet subcommand detected: %s', arg)
34+
if arg == 'build' then match = true end
35+
break
36+
end
37+
end
38+
if match then
39+
return {
40+
order = ORDER_REPLACE,
41+
invocation = BuildExtractorInvocation(id, compilerPath,
42+
compilerPath,
43+
compilerArguments, nil, {
44+
'/p:UseSharedCompilation=false'
45+
})
46+
}
47+
end
48+
return nil
49+
end
50+
551
local windowsMatchers = {
52+
DotnetMatcherBuild,
653
CreatePatternMatcher({'^dotnet%.exe$'}, MatchCompilerName, extractor, {
754
prepend = {'--dotnetexec', '--cil'},
855
order = ORDER_BEFORE
956
}),
1057
CreatePatternMatcher({'^csc.*%.exe$'}, MatchCompilerName, extractor, {
1158
prepend = {'--compiler', '"${compiler}"', '--cil'},
1259
order = ORDER_BEFORE
13-
1460
}),
1561
CreatePatternMatcher({'^fakes.*%.exe$', 'moles.*%.exe'},
1662
MatchCompilerName, nil, {trace = false})
1763
}
1864
local posixMatchers = {
19-
CreatePatternMatcher({'^mcs%.exe$', '^csc%.exe$'}, MatchCompilerName,
65+
DotnetMatcherBuild,
66+
CreatePatternMatcher({'^mono', '^dotnet$'}, MatchCompilerName,
2067
extractor, {
21-
prepend = {'--compiler', '"${compiler}"', '--cil'},
68+
prepend = {'--dotnetexec', '--cil'},
2269
order = ORDER_BEFORE
23-
2470
}),
25-
CreatePatternMatcher({'^mono', '^dotnet$'}, MatchCompilerName,
71+
CreatePatternMatcher({'^mcs%.exe$', '^csc%.exe$'}, MatchCompilerName,
2672
extractor, {
27-
prepend = {'--dotnetexec', '--cil'},
73+
prepend = {'--compiler', '"${compiler}"', '--cil'},
2874
order = ORDER_BEFORE
2975
}), function(compilerName, compilerPath, compilerArguments, _languageId)
3076
if MatchCompilerName('^msbuild$', compilerName, compilerPath,
@@ -49,7 +95,6 @@ function RegisterExtractorPack(id)
4995
else
5096
return posixMatchers
5197
end
52-
5398
end
5499

55100
-- Return a list of minimum supported versions of the configuration file format

docs/codeql/codeql-overview/supported-languages-and-frameworks.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ CodeQL.
1111
Languages and compilers
1212
#######################
1313

14-
CodeQL supports the following languages and compilers.
14+
The current versions of the CodeQL CLI (`changelog <https://github.com/github/codeql-cli-binaries/blob/main/CHANGELOG.md>`__, `releases <https://github.com/github/codeql-cli-binaries/releases>`__),
15+
CodeQL library packs (`source <https://github.com/github/codeql/tree/codeql-cli/latest>`__),
16+
and CodeQL bundle (`releases <https://github.com/github/codeql-action/releases>`__)
17+
support the following languages and compilers.
1518

1619
.. include:: ../support/reusables/versions-compilers.rst
1720

1821
Frameworks and libraries
1922
########################
2023

21-
The libraries and queries in the current version of CodeQL have been explicitly checked against the libraries and frameworks listed below.
24+
The current versions of the CodeQL library and query packs (`source <https://github.com/github/codeql/tree/codeql-cli/latest>`__) have been explicitly checked against the libraries and frameworks listed below.
2225

2326
.. pull-quote::
2427

docs/codeql/support/reusables/frameworks.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
C and C++ built-in support
22
================================
33

4+
Provided by the current versions of the
5+
CodeQL query pack ``codeql/cpp-queries`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/cpp/ql/src/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/cpp/ql/src>`__)
6+
and the CodeQL library pack ``codeql/cpp-all`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/cpp/ql/lib/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/cpp/ql/lib>`__).
7+
48
.. csv-table::
59
:header-rows: 1
610
:class: fullWidthTable
@@ -14,6 +18,10 @@ C and C++ built-in support
1418
C# built-in support
1519
================================
1620

21+
Provided by the current versions of the
22+
CodeQL query pack ``codeql/csharp-queries`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/csharp/ql/src/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/csharp/ql/src>`__)
23+
and the CodeQL library pack ``codeql/csharp-all`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/csharp/ql/lib/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/csharp/ql/lib>`__).
24+
1725
.. csv-table::
1826
:header-rows: 1
1927
:class: fullWidthTable
@@ -33,6 +41,10 @@ C# built-in support
3341
Go built-in support
3442
================================
3543

44+
Provided by the current versions of the
45+
CodeQL query pack ``codeql/go-queries`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/go/ql/src/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/go/ql/src>`__)
46+
and the CodeQL library pack ``codeql/go-all`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/go/ql/lib/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/go/ql/lib>`__).
47+
3648
.. csv-table::
3749
:header-rows: 1
3850
:class: fullWidthTable
@@ -84,6 +96,10 @@ Go built-in support
8496
Java built-in support
8597
==================================
8698

99+
Provided by the current versions of the
100+
CodeQL query pack ``codeql/java-queries`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/java/ql/src/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/java/ql/src>`__)
101+
and the CodeQL library pack ``codeql/java-all`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/java/ql/lib/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/java/ql/lib>`__).
102+
87103
.. csv-table::
88104
:header-rows: 1
89105
:class: fullWidthTable
@@ -113,6 +129,10 @@ Java built-in support
113129
JavaScript and TypeScript built-in support
114130
=======================================================
115131

132+
Provided by the current versions of the
133+
CodeQL query pack ``codeql/javascript-queries`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/javascript/ql/src/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/javascript/ql/src>`__)
134+
and the CodeQL library pack ``codeql/javascript-all`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/javascript/ql/lib/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/javascript/ql/lib>`__).
135+
116136
.. csv-table::
117137
:header-rows: 1
118138
:class: fullWidthTable
@@ -156,6 +176,10 @@ JavaScript and TypeScript built-in support
156176
Python built-in support
157177
====================================
158178

179+
Provided by the current versions of the
180+
CodeQL query pack ``codeql/python-queries`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/python/ql/src/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/python/ql/src>`__)
181+
and the CodeQL library pack ``codeql/python-all`` (`changelog <https://github.com/github/codeql/tree/codeql-cli/latest/python/ql/lib/CHANGELOG.md>`__, `source <https://github.com/github/codeql/tree/codeql-cli/latest/python/ql/lib>`__).
182+
159183
.. csv-table::
160184
:header-rows: 1
161185
:class: fullWidthTable

ruby/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby/extractor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ flate2 = "1.0"
1111
node-types = { path = "../node-types" }
1212
tree-sitter = "0.19"
1313
tree-sitter-embedded-template = { git = "https://github.com/tree-sitter/tree-sitter-embedded-template.git", rev = "1a538da253d73f896b9f6c0c7d79cda58791ac5c" }
14-
tree-sitter-ruby = { git = "https://github.com/tree-sitter/tree-sitter-ruby.git", rev = "5b305c3cd32db10494cedd2743de6bbe32f1a573" }
14+
tree-sitter-ruby = { git = "https://github.com/tree-sitter/tree-sitter-ruby.git", rev = "e75d04404c9dd71ad68850d5c672b226d5e694f3" }
1515
clap = "3.0"
1616
tracing = "0.1"
1717
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }

0 commit comments

Comments
 (0)