Skip to content

Commit 0df2b64

Browse files
Merge branch 'main' into Token_validation
2 parents 9e63a3d + e07e6c9 commit 0df2b64

File tree

639 files changed

+51636
-31154
lines changed

Some content is hidden

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

639 files changed

+51636
-31154
lines changed

.github/workflows/check-qldoc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ jobs:
2727
run: |
2828
EXIT_CODE=0
2929
# TODO: remove the swift exception from the regex when we fix generated QLdoc
30-
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!swift)[a-z]*/ql/lib' || true; } | sort -u)"
30+
# TODO: remove the shared exception from the regex when coverage of qlpacks without dbschemes is supported
31+
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!(swift|shared))[a-z]*/ql/lib' || true; } | sort -u)"
3132
for pack_dir in ${changed_lib_packs}; do
3233
lang="${pack_dir%/ql/lib}"
3334
codeql generate library-doc-coverage --output="${RUNNER_TEMP}/${lang}-current.txt" --dir="${pack_dir}"

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
# uses a compiled language
5757

5858
- run: |
59-
dotnet build csharp /p:UseSharedCompilation=false
59+
dotnet build csharp
6060
6161
- name: Perform CodeQL Analysis
6262
uses: github/codeql-action/analyze@main

.github/workflows/csv-coverage-metrics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
DATABASE="${{ runner.temp }}/csharp-database"
5656
PROJECT="${{ runner.temp }}/csharp-project"
5757
dotnet new classlib --language=C# --output="$PROJECT"
58-
codeql database create "$DATABASE" --language=csharp --source-root="$PROJECT" --command 'dotnet build /t:rebuild csharp-project.csproj /p:UseSharedCompilation=false'
58+
codeql database create "$DATABASE" --language=csharp --source-root="$PROJECT" --command 'dotnet build /t:rebuild csharp-project.csproj'
5959
- name: Capture coverage information
6060
run: |
6161
DATABASE="${{ runner.temp }}/csharp-database"

.github/workflows/ql-for-ql-build.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ on:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
paths:
9+
- "ql/**"
10+
- "**.qll"
11+
- "**.ql"
12+
- "**.dbscheme"
13+
- "**/qlpack.yml"
14+
- ".github/workflows/ql-for-ql-build.yml"
815

916
env:
1017
CARGO_TERM_COLOR: always
@@ -54,7 +61,7 @@ jobs:
5461
cp -r ${{ runner.temp }}/queries ${{ runner.temp }}/pack
5562
env:
5663
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
57-
64+
5865
### Build the extractor ###
5966
- name: Cache entire extractor
6067
if: steps.cache-pack.outputs.cache-hit != 'true'
@@ -108,22 +115,22 @@ jobs:
108115
### Run the analysis ###
109116
- name: Hack codeql-action options
110117
run: |
111-
JSON=$(jq -nc --arg pack "${PACK}" '.database."run-queries"=["--search-path", $pack] | .resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .database.init=["--search-path", $pack]')
118+
JSON=$(jq -nc --arg pack "${PACK}" '.database."run-queries"=["--search-path", $pack] | .resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .resolve.languages=["--search-path", $pack] | .database.init=["--search-path", $pack]')
112119
echo "CODEQL_ACTION_EXTRA_OPTIONS=${JSON}" >> ${GITHUB_ENV}
113120
env:
114121
PACK: ${{ runner.temp }}/pack
115122

116123
- name: Create CodeQL config file
117124
run: |
118125
echo "paths-ignore:" >> ${CONF}
119-
echo " - ql/ql/test" >> ${CONF}
120-
echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
126+
echo " - ql/ql/test" >> ${CONF}
127+
echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
121128
echo "disable-default-queries: true" >> ${CONF}
122129
echo "queries:" >> ${CONF}
123130
echo " - uses: ./ql/ql/src/codeql-suites/ql-code-scanning.qls" >> ${CONF}
124131
echo "Config file: "
125132
cat ${CONF}
126-
env:
133+
env:
127134
CONF: ./ql-for-ql-config.yml
128135
- name: Initialize CodeQL
129136
uses: github/codeql-action/init@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
@@ -139,13 +146,13 @@ jobs:
139146

