Skip to content

Commit f28140b

Browse files
authored
Merge branch 'main' into redsun82/env-dump-integration-test
2 parents 13f1f8f + 8fca150 commit f28140b

File tree

2,084 files changed

+100607
-57585
lines changed

Some content is hidden

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

2,084 files changed

+100607
-57585
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ common --enable_platform_specific_config
22
# because we use --override_module with `%workspace%`, the lock file is not stable
33
common --lockfile_mode=off
44

5+
# Build release binaries by default, can be overwritten to in local.bazelrc and set to `fastbuild` or `dbg`
6+
build --compilation_mode opt
7+
58
# when building from this repository in isolation, the internal repository will not be found at ..
69
# where `MODULE.bazel` looks for it. The following will get us past the module loading phase, so
710
# that we can build things that do not rely on that

.github/pull_request_template.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

MODULE.bazel

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ local_path_override(
1414

1515
# see https://registry.bazel.build/ for a list of available packages
1616

17-
bazel_dep(name = "platforms", version = "0.0.10")
17+
bazel_dep(name = "platforms", version = "0.0.11")
1818
bazel_dep(name = "rules_go", version = "0.50.1")
1919
bazel_dep(name = "rules_pkg", version = "1.0.1")
2020
bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1")
@@ -28,7 +28,7 @@ bazel_dep(name = "rules_kotlin", version = "2.0.0-codeql.1")
2828
bazel_dep(name = "gazelle", version = "0.40.0")
2929
bazel_dep(name = "rules_dotnet", version = "0.17.4")
3030
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
31-
bazel_dep(name = "rules_rust", version = "0.52.2")
31+
bazel_dep(name = "rules_rust", version = "0.57.1")
3232
bazel_dep(name = "zstd", version = "1.5.5.bcr.1")
3333

3434
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
@@ -53,15 +53,6 @@ use_repo(rust, "rust_toolchains")
5353

5454
register_toolchains("@rust_toolchains//:all")
5555

56-
rust_host_tools = use_extension("@rules_rust//rust:extensions.bzl", "rust_host_tools")
57-
58-
# Don't download a second toolchain as host toolchain, make sure this is the same version as above
59-
# The host toolchain is used for vendoring dependencies.
60-
rust_host_tools.host_tools(
61-
edition = RUST_EDITION,
62-
version = RUST_VERSION,
63-
)
64-
6556
# deps for python extractor
6657
# keep in sync by running `misc/bazel/3rdparty/update_cargo_deps.sh`
6758
py_deps = use_extension("//misc/bazel/3rdparty:py_deps_extension.bzl", "p")
@@ -252,7 +243,7 @@ use_repo(
252243
)
253244

254245
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
255-
go_sdk.download(version = "1.23.1")
246+
go_sdk.download(version = "1.24.0")
256247

257248
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
258249
go_deps.from_file(go_mod = "//go/extractor:go.mod")

actions/ql/lib/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 0.4.2
2+
3+
### Bug Fixes
4+
5+
* Fixed data for vulnerable versions of `actions/download-artifact` and `rlespinasse/github-slug-action` (following GHSA-cxww-7g56-2vh6 and GHSA-6q4m-7476-932w).
6+
* Improved `untrustedGhCommandDataModel` regex for `gh pr view` and Bash taint analysis in GitHub Actions.
7+
18
## 0.4.1
29

310
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: feature
3+
---
4+
* The "Unpinned tag for a non-immutable Action in workflow" query (`actions/unpinned-tag`) now supports expanding the trusted action owner list using data extensions (`extensible: trustedActionsOwnerDataModel`). If you trust an Action publisher, you can include the owner name/organization in a model pack to add it to the allow list for this query. This addition will prevent security alerts when using unpinned tags for Actions published by that owner. For more information on creating a model pack, see [Creating a CodeQL Model Pack](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/creating-and-working-with-codeql-packs#creating-a-codeql-model-pack).
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## 0.4.2
2+
3+
### Bug Fixes
4+
5+
* Fixed data for vulnerable versions of `actions/download-artifact` and `rlespinasse/github-slug-action` (following GHSA-cxww-7g56-2vh6 and GHSA-6q4m-7476-932w).
6+
* Improved `untrustedGhCommandDataModel` regex for `gh pr view` and Bash taint analysis in GitHub Actions.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
lastReleaseVersion: 0.4.1
2+
lastReleaseVersion: 0.4.2

actions/ql/lib/codeql/actions/Bash.qll

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ class BashShellScript extends ShellScript {
8181
"qstr:" + k + ":" + i + ":" + j + ":" + quotedStr.length() + ":" +
8282
quotedStr.regexpReplaceAll("[^a-zA-Z0-9]", "")
8383
)
84-
)
84+
) and
85+
// Only do this for strings that might otherwise disrupt subsequent parsing
86+
quotedStr.regexpMatch("[\"'].*[$\n\r'\"" + Bash::separator() + "].*[\"']")
8587
}
8688

8789
private predicate rankedQuotedStringReplacements(int i, string old, string new) {
@@ -695,6 +697,19 @@ module Bash {
695697
not varMatchesRegexTest(script, var2, alphaNumericRegex())
696698
)
697699
or
700+
exists(string var2, string value2, string var3, string value3 |
701+
// VAR2=$(cmd)
702+
// VAR3=$VAR2
703+
// echo "FIELD=${VAR3:-default}" >> $GITHUB_ENV (field, file_write_value)
704+
containsCmdSubstitution(value2, cmd) and
705+
script.getAnAssignment(var2, value2) and
706+
containsParameterExpansion(value3, var2, _, _) and
707+
script.getAnAssignment(var3, value3) and
708+
containsParameterExpansion(expr, var3, _, _) and
709+
not varMatchesRegexTest(script, var2, alphaNumericRegex()) and
710+
not varMatchesRegexTest(script, var3, alphaNumericRegex())
711+
)
712+
or
698713
// var reaches the file write directly
699714
// echo "FIELD=$(cmd)" >> $GITHUB_ENV (field, file_write_value)
700715
containsCmdSubstitution(expr, cmd)

actions/ql/lib/codeql/actions/config/Config.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ predicate vulnerableActionsDataModel(
126126
*/
127127
predicate immutableActionsDataModel(string action) { Extensions::immutableActionsDataModel(action) }
128128

129+
/**
130+
* MaD models for trusted actions owners
131+
* Fields:
132+
* - owner: owner name
133+
*/
134+
predicate trustedActionsOwnerDataModel(string owner) {
135+
Extensions::trustedActionsOwnerDataModel(owner)
136+
}
137+
129138
/**
130139
* MaD models for untrusted git commands
131140
* Fields:

actions/ql/lib/codeql/actions/config/ConfigExtensions.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ extensible predicate vulnerableActionsDataModel(
6363
*/
6464
extensible predicate immutableActionsDataModel(string action);
6565

66+
/**
67+
* Holds for trusted Actions owners.
68+
*/
69+
extensible predicate trustedActionsOwnerDataModel(string owner);
70+
6671
/**
6772
* Holds for git commands that may introduce untrusted data when called on an attacker controlled branch.
6873
*/

0 commit comments

Comments
 (0)