Skip to content

Commit a44c25c

Browse files
authored
Merge branch 'main' into improve/actions-untrusted-checkout-source-link
2 parents 9d147bc + 5def214 commit a44c25c

539 files changed

Lines changed: 15933 additions & 13738 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.

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ members = [
99
"shared/yeast-schema",
1010
"ruby/extractor",
1111
"unified/extractor",
12-
"unified/extractor/tree-sitter-swift",
1312
"unified/swift-syntax-rs",
1413
"rust/extractor",
1514
"rust/extractor/macros",

MODULE.bazel

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ use_repo(
109109
tree_sitter_extractors_deps,
110110
"vendor_ts__anyhow-1.0.100",
111111
"vendor_ts__argfile-0.2.1",
112-
"vendor_ts__cc-1.2.61",
113112
"vendor_ts__chalk-ir-0.104.0",
114113
"vendor_ts__chrono-0.4.42",
115114
"vendor_ts__clap-4.5.48",
@@ -157,9 +156,7 @@ use_repo(
157156
"vendor_ts__tracing-subscriber-0.3.20",
158157
"vendor_ts__tree-sitter-0.26.8",
159158
"vendor_ts__tree-sitter-embedded-template-0.25.0",
160-
"vendor_ts__tree-sitter-generate-0.26.8",
161159
"vendor_ts__tree-sitter-json-0.24.8",
162-
"vendor_ts__tree-sitter-language-0.1.5",
163160
"vendor_ts__tree-sitter-python-0.23.6",
164161
"vendor_ts__tree-sitter-ql-0.23.1",
165162
"vendor_ts__tree-sitter-ruby-0.23.1",
@@ -322,7 +319,7 @@ go_sdk.download(version = "1.26.5")
322319

323320
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
324321
go_deps.from_file(go_mod = "//go/extractor:go.mod")
325-
use_repo(go_deps, "com_github_stretchr_testify", "org_golang_x_mod", "org_golang_x_tools")
322+
use_repo(go_deps, "com_github_stretchr_testify", "org_golang_x_mod", "org_golang_x_sys", "org_golang_x_tools")
326323

327324
ripunzip_archive = use_repo_rule("//misc/ripunzip:ripunzip.bzl", "ripunzip_archive")
328325

actions/ql/lib/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.4.40
2+
3+
### Minor Analysis Improvements
4+
5+
* Altered the logic of `EnvironmentCheck` to make sure it is a check that protects only for non-toctou. This change will result in more results being found by the queries: `actions/untrusted-checkout-toctou/high` and `actions/untrusted-checkout-toctou/critical`.
6+
17
## 0.4.39
28

39
No user-facing changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* GitHub Actions analysis now recognizes untrusted data in `github.event.merge_group` for workflows triggered by the `merge_group` event.

actions/ql/lib/change-notes/2026-07-09-environment-check-alteration.md renamed to actions/ql/lib/change-notes/released/0.4.40.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
---
2-
category: minorAnalysis
3-
---
4-
* Altered the logic of `EnvironmentCheck` to make sure it is a check that protects only for non-toctou. This change will result in more results being found by the queries: `actions/untrusted-checkout-toctou/high` and `actions/untrusted-checkout-toctou/critical`.
1+
## 0.4.40
2+
3+
### Minor Analysis Improvements
4+
5+
* Altered the logic of `EnvironmentCheck` to make sure it is a check that protects only for non-toctou. This change will result in more results being found by the queries: `actions/untrusted-checkout-toctou/high` and `actions/untrusted-checkout-toctou/critical`.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
lastReleaseVersion: 0.4.39
2+
lastReleaseVersion: 0.4.40

actions/ql/lib/codeql/actions/security/OutputClobberingQuery.qll

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,43 @@ class WorkflowCommandClobberingFromEnvVarSink extends OutputClobberingSink {
111111
}
112112
}
113113

114+
private string jqSafeOptionRegexp() {
115+
result = "-[acCMeRnSs]+"
116+
or
117+
result =
118+
"--(ascii-output|color-output|compact-output|exit-status|monochrome-output|null-input|" +
119+
"raw-input|slurp|sort-keys|unbuffered)"
120+
}
121+
122+
private string jqSimpleFilterRegexp() {
123+
result = "\\."
124+
or
125+
result = "\\.[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*|\\[[0-9]+\\])*"
126+
}
127+
128+
private string jqSimpleFilterArgumentRegexp() {
129+
result = jqSimpleFilterRegexp()
130+
or
131+
result = "'" + jqSimpleFilterRegexp() + "'"
132+
or
133+
result = "\"" + jqSimpleFilterRegexp() + "\""
134+
}
135+
136+
private string jqLiteralInputRegexp() {
137+
result = "[A-Za-z0-9_./][A-Za-z0-9_./-]*"
138+
or
139+
result = "\\$GITHUB_EVENT_PATH"
140+
or
141+
result = "\\$\\{GITHUB_EVENT_PATH\\}"
142+
}
143+
144+
bindingset[command]
145+
private predicate jqProducesJsonEncodedOutput(string command) {
146+
command
147+
.regexpMatch("jq(\\s+" + jqSafeOptionRegexp() + ")*\\s+" + jqSimpleFilterArgumentRegexp() +
148+
"(\\s+" + jqSafeOptionRegexp() + ")*(\\s+" + jqLiteralInputRegexp() + ")*")
149+
}
150+
114151
/**
115152
* - id: clob1
116153
* run: |
@@ -165,7 +202,8 @@ class WorkflowCommandClobberingFromFileReadSink extends OutputClobberingSink {
165202
// - run: cat pr-id.txt
166203
clobbering_stmt.indexOf(clobbering_cmd) = 0
167204
)
168-
)
205+
) and
206+
not jqProducesJsonEncodedOutput(clobbering_cmd)
169207
)
170208
}
171209
}

actions/ql/lib/ext/config/context_event_map.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extensions:
1919
- ["gollum", "github.event.changes"]
2020
- ["pull_request_comment", "github.event.comment"]
2121
- ["pull_request_comment", "github.event.pull_request"]
22+
- ["merge_group", "github.event.merge_group"]
2223
- ["pull_request_comment", "github.head_ref"]
2324
- ["pull_request_comment", "github.event.changes"]
2425
- ["pull_request_review", "github.event.pull_request"]

actions/ql/lib/ext/config/externally_triggereable_events.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ extensions:
1717
- ["workflow_run"] # depending on branch filter
1818
- ["workflow_call"] # depending on caller
1919
- ["workflow_dispatch"]
20-
- ["scheduled"]
20+
- ["schedule"]

0 commit comments

Comments
 (0)