Skip to content

Commit ce82c54

Browse files
Merge branch 'main' into edoardo/3.5-mergeback
2 parents 3e5b5be + 4eaec39 commit ce82c54

File tree

684 files changed

+24277
-21152
lines changed

Some content is hidden

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

684 files changed

+24277
-21152
lines changed

.github/workflows/check-qldoc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
done
3838
git checkout HEAD^
3939
for pack_dir in ${changed_lib_packs}; do
40+
# When we add a new language, pack_dir would not exist in HEAD^.
41+
# In this case the right thing to do is to skip the check.
42+
[[ ! -d "${pack_dir}" ]] && continue
4043
lang="${pack_dir%/ql/lib}"
4144
gh codeql generate library-doc-coverage --output="${RUNNER_TEMP}/${lang}-baseline.txt" --dir="${pack_dir}"
4245
awk -F, '{gsub(/"/,""); if ($4==0 && $6=="public") print "\""$3"\"" }' "${RUNNER_TEMP}/${lang}-current.txt" | sort -u > "${RUNNER_TEMP}/current-undocumented.txt"

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ jobs:
1616
- uses: actions/checkout@v2
1717
- name: Find codeql
1818
id: find-codeql
19-
uses: github/codeql-action/init@erik-krogh/ql
19+
uses: github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
2020
with:
2121
languages: javascript # does not matter
22+
tools: latest
2223
- name: Get CodeQL version
2324
id: get-codeql-version
2425
run: |
@@ -159,7 +160,7 @@ jobs:
159160
PACK: ${{ runner.temp }}/pack
160161
- name: Hack codeql-action options
161162
run: |
162-
JSON=$(jq -nc --arg pack "${PACK}" '.resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .database.init=["--search-path", $pack]')
163+
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]')
163164
echo "CODEQL_ACTION_EXTRA_OPTIONS=${JSON}" >> ${GITHUB_ENV}
164165
env:
165166
PACK: ${{ runner.temp }}/pack
@@ -171,22 +172,25 @@ jobs:
171172
echo "paths:" > ${CONF}
172173
echo " - ${FOLDER}" >> ${CONF}
173174
echo "paths-ignore:" >> ${CONF}
174-
echo " - ql/ql/test" >> ${CONF}
175+
echo " - ql/ql/test" >> ${CONF}
176+
echo "disable-default-queries: true" >> ${CONF}
177+
echo "packs:" >> ${CONF}
178+
echo " - codeql/ql" >> ${CONF}
175179
echo "Config file: "
176180
cat ${CONF}
177181
env:
178182
CONF: ./ql-for-ql-config.yml
179183
FOLDER: ${{ matrix.folder }}
180-
181184
- name: Initialize CodeQL
182-
uses: github/codeql-action/init@erik-krogh/ql
185+
uses: github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
183186
with:
184187
languages: ql
185188
db-location: ${{ runner.temp }}/db
186189
config-file: ./ql-for-ql-config.yml
190+
tools: latest
187191

188192
- name: Perform CodeQL Analysis
189-
uses: github/codeql-action/analyze@erik-krogh/ql
193+
uses: github/codeql-action/analyze@aa93aea877e5fb8841bcb1193f672abf6e9f2980
190194
with:
191195
category: "ql-for-ql-${{ matrix.folder }}"
192196
- name: Copy sarif file to CWD

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- name: Find codeql
2828
id: find-codeql
29-
uses: github/codeql-action/init@erik-krogh/ql
29+
uses: github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
3030
with:
3131
languages: javascript # does not matter
3232
- uses: actions/cache@v2

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/checkout@v2
2121
- name: Find codeql
2222
id: find-codeql
23-
uses: github/codeql-action/init@erik-krogh/ql
23+
uses: github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
2424
with:
2525
languages: javascript # does not matter
2626
- uses: actions/cache@v2

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Byte-compiled python files
1818
*.pyc
1919

20-
# python virtual environment folder
20+
# python virtual environment folder
2121
.venv/
2222

