Skip to content

Commit 50cc5d5

Browse files
committed
Merge branch 'main' of github.com:github/codeql into SharedDataflow_NestedComprehensions
2 parents fae915b + c457435 commit 50cc5d5

File tree

1,108 files changed

+45120
-16100
lines changed

Some content is hidden

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

1,108 files changed

+45120
-16100
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"slevesque.vscode-zipexplorer"
55
],
66
"settings": {
7-
"codeQL.experimentalBqrsParsing": true
7+
"codeQL.runningQueries.memory": 2048
88
}
99
}

.github/workflows/labeler.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
triage:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/labeler@v2
10+
with:
11+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can use the [interactive query console](https://lgtm.com/help/lgtm/using-que
99

1010
## Contributing
1111

12-
We welcome contributions to our standard library and standard checks. Do you have an idea for a new check, or how to improve an existing query? Then please go ahead and open a pull request! Before you do, though, please take the time to read our [contributing guidelines](CONTRIBUTING.md). You can also consult our [style guides](https://github.com/github/codeql/tree/master/docs) to learn how to format your code for consistency and clarity, how to write query metadata, and how to write query help documentation for your query.
12+
We welcome contributions to our standard library and standard checks. Do you have an idea for a new check, or how to improve an existing query? Then please go ahead and open a pull request! Before you do, though, please take the time to read our [contributing guidelines](CONTRIBUTING.md). You can also consult our [style guides](https://github.com/github/codeql/tree/main/docs) to learn how to format your code for consistency and clarity, how to write query metadata, and how to write query help documentation for your query.
1313

1414
## License
1515

change-notes/1.25/analysis-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
- [yargs](https://www.npmjs.com/package/yargs)
3131
- [webpack-dev-server](https://www.npmjs.com/package/webpack-dev-server)
3232

33-
* TypeScript 3.9 is now supported.
33+
* TypeScript 4.0 is now supported.
3434

3535
* TypeScript code embedded in HTML and Vue files is now extracted and analyzed.
3636

change-notes/1.26/analysis-cpp.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ The following changes in version 1.26 affect C/C++ analysis in all applications.
1313

1414
| **Query** | **Expected impact** | **Change** |
1515
|----------------------------|------------------------|------------------------------------------------------------------|
16+
| Declaration hides parameter (`cpp/declaration-hides-parameter`) | Fewer false positive results | False positives involving template functions have been fixed. |
1617
| Inconsistent direction of for loop (`cpp/inconsistent-loop-direction`) | Fewer false positive results | The query now accounts for intentional wrapping of an unsigned loop counter. |
1718
| Overflow in uncontrolled allocation size (`cpp/uncontrolled-allocation-size`) | | The precision of this query has been decreased from "high" to "medium". As a result, the query is still run but results are no longer displayed on LGTM by default. |
1819
| Comparison result is always the same (`cpp/constant-comparison`) | More correct results | Bounds on expressions involving multiplication can now be determined in more cases. |
1920

2021
## Changes to libraries
2122

22-
* The models library now models some taint flows through `std::array`, `std::vector`, `std::deque`, `std::list` and `std::forward_list`.
23+
* The QL class `Block`, denoting the `{ ... }` statement, is renamed to `BlockStmt`.
24+
* The models library now models many taint flows through `std::array`, `std::vector`, `std::deque`, `std::list` and `std::forward_list`.
2325
* The models library now models many more taint flows through `std::string`.
26+
* The models library now models some taint flows through `std::ostream`.
2427
* The `SimpleRangeAnalysis` library now supports multiplications of the form
2528
`e1 * e2` and `x *= e2` when `e1` and `e2` are unsigned or constant.

change-notes/1.26/analysis-csharp.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ The following changes in version 1.26 affect C# analysis in all applications.
1919
## Changes to code extraction
2020

2121
* Partial method bodies are extracted. Previously, partial method bodies were skipped completely.
22+
* Inferring the lengths of implicitely sized arrays is fixed. Previously, multidimensional arrays were always extracted with the same length for
23+
each dimension. With the fix, the array sizes `2` and `1` are extracted for `new int[,]{{1},{2}}`. Previously `2` and `2` were extracted.
24+
* The extractor is now assembly-insensitive by default. This means that two entities with the same
25+
fully-qualified name are now mapped to the same entity in the resulting database, regardless of
26+
whether they belong to different assemblies. Assembly sensitivity can be reenabled by passing
27+
`--assemblysensitivetrap` to the extractor.
2228

2329
## Changes to libraries
2430

change-notes/1.26/analysis-java.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Improvements to Java analysis
2+
3+
The following changes in version 1.26 affect Java analysis in all applications.
4+
5+
## General improvements
6+
7+
## New queries
8+
9+
| **Query** | **Tags** | **Purpose** |
10+
|-----------------------------|-----------|--------------------------------------------------------------------|
11+
12+
13+
## Changes to existing queries
14+
15+
| **Query** | **Expected impact** | **Change** |
16+
|------------------------------|------------------------|-----------------------------------|
17+
18+
19+
## Changes to libraries
20+
21+
* The QL class `Block`, denoting the `{ ... }` statement, is renamed to `BlockStmt`.

change-notes/1.26/analysis-javascript.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@
2626

2727
| **Query** | **Expected impact** | **Change** |
2828
|--------------------------------|------------------------------|---------------------------------------------------------------------------|
29+
| Potentially unsafe external link (`js/unsafe-external-link`) | Fewer results | This query no longer flags URLs constructed using a template system where only the hash or query part of the URL is dynamic. |
2930
| Incomplete URL substring sanitization (`js/incomplete-url-substring-sanitization`) | More results | This query now recognizes additional URLs when the substring check is an inclusion check. |
31+
| Ambiguous HTML id attribute (`js/duplicate-html-id`) | Results no longer shown | Precision tag reduced to "low". The query is no longer run by default. |
32+
| Unused loop iteration variable (`js/unused-loop-variable`) | Fewer results | This query no longer flags variables in a destructuring array assignment that are not the last variable in the destructed array. |
33+
| Unsafe shell command constructed from library input (`js/shell-command-constructed-from-input`) | More results | This query now recognizes more commands where colon, dash, and underscore are used. |
34+
| Unsafe jQuery plugin (`js/unsafe-jquery-plugin`) | More results | This query now detects more unsafe uses of nested option properties. |
3035

3136

3237
## Changes to libraries
38+
* The predicate `TypeAnnotation.hasQualifiedName` now works in more cases when the imported library was not present during extraction.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Improvements to Python analysis
2+
3+
The following changes in version 1.26 affect Python analysis in all applications.
4+
5+
## General improvements
6+
7+
8+
## New queries
9+
10+
| **Query** | **Tags** | **Purpose** |
11+
|-----------------------------|-----------|--------------------------------------------------------------------|
12+
13+
14+
## Changes to existing queries
15+
16+
| **Query** | **Expected impact** | **Change** |
17+
|----------------------------|------------------------|------------------------------------------------------------------|
18+
19+
20+
## Changes to libraries
21+
22+
* Added taint tracking support for string formatting through f-strings.

config/identical-files.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,60 @@
325325
"csharp/ql/src/experimental/ir/implementation/raw/gvn/internal/ValueNumberingImports.qll",
326326
"csharp/ql/src/experimental/ir/implementation/unaliased_ssa/gvn/internal/ValueNumberingImports.qll"
327327
],
328+
"Inline Test Expectations": [
329+
"cpp/ql/test/TestUtilities/InlineExpectationsTest.qll",
330+
"python/ql/test/TestUtilities/InlineExpectationsTest.qll"
331+
],
328332
"XML": [
329333
"cpp/ql/src/semmle/code/cpp/XML.qll",
330334
"csharp/ql/src/semmle/code/csharp/XML.qll",
331335
"java/ql/src/semmle/code/xml/XML.qll",
332336
"javascript/ql/src/semmle/javascript/XML.qll",
333337
"python/ql/src/semmle/python/xml/XML.qll"
338+
],
339+
"DuplicationProblems.qhelp": [
340+
"cpp/ql/src/Metrics/Files/DuplicationProblems.qhelp",
341+
"csharp/ql/src/Metrics/Files/DuplicationProblems.qhelp",
342+
"javascript/ql/src/Metrics/DuplicationProblems.qhelp",
343+
"python/ql/src/Metrics/DuplicationProblems.qhelp"
344+
],
345+
"CommentedOutCodeQuery.qhelp": [
346+
"cpp/ql/src/Documentation/CommentedOutCodeQuery.qhelp",
347+
"python/ql/src/Lexical/CommentedOutCodeQuery.qhelp",
348+
"csharp/ql/src/Bad Practices/Comments/CommentedOutCodeQuery.qhelp",
349+
"java/ql/src/Violations of Best Practice/Comments/CommentedOutCodeQuery.qhelp",
350+
"javascript/ql/src/Comments/CommentedOutCodeQuery.qhelp"
351+
],
352+
"FLinesOfCodeReferences.qhelp": [
353+
"java/ql/src/Metrics/Files/FLinesOfCodeReferences.qhelp",
354+
"javascript/ql/src/Metrics/FLinesOfCodeReferences.qhelp"
355+
],
356+
"FCommentRatioCommon.qhelp": [
357+
"java/ql/src/Metrics/Files/FCommentRatioCommon.qhelp",
358+
"javascript/ql/src/Metrics/FCommentRatioCommon.qhelp"
359+
],
360+
"FLinesOfCodeOverview.qhelp": [
361+
"java/ql/src/Metrics/Files/FLinesOfCodeOverview.qhelp",
362+
"javascript/ql/src/Metrics/FLinesOfCodeOverview.qhelp"
363+
],
364+
"CommentedOutCodeMetricOverview.qhelp": [
365+
"cpp/ql/src/Metrics/Files/CommentedOutCodeMetricOverview.qhelp",
366+
"csharp/ql/src/Metrics/Files/CommentedOutCodeMetricOverview.qhelp",
367+
"java/ql/src/Metrics/Files/CommentedOutCodeMetricOverview.qhelp",
368+
"javascript/ql/src/Comments/CommentedOutCodeMetricOverview.qhelp",
369+
"python/ql/src/Lexical/CommentedOutCodeMetricOverview.qhelp"
370+
],
371+
"FLinesOfDuplicatedCodeCommon.qhelp": [
372+
"cpp/ql/src/Metrics/Files/FLinesOfDuplicatedCodeCommon.qhelp",
373+
"java/ql/src/Metrics/Files/FLinesOfDuplicatedCodeCommon.qhelp",
374+
"javascript/ql/src/Metrics/FLinesOfDuplicatedCodeCommon.qhelp",
375+
"python/ql/src/Metrics/FLinesOfDuplicatedCodeCommon.qhelp"
376+
],
377+
"CommentedOutCodeReferences.qhelp": [
378+
"cpp/ql/src/Metrics/Files/CommentedOutCodeReferences.qhelp",
379+
"csharp/ql/src/Metrics/Files/CommentedOutCodeReferences.qhelp",
380+
"java/ql/src/Metrics/Files/CommentedOutCodeReferences.qhelp",
381+
"javascript/ql/src/Comments/CommentedOutCodeReferences.qhelp",
382+
"python/ql/src/Lexical/CommentedOutCodeReferences.qhelp"
334383
]
335384
}

0 commit comments

Comments
 (0)