140147
- name: Perform CodeQL Analysis
141148
uses: github/codeql-action/analyze@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
142-
with:
149+
with:
143150
category: "ql-for-ql"
144151
- name: Copy sarif file to CWD
145152
run: cp ../results/ql.sarif ./ql-for-ql.sarif
146153
- name: Fixup the $scema in sarif # Until https://github.com/microsoft/sarif-vscode-extension/pull/436/ is part in a stable release
147154
run: |
148-
sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql.sarif
155+
sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql.sarif
149156
- name: Sarif as artifact
150157
uses: actions/upload-artifact@v3
151158
with:

.github/workflows/ruby-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
uses: ./.github/actions/fetch-codeql
9696
- name: Build Query Pack
9797
run: |
98+
codeql pack create ../shared/ssa --output target/packs
9899
codeql pack create ql/lib --output target/packs
99100
codeql pack install ql/src
100101
codeql pack create ql/src --output target/packs

codeql-workspace.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ provide:
44
- "*/ql/test/qlpack.yml"
55
- "*/ql/examples/qlpack.yml"
66
- "*/ql/consistency-queries/qlpack.yml"
7+
- "shared/*/qlpack.yml"
78
- "cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml"
89
- "go/ql/config/legacy-support/qlpack.yml"
910
- "go/build/codeql-extractor-go/codeql-extractor.yml"

config/identical-files.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl.qll",
3131
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll",
3232
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForLibraries.qll",
33+
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForHttpClientLibraries.qll",
3334
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl.qll"
3435
],
3536
"DataFlow Java/C++/C#/Python Common": [
@@ -460,12 +461,6 @@
460461
"javascript/ql/lib/IDEContextual.qll",
461462
"python/ql/lib/analysis/IDEContextual.qll"
462463
],
463-
"SSA C#": [
464-
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImplCommon.qll",
465-
"ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImplCommon.qll",
466-
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImplCommon.qll",
467-
"swift/ql/lib/codeql/swift/dataflow/internal/SsaImplCommon.qll"
468-
],
469464
"CryptoAlgorithms Python/JS/Ruby": [
470465
"javascript/ql/lib/semmle/javascript/security/CryptoAlgorithms.qll",
471466
"python/ql/lib/semmle/python/concepts/CryptoAlgorithms.qll",

cpp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public void TestCppAutobuilderSuccess()
299299
{
300300
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test.sln -DisableParallelProcessing"] = 1;
301301
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\test.sln -DisableParallelProcessing"] = 0;
302-
Actions.RunProcess[@"cmd.exe /C CALL ^""C:\Program Files ^(x86^)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat^"" && set Platform=&& type NUL && C:\odasa\tools\odasa index --auto msbuild C:\Project\test.sln /p:UseSharedCompilation=false /t:rebuild /p:Platform=""x86"" /p:Configuration=""Release"" /p:MvcBuildViews=true"] = 0;
302+
Actions.RunProcess[@"cmd.exe /C CALL ^""C:\Program Files ^(x86^)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat^"" && set Platform=&& type NUL && C:\odasa\tools\odasa index --auto msbuild C:\Project\test.sln /t:rebuild /p:Platform=""x86"" /p:Configuration=""Release"" /p:MvcBuildViews=true"] = 0;
303303
Actions.RunProcessOut[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -prerelease -legacy -property installationPath"] = "";
304304
Actions.RunProcess[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -prerelease -legacy -property installationPath"] = 1;
305305
Actions.RunProcess[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -prerelease -legacy -property installationVersion"] = 0;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Expr extends @expr {
2+
string toString() { none() }
3+
}
4+
5+
class Location extends @location_expr {
6+
string toString() { none() }
7+
}
8+
9+
predicate isExprWithNewBuiltin(Expr expr) {
10+
exists(int kind | exprs(expr, kind, _) | 336 <= kind and kind <= 362)
11+
}
12+
13+
from Expr expr, int kind, int kind_new, Location location
14+
where
15+
exprs(expr, kind, location) and
16+
if isExprWithNewBuiltin(expr) then kind_new = 1 else kind_new = kind
17+
select expr, kind_new, location

0 commit comments

Comments
 (0)