Skip to content

Commit 52540b4

Browse files
authored
Merge branch 'main' into rvermeulen/javascript-adjust-security-severity
2 parents 6bd7047 + 57f1f5b commit 52540b4

File tree

3,386 files changed

+238226
-94992
lines changed

Some content is hidden

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

3,386 files changed

+238226
-94992
lines changed

.github/dependabot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,26 @@ updates:
1717
ignore:
1818
- dependency-name: '*'
1919
update-types: ['version-update:semver-patch', 'version-update:semver-minor']
20+
21+
- package-ecosystem: "gomod"
22+
directory: "go/extractor"
23+
schedule:
24+
interval: "daily"
25+
allow:
26+
- dependency-name: "golang.org/x/mod"
27+
- dependency-name: "golang.org/x/tools"
28+
groups:
29+
extractor-dependencies:
30+
patterns:
31+
- "golang.org/x/*"
32+
reviewers:
33+
- "github/codeql-go"
34+
35+
- package-ecosystem: "gomod"
36+
directory: "go/ql/test"
37+
schedule:
38+
interval: "monthly"
39+
ignore:
40+
- dependency-name: "*"
41+
reviewers:
42+
- "github/codeql-go"

.github/workflows/check-change-note.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,42 @@ on:
99
- "*/ql/lib/**/*.ql"
1010
- "*/ql/lib/**/*.qll"
1111
- "*/ql/lib/**/*.yml"
12+
- "shared/**/*.ql"
13+
- "shared/**/*.qll"
1214
- "!**/experimental/**"
1315
- "!ql/**"
1416
- ".github/workflows/check-change-note.yml"
1517

1618
jobs:
1719
check-change-note:
20+
env:
21+
REPO: ${{ github.repository }}
22+
PULL_REQUEST_NUMBER: ${{ github.event.number }}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1824
runs-on: ubuntu-latest
1925
steps:
26+
2027
- name: Fail if no change note found. To fix, either add one, or add the `no-change-note-required` label.
2128
if: |
2229
github.event.pull_request.draft == false &&
2330
!contains(github.event.pull_request.labels.*.name, 'no-change-note-required')
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2631
run: |
27-
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' |
28-
grep true -c
32+
change_note_files=$(gh api "repos/$REPO/pulls/$PULL_REQUEST_NUMBER/files" --paginate --jq '.[].filename | select(test("/change-notes/.*[.]md$"))')
33+
34+
if [ -z "$change_note_files" ]; then
35+
echo "No change note found. Either add one, or add the 'no-change-note-required' label."
36+
exit 1
37+
fi
38+
39+
echo "Change notes found:"
40+
echo "$change_note_files"
41+
2942
- name: Fail if the change note filename doesn't match the expected format. The file name must be of the form 'YYYY-MM-DD.md', 'YYYY-MM-DD-{title}.md', where '{title}' is arbitrary text, or released/x.y.z.md for released change-notes
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3243
run: |
33-
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq '[.[].filename | select(test("/change-notes/.*[.]md$"))] | all(test("/change-notes/[0-9]{4}-[0-9]{2}-[0-9]{2}.*[.]md$") or test("/change-notes/released/[0-9]*[.][0-9]*[.][0-9]*[.]md$"))' |
34-
grep true -c
44+
bad_change_note_file_names=$(gh api "repos/$REPO/pulls/$PULL_REQUEST_NUMBER/files" --paginate --jq '[.[].filename | select(test("/change-notes/.*[.]md$"))][] | select((test("/change-notes/[0-9]{4}-[0-9]{2}-[0-9]{2}.*[.]md$") or test("/change-notes/released/[0-9]*[.][0-9]*[.][0-9]*[.]md$")) | not)')
45+
46+
if [ -n "$bad_change_note_file_names" ]; then
47+
echo "The following change note file names are invalid:"
48+
echo "$bad_change_note_file_names"
49+
exit 1
50+
fi

.github/workflows/compile-queries.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
# run with --check-only if running in a PR (github.sha != main)
3030
if : ${{ github.event_name == 'pull_request' }}
3131
shell: bash
32-
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --check-only --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
32+
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --check-only --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" --compilation-cache-size=500
3333
- name: compile queries - full
3434
# do full compile if running on main - this populates the cache
3535
if : ${{ github.event_name != 'pull_request' }}
3636
shell: bash
37-
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
37+
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" --compilation-cache-size=500

.github/workflows/csharp-qltest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
run: |
9292
# Generate (Asp)NetCore stubs
9393
STUBS_PATH=stubs_output
94-
python3 ql/src/Stubs/make_stubs_nuget.py webapp Swashbuckle.AspNetCore.Swagger latest "$STUBS_PATH"
94+
python3 scripts/stubs/make_stubs_nuget.py webapp Swashbuckle.AspNetCore.Swagger 6.5.0 "$STUBS_PATH"
9595
rm -rf ql/test/resources/stubs/_frameworks
9696
# Update existing stubs in the repo with the freshly generated ones
9797
mv "$STUBS_PATH/output/stubs/_frameworks" ql/test/resources/stubs/

