Skip to content

Commit 24b51e8

Browse files
committed
Merge branch 'main' of github.com:github/codeql into python-port-stacktrace-exosure
2 parents 76f0809 + cea1049 commit 24b51e8

File tree

667 files changed

+31655
-10604
lines changed

Some content is hidden

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

667 files changed

+31655
-10604
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
pull_request_target:
3+
types: [labeled, unlabeled, opened, synchronize, reopened, ready_for_review]
4+
paths:
5+
- "*/ql/src/**/*.ql"
6+
- "*/ql/src/**/*.qll"
7+
- "!**/experimental/**"
8+
9+
jobs:
10+
check-change-note:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Fail if no change note found. To fix, either add one, or add the `no-change-note-required` label.
14+
if: |
15+
github.event.pull_request.draft == false &&
16+
!contains(github.event.pull_request.labels.*.name, 'no-change-note-required')
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
run: |
20+
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate |
21+
jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' --exit-status

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ on:
55
branches:
66
- main
77
- 'rc/*'
8+
paths:
9+
- 'csharp/**'
810
pull_request:
911
branches:
1012
- main
1113
- 'rc/*'
14+
paths:
15+
- 'csharp/**'
1216
schedule:
1317
- cron: '0 9 * * 1'
1418

.github/workflows/generate-query-help-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
uses: ammaraskar/sphinx-action@8b4f60114d7fd1faeba1a712269168508d4750d2 # v0.4
5151
with:
5252
docs-folder: "query-help/"
53-
pre-build-command: "python -m pip install --upgrade recommonmark"
53+
pre-build-command: "python -m pip install --upgrade recommonmark && python -m pip install --upgrade sphinx-markdown-tables"
5454
build-command: "sphinx-build -b dirhtml . _build"
5555
- name: Upload HTML artifacts
5656
uses: actions/upload-artifact@v2

CODEOWNERS

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,3 @@
33
/java/ @github/codeql-java
44
/javascript/ @github/codeql-javascript
55
/python/ @github/codeql-python
6-
7-
# Assign query help for docs review
8-
/cpp/**/*.qhelp @hubwriter
9-
/csharp/**/*.qhelp @jf205
10-
/java/**/*.qhelp @felicitymay
11-
/javascript/**/*.qhelp @mchammer01
12-
/python/**/*.qhelp @felicitymay
13-
/docs/language/ @shati-patel @jf205
14-
15-
# Exclude help for experimental queries from docs review
16-
/cpp/**/experimental/**/*.qhelp @github/codeql-c-analysis
17-
/csharp/**/experimental/**/*.qhelp @github/codeql-csharp
18-
/java/**/experimental/**/*.qhelp @github/codeql-java
19-
/javascript/**/experimental/**/*.qhelp @github/codeql-javascript
20-
/python/**/experimental/**/*.qhelp @github/codeql-python

CONTRIBUTING.md

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

5050
- The query must have at least one true positive result on some revision of a real project.
5151

52-
Experimental queries and libraries may not be actively maintained as the [supported](docs/supported-queries.md) libraries evolve. They may also be changed in backwards-incompatible ways or may be removed entirely in the future without deprecation warnings.
52+
6. **Query help files and unit tests**
53+
54+
- Query help (`.qhelp`) files and unit tests are optional (but strongly encouraged!) for queries in the `experimental` directories. For more information about contributing query help files and unit tests, see [Supported CodeQL queries and libraries](docs/supported-queries.md).
55+
56+
Experimental queries and libraries may not be actively maintained as the supported libraries evolve. They may also be changed in backwards-incompatible ways or may be removed entirely in the future without deprecation warnings.
5357

5458
After the experimental query is merged, we welcome pull requests to improve it. Before a query can be moved out of the `experimental` subdirectory, it must satisfy [the requirements for being a supported query](docs/supported-queries.md).
5559

config/identical-files.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@
356356
],
357357
"Inline Test Expectations": [
358358
"cpp/ql/test/TestUtilities/InlineExpectationsTest.qll",
359+
"java/ql/test/TestUtilities/InlineExpectationsTest.qll",
359360
"python/ql/test/TestUtilities/InlineExpectationsTest.qll"
360361
],
361362
"C++ ExternalAPIs": [

cpp/ql/src/Security/CWE/CWE-020/ExternalAPIsSpecific.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class UntrustedDataToExternalAPIConfig extends TaintTracking::Configuration {
4646
UntrustedDataToExternalAPIConfig() { this = "UntrustedDataToExternalAPIConfig" }
4747

4848
override predicate isSource(DataFlow::Node source) {
49-
exists(RemoteFlowFunction remoteFlow |
49+
exists(RemoteFlowSourceFunction remoteFlow |
5050
remoteFlow = source.asExpr().(Call).getTarget() and
5151
remoteFlow.hasRemoteFlowSource(_, _)
5252
)

cpp/ql/src/Security/CWE/CWE-079/CgiXss.ql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class Configuration extends TaintTrackingConfiguration {
3434
override predicate isSink(Element tainted) {
3535
exists(PrintStdoutCall call | call.getAnArgument() = tainted)
3636
}
37+
38+
override predicate isBarrier(Expr e) {
39+
super.isBarrier(e) or e.getUnspecifiedType() instanceof IntegralType
40+
}
3741
}
3842

3943
from QueryString query, Element printedArg, PathNode sourceNode, PathNode sinkNode

cpp/ql/src/Security/CWE/CWE-676/DangerousFunctionOverflow.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @tags reliability
99
* security
1010
* external/cwe/cwe-242
11+
* external/cwe/cwe-676
1112
*/
1213

1314
import cpp

cpp/ql/src/semmle/code/cpp/Declaration.qll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@ class Declaration extends Locatable, @declaration {
139139
this.hasQualifiedName("std", "", name)
140140
}
141141

142+
/**
143+
* Holds if this declaration has the given name in the global namespace,
144+
* the `std` namespace or the `bsl` namespace.
145+
* We treat `std` and `bsl` as the same in some of our models.
146+
*/
147+
predicate hasGlobalOrStdOrBslName(string name) {
148+
this.hasGlobalName(name)
149+
or
150+
this.hasQualifiedName("std", "", name)
151+
or
152+
this.hasQualifiedName("bsl", "", name)
153+
}
154+
142155
/** Gets a specifier of this declaration. */
143156
Specifier getASpecifier() { none() } // overridden in subclasses
144157

0 commit comments

Comments
 (0)