2323
# It's useful (though not required) to be able to unpack codeql in the ql checkout itself
@@ -29,4 +29,7 @@ csharp/extractor/Semmle.Extraction.CSharp.Driver/Properties/launchSettings.json
2929
.codeql
3030

3131
# Compiled class file
32-
*.class
32+
*.class
33+
34+
# links create by bazel
35+
/bazel-*

CODEOWNERS

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
/python/ @github/codeql-python
66
/ruby/ @github/codeql-ruby
77

8-
# Make @xcorail (GitHub Security Lab) a code owner for experimental queries so he gets pinged when we promote a query out of experimental
9-
/cpp/**/experimental/**/* @github/codeql-c-analysis @xcorail
10-
/csharp/**/experimental/**/* @github/codeql-csharp @xcorail
11-
/java/**/experimental/**/* @github/codeql-java @xcorail
12-
/javascript/**/experimental/**/* @github/codeql-javascript @xcorail
13-
/python/**/experimental/**/* @github/codeql-python @xcorail
14-
/ruby/**/experimental/**/* @github/codeql-ruby @xcorail
15-
168
# ML-powered queries
179
/javascript/ql/experimental/adaptivethreatmodeling/ @github/codeql-ml-powered-queries-reviewers
1810

@@ -31,3 +23,7 @@
3123

3224
# QL for QL reviewers
3325
/ql/ @github/codeql-ql-for-ql-reviewers
26+
27+
# Bazel
28+
**/*.bazel @github/codeql-ci-reviewers
29+
**/*.bzl @github/codeql-ci-reviewers

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ If you have an idea for a query that you would like to share with other CodeQL u
3636

3737
For details, see the [guide on query metadata](docs/query-metadata-style-guide.md).
3838