.github/workflows/csv-coverage-pr-artifacts.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,32 @@ jobs:
8989
- name: Save PR number
9090
run: |
9191
mkdir -p pr
92-
echo ${{ github.event.pull_request.number }} > pr/NR
92+
echo ${PR_NUMBER} > pr/NR
93+
env:
94+
PR_NUMBER: ${{ github.event.pull_request.number }}
9395
- name: Upload PR number
9496
uses: actions/upload-artifact@v3
9597
with:
9698
name: pr
9799
path: pr/
100+
- name: Save comment ID (if it exists)
101+
run: |
102+
# Find the latest comment starting with COMMENT_PREFIX
103+
COMMENT_PREFIX=":warning: The head of this PR and the base branch were compared for differences in the framework coverage reports."
104+
COMMENT_ID=$(gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" --paginate | jq --arg prefix "${COMMENT_PREFIX}" 'map(select(.body|startswith($prefix)) | .id) | max // empty')
105+
if [[ -z ${COMMENT_ID} ]]
106+
then
107+
echo "Comment not found. Not uploading 'comment/ID' artifact."
108+
else
109+
mkdir -p comment
110+
echo ${COMMENT_ID} > comment/ID
111+
fi
112+
env:
113+
GITHUB_TOKEN: ${{ github.token }}
114+
PR_NUMBER: ${{ github.event.pull_request.number }}
115+
- name: Upload comment ID (if it exists)
116+
uses: actions/upload-artifact@v3
117+
with:
118+
name: comment
119+
path: comment/
120+
if-no-files-found: ignore

codeql-workspace.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ provide:
66
- "*/ql/consistency-queries/qlpack.yml"
77
- "*/ql/automodel/src/qlpack.yml"
88
- "*/ql/automodel/test/qlpack.yml"
9-
- "shared/*/qlpack.yml"
9+
- "shared/**/qlpack.yml"
1010
- "cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml"
1111
- "go/ql/config/legacy-support/qlpack.yml"
1212
- "go/build/codeql-extractor-go/codeql-extractor.yml"
@@ -29,6 +29,7 @@ provide:
2929
- "swift/extractor-pack/codeql-extractor.yml"
3030
- "swift/integration-tests/qlpack.yml"
3131
- "ql/extractor-pack/codeql-extractor.yml"
32+
- ".github/codeql/extensions/**/codeql-pack.yml"
3233

3334
versionPolicies:
3435
default:

config/identical-files.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -498,22 +498,6 @@
498498
"ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModelsExtensions.qll",
499499
"python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModelsExtensions.qll"
500500
],
501-
"TaintedFormatStringQuery Ruby/JS": [
502-
"javascript/ql/lib/semmle/javascript/security/dataflow/TaintedFormatStringQuery.qll",
503-
"ruby/ql/lib/codeql/ruby/security/TaintedFormatStringQuery.qll"
504-
],
505-
"TaintedFormatStringCustomizations Ruby/JS": [
506-
"javascript/ql/lib/semmle/javascript/security/dataflow/TaintedFormatStringCustomizations.qll",
507-
"ruby/ql/lib/codeql/ruby/security/TaintedFormatStringCustomizations.qll"
508-
],
509-
"HttpToFileAccessQuery JS/Ruby": [
510-
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessQuery.qll",
511-
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessQuery.qll"
512-
],
513-
"HttpToFileAccessCustomizations JS/Ruby": [
514-
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessCustomizations.qll",
515-
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessCustomizations.qll"
516-
],
517501
"Typo database": [
518502
"javascript/ql/src/Expressions/TypoDatabase.qll",
519503
"ql/ql/src/codeql_ql/style/TypoDatabase.qll"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ IEnumerable<string> IBuildActions.EnumerateDirectories(string dir)
145145

146146
bool IBuildActions.IsMacOs() => IsMacOs;
147147

148-
public bool IsArm { get; set; }
148+
public bool IsRunningOnAppleSilicon { get; set; }
149149

150-
bool IBuildActions.IsArm() => IsArm;
150+
bool IBuildActions.IsRunningOnAppleSilicon() => IsRunningOnAppleSilicon;
151151

152152
string IBuildActions.PathCombine(params string[] parts)
153153
{
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class BuiltinType extends @builtintype {
2+
string toString() { none() }
3+
}
4+
5+
from BuiltinType type, string name, int kind, int kind_new, int size, int sign, int alignment
6+
where
7+
builtintypes(type, name, kind, size, sign, alignment) and
8+
if
9+
type instanceof @fp16 or
10+
type instanceof @std_bfloat16 or
11+
type instanceof @std_float16 or
12+
type instanceof @complex_std_float32 or
13+
type instanceof @complex_float32x or
14+
type instanceof @complex_std_float64 or
15+
type instanceof @complex_float64x or
16+
type instanceof @complex_std_float128
17+
then kind_new = 2
18+
else kind_new = kind
19+
select type, name, kind_new, size, sign, alignment

0 commit comments

Comments
 (0)