Skip to content

Commit 4d9ebda

Browse files
Merge branch 'github:main' into main-1
2 parents b795469 + 1aa2236 commit 4d9ebda

458 files changed

Lines changed: 4012 additions & 622 deletions

File tree

Some content is hidden

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

.github/codeql/codeql-config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ paths-ignore:
88
- '/java/'
99
- '/python/'
1010
- '/javascript/ql/test'
11+
- '/javascript/ql/integration-tests'
1112
- '/javascript/extractor/tests'
1213
- '/rust/ql'

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818

1919
jobs:
2020
CodeQL-Build:
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: ['actions', 'csharp']
2125

2226
runs-on: ubuntu-latest
2327

@@ -38,9 +42,8 @@ jobs:
3842
# Initializes the CodeQL tools for scanning.
3943
- name: Initialize CodeQL
4044
uses: github/codeql-action/init@main
41-
# Override language selection by uncommenting this and choosing your languages
4245
with:
43-
languages: csharp
46+
languages: ${{ matrix.language }}
4447
config-file: ./.github/codeql/codeql-config.yml
4548

4649
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ use_repo(
7373
tree_sitter_extractors_deps,
7474
"vendor_ts__anyhow-1.0.96",
7575
"vendor_ts__argfile-0.2.1",
76+
"vendor_ts__chalk-ir-0.99.0",
7677
"vendor_ts__chrono-0.4.39",
7778
"vendor_ts__clap-4.5.31",
7879
"vendor_ts__dunce-1.0.5",
@@ -94,6 +95,7 @@ use_repo(
9495
"vendor_ts__ra_ap_hir-0.0.266",
9596
"vendor_ts__ra_ap_hir_def-0.0.266",
9697
"vendor_ts__ra_ap_hir_expand-0.0.266",
98+
"vendor_ts__ra_ap_hir_ty-0.0.266",
9799
"vendor_ts__ra_ap_ide_db-0.0.266",
98100
"vendor_ts__ra_ap_intern-0.0.266",
99101
"vendor_ts__ra_ap_load-cargo-0.0.266",

actions/ql/src/Security/CWE-829/ArtifactPoisoningCritical.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
The following example, correctly creates a temporary directory and extracts the contents of the artifact there before calling `cmd.sh`.
4444

4545
```yaml
46-
name: Insecure Workflow
46+
name: Secure Workflow
4747
4848
on:
4949
workflow_run:

actions/ql/src/Security/CWE-829/ArtifactPoisoningMedium.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
The following example, correctly creates a temporary directory and extracts the contents of the artifact there before calling `cmd.sh`.
4444

4545
```yaml
46-
name: Insecure Workflow
46+
name: Secure Workflow
4747
4848
on:
4949
workflow_run:
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
- description: Security-and-quality queries for GitHub Actions
2-
- import: codeql-suites/actions-security-extended.qls
2+
- queries: .
3+
- apply: security-and-quality-selectors.yml
4+
from: codeql/suite-helpers
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
- description: Extended and experimental security queries for GitHub Actions
2-
- import: codeql-suites/actions-code-scanning.qls
2+
- queries: .
3+
- apply: security-experimental-selectors.yml
4+
from: codeql/suite-helpers

actions/ql/src/qlpack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ extractor: actions
88
defaultSuiteFile: codeql-suites/actions-code-scanning.qls
99
dependencies:
1010
codeql/actions-all: ${workspace}
11+
codeql/suite-helpers: ${workspace}

csharp/ql/src/API Abuse/NoDisposeCallOnLocalIDisposable.ql

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import csharp
1717
import Dispose
1818
import semmle.code.csharp.frameworks.System
19+
import semmle.code.csharp.frameworks.system.threading.Tasks
1920
import semmle.code.csharp.commons.Disposal
2021

2122
private class ReturnNode extends DataFlow::ExprNode {
@@ -24,15 +25,27 @@ private class ReturnNode extends DataFlow::ExprNode {
2425
}
2526
}
2627

28+
private class Task extends Type {
29+
Task() {
30+
this instanceof SystemThreadingTasksTaskClass or
31+
this instanceof SystemThreadingTasksTaskTClass
32+
}
33+
}
34+
2735
module DisposeCallOnLocalIDisposableConfig implements DataFlow::ConfigSig {
2836
predicate isSource(DataFlow::Node node) {
29-
node.asExpr() =
30-
any(LocalScopeDisposableCreation disposable |
31-
// Only care about library types - user types often have spurious IDisposable declarations
32-
disposable.getType().fromLibrary() and
33-
// WebControls are usually disposed automatically
34-
not disposable.getType() instanceof WebControl
35-
)
37+
exists(LocalScopeDisposableCreation disposable, Type t |
38+
node.asExpr() = disposable and
39+
t = disposable.getType()
40+
|
41+
// Only care about library types - user types often have spurious IDisposable declarations
42+
t.fromLibrary() and
43+
// WebControls are usually disposed automatically
44+
not t instanceof WebControl and
45+
// It is typically not nessesary to dispose tasks
46+
// https://devblogs.microsoft.com/pfxteam/do-i-need-to-dispose-of-tasks/
47+
not t instanceof Task
48+
)
3649
}
3750

3851
predicate isSink(DataFlow::Node node) {

0 commit comments

Comments
 (0)