39-
Make sure the `select` statement is compatible with the query `@kind`. See [About CodeQL queries](https://help.semmle.com/QL/learn-ql/writing-queries/introduction-to-queries.html#select-clause) on help.semmle.com.
39+
Make sure the `select` statement is compatible with the query `@kind`. See [About CodeQL queries](https://codeql.github.com/docs/writing-codeql-queries/about-codeql-queries/#select-clause) on codeql.github.com.
4040

4141
3. **Formatting**
4242

@@ -70,3 +70,7 @@ After the experimental query is merged, we welcome pull requests to improve it.
7070
If you contribute to this project, we will record your name and email address (as provided by you with your contributions) as part of the code repositories, which are public. We might also use this information to contact you in relation to your contributions, as well as in the normal course of software development. We also store records of CLA agreements signed in the past, but no longer require contributors to sign a CLA. Under GDPR legislation, we do this on the basis of our legitimate interest in creating the CodeQL product.
7171

7272
Please do get in touch ([email protected]) if you have any questions about this or our data protection policies.
73+
74+
## Bazel
75+
Please notice that any bazel targets and definitions in this repository are currently experimental
76+
and for internal use only.

WORKSPACE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Please notice that any bazel targets and definitions in this repository are currently experimental
2+
# and for internal use only.

config/identical-files.json

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,9 @@
7575
"java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll",
7676
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll"
7777
],
78-
"Model as Data Generation Java/C# - Utils": [
79-
"java/ql/src/utils/model-generator/ModelGeneratorUtils.qll",
80-
"csharp/ql/src/utils/model-generator/ModelGeneratorUtils.qll"
81-
],
82-
"Model as Data Generation Java/C# - SummaryModels": [
83-
"java/ql/src/utils/model-generator/CaptureSummaryModels.qll",
84-
"csharp/ql/src/utils/model-generator/CaptureSummaryModels.qll"
78+
"Model as Data Generation Java/C# - CaptureModels": [
79+
"java/ql/src/utils/model-generator/internal/CaptureModels.qll",
80+
"csharp/ql/src/utils/model-generator/internal/CaptureModels.qll"
8581
],
8682
"Sign Java/C#": [
8783
"java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll",
@@ -482,11 +478,12 @@
482478
"python/ql/lib/semmle/python/security/performance/ReDoSUtil.qll",
483479
"ruby/ql/lib/codeql/ruby/security/performance/ReDoSUtil.qll"
484480
],
485-
"ReDoS Exponential Python/JS": [
481+
"ReDoS Exponential Python/JS/Ruby": [
486482
"javascript/ql/lib/semmle/javascript/security/performance/ExponentialBackTracking.qll",
487-
"python/ql/lib/semmle/python/security/performance/ExponentialBackTracking.qll"
483+
"python/ql/lib/semmle/python/security/performance/ExponentialBackTracking.qll",
484+
"ruby/ql/lib/codeql/ruby/security/performance/ExponentialBackTracking.qll"
488485
],
489-
"ReDoS Polynomial Python/JS": [
486+
"ReDoS Polynomial Python/JS/Ruby": [
490487
"javascript/ql/lib/semmle/javascript/security/performance/SuperlinearBackTracking.qll",
491488
"python/ql/lib/semmle/python/security/performance/SuperlinearBackTracking.qll",
492489
"ruby/ql/lib/codeql/ruby/security/performance/SuperlinearBackTracking.qll"
@@ -518,12 +515,38 @@
518515
"javascript/ql/lib/semmle/javascript/frameworks/data/internal/AccessPathSyntax.qll",
519516
"ruby/ql/lib/codeql/ruby/dataflow/internal/AccessPathSyntax.qll"
520517
],
518+
"IncompleteUrlSubstringSanitization": [
519+
"javascript/ql/src/Security/CWE-020/IncompleteUrlSubstringSanitization.qll",
520+
"ruby/ql/src/queries/security/cwe-020/IncompleteUrlSubstringSanitization.qll"
521+
],
522+
"Concepts Python/Ruby/JS": [
523+
"python/ql/lib/semmle/python/internal/ConceptsShared.qll",
524+
"ruby/ql/lib/codeql/ruby/internal/ConceptsShared.qll",
525+
"javascript/ql/lib/semmle/javascript/internal/ConceptsShared.qll"
526+
],
521527
"Hostname Regexp queries": [
522528
"javascript/ql/src/Security/CWE-020/HostnameRegexpShared.qll",
529+
"python/ql/src/Security/CWE-020/HostnameRegexpShared.qll",
523530
"ruby/ql/src/queries/security/cwe-020/HostnameRegexpShared.qll"
524531
],
525532
"ApiGraphModels": [
526533
"javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModels.qll",
527534
"ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModels.qll"
535+
],
536+
"TaintedFormatStringQuery Ruby/JS": [
537+
"javascript/ql/lib/semmle/javascript/security/dataflow/TaintedFormatStringQuery.qll",
538+
"ruby/ql/lib/codeql/ruby/security/TaintedFormatStringQuery.qll"
539+
],
540+
"TaintedFormatStringCustomizations Ruby/JS": [
541+
"javascript/ql/lib/semmle/javascript/security/dataflow/TaintedFormatStringCustomizations.qll",
542+
"ruby/ql/lib/codeql/ruby/security/TaintedFormatStringCustomizations.qll"
543+
],
544+
"HttpToFileAccessQuery JS/Ruby": [
545+
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessQuery.qll",
546+
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessQuery.qll"
547+
],
548+
"HttpToFileAccessCustomizations JS/Ruby": [
549+
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessCustomizations.qll",
550+
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessCustomizations.qll"
528551
]
529-
}
552+
}

cpp/BUILD.bazel

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
load("@rules_pkg//:mappings.bzl", "pkg_filegroup")
4+
5+
alias(
6+
name = "dbscheme",
7+
actual = "//cpp/ql/lib:dbscheme",
8+
)
9+
10+
pkg_filegroup(
11+
name = "db-files",
12+
srcs = [
13+
":dbscheme",
14+
"//cpp/downgrades",
15+
"//cpp/ql/lib:dbscheme-stats",
16+
],
17+
)

0 commit comments

Comments
 (0)