Skip to content

Commit f75fe13

Browse files
authored
Merge branch 'main' into main
2 parents bd21395 + 0751408 commit f75fe13

79 files changed

Lines changed: 1996 additions & 90 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: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ members = [
1010
"ruby/extractor",
1111
"unified/extractor",
1212
"unified/extractor/tree-sitter-swift",
13+
"unified/swift-syntax-rs",
1314
"rust/extractor",
1415
"rust/extractor/macros",
1516
"rust/ast-generator",

MODULE.bazel

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bazel_dep(name = "rules_cc", version = "0.2.17")
1919
bazel_dep(name = "rules_go", version = "0.60.0")
2020
bazel_dep(name = "rules_java", version = "9.6.1")
2121
bazel_dep(name = "rules_pkg", version = "1.2.0")
22-
bazel_dep(name = "rules_nodejs", version = "6.7.3")
22+
bazel_dep(name = "rules_nodejs", version = "6.7.5")
2323
bazel_dep(name = "rules_python", version = "1.9.0")
2424
bazel_dep(name = "rules_shell", version = "0.7.1")
2525
bazel_dep(name = "bazel_skylib", version = "1.9.0")
@@ -31,6 +31,13 @@ bazel_dep(name = "gazelle", version = "0.50.0")
3131
bazel_dep(name = "rules_dotnet", version = "0.21.5-codeql.1")
3232
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
3333
bazel_dep(name = "rules_rust", version = "0.69.0")
34+
bazel_dep(name = "rules_swift", version = "4.0.0-rc4")
35+
bazel_dep(name = "swift-syntax", version = "603.0.2")
36+
37+
# Needed so we can `use_repo` `local_config_xcode` and
38+
# `local_config_apple_cc_toolchains` below (referenced by the per-target
39+
# Xcode-config transition in `unified/swift-syntax-rs/xcode_transition.bzl`).
40+
bazel_dep(name = "apple_support", version = "2.6.1")
3441
bazel_dep(name = "zstd", version = "1.5.7.bcr.1")
3542

3643
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
@@ -219,6 +226,41 @@ use_repo(
219226
"swift-resource-dir-macos",
220227
)
221228

229+
# Swift toolchain for building `unified/swift-syntax-rs`. On Linux we register
230+
# a hermetic swift.org toolchain as the exec toolchain; on macOS `rules_swift`
231+
# auto-registers `xcode_swift_toolchain` (host Xcode + OS-provided Swift
232+
# runtime), which is not hermetic.
233+
#
234+
# The version is pinned as a literal rather than read from
235+
# `unified/swift-syntax-rs/.swift-version` via `swift_version_file`: the latter
236+
# makes the extension `module_ctx.read` a `//unified/...` label, which fails to
237+
# resolve when this repo is consumed as a dependency module (`@@ql+`) whose
238+
# `unified/swift-syntax-rs` package is not loadable in that context. Keep this
239+
# in sync with `unified/swift-syntax-rs/.swift-version` (used by the `cargo`
240+
# build) and the `swift-syntax` release in `swift/Package.swift`.
241+
swift = use_extension("@rules_swift//swift:extensions.bzl", "swift")
242+
swift.toolchain(
243+
name = "swift_toolchain",
244+
swift_version = "6.3.2",
245+
)
246+
use_repo(
247+
swift,
248+
"swift_toolchain",
249+
"swift_toolchain_ubuntu22.04",
250+
)
251+
252+
register_toolchains(
253+
"@swift_toolchain//:swift_toolchain_exec_ubuntu22.04",
254+
)
255+
256+
# `apple_support`'s xcode_config and CC toolchains, needed by the Xcode
257+
# transition in `unified/swift-syntax-rs/xcode_transition.bzl`.
258+
xcode_configure = use_extension("@apple_support//xcode:xcode_configure.bzl", "xcode_configure_extension")
259+
use_repo(xcode_configure, "local_config_xcode")
260+
261+
apple_cc_configure = use_extension("@apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")
262+
use_repo(apple_cc_configure, "local_config_apple_cc_toolchains")
263+
222264
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
223265
node.toolchain(
224266
name = "nodejs",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
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`.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,8 @@ class EnvironmentCheck extends ControlCheck instanceof Environment {
280280
// Environment checks are not effective against any mutable attacks
281281
// they do actually protect against untrusted code execution (sha)
282282
override predicate protectsCategoryAndEvent(string category, string event) {
283-
event = actor_is_attacker_event() and category = any_category()
284-
or
285-
event = actor_not_attacker_event() and category = non_toctou_category()
283+
event = [actor_is_attacker_event(), actor_not_attacker_event()] and
284+
category = non_toctou_category()
286285
}
287286
}
288287

actions/ql/lib/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/actions-all
2-
version: 0.4.39
2+
version: 0.4.40-dev
33
library: true
44
warnOnImplicitThis: true
55
dependencies:

actions/ql/src/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/actions-queries
2-
version: 0.6.31
2+
version: 0.6.32-dev
33
library: false
44
warnOnImplicitThis: true
55
groups: [actions, queries]

actions/ql/test/query-tests/Security/CWE-367/UntrustedCheckoutTOCTOUCritical.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ edges
9999
#select
100100
| .github/workflows/comment.yml:58:9:60:2 | Run Step | .github/workflows/comment.yml:54:9:58:6 | Uses Step | .github/workflows/comment.yml:58:9:60:2 | Run Step | Insufficient protection against execution of untrusted code on a privileged workflow ($@). | .github/workflows/comment.yml:4:3:4:15 | issue_comment | issue_comment |
101101
| .github/workflows/comment.yml:68:9:68:43 | Run Step | .github/workflows/comment.yml:64:9:68:6 | Uses Step | .github/workflows/comment.yml:68:9:68:43 | Run Step | Insufficient protection against execution of untrusted code on a privileged workflow ($@). | .github/workflows/comment.yml:4:3:4:15 | issue_comment | issue_comment |
102+
| .github/workflows/deployment1.yml:27:10:30:7 | Run Step | .github/workflows/deployment1.yml:16:10:22:7 | Uses Step | .github/workflows/deployment1.yml:27:10:30:7 | Run Step | Insufficient protection against execution of untrusted code on a privileged workflow ($@). | .github/workflows/deployment1.yml:5:3:5:21 | pull_request_target | pull_request_target |
103+
| .github/workflows/deployment1.yml:30:10:31:53 | Run Step | .github/workflows/deployment1.yml:16:10:22:7 | Uses Step | .github/workflows/deployment1.yml:30:10:31:53 | Run Step | Insufficient protection against execution of untrusted code on a privileged workflow ($@). | .github/workflows/deployment1.yml:5:3:5:21 | pull_request_target | pull_request_target |
102104
| .github/workflows/test0.yml:58:9:60:2 | Run Step | .github/workflows/test0.yml:54:9:58:6 | Uses Step | .github/workflows/test0.yml:58:9:60:2 | Run Step | Insufficient protection against execution of untrusted code on a privileged workflow ($@). | .github/workflows/test0.yml:4:3:4:15 | issue_comment | issue_comment |
103105
| .github/workflows/test0.yml:68:9:68:43 | Run Step | .github/workflows/test0.yml:64:9:68:6 | Uses Step | .github/workflows/test0.yml:68:9:68:43 | Run Step | Insufficient protection against execution of untrusted code on a privileged workflow ($@). | .github/workflows/test0.yml:4:3:4:15 | issue_comment | issue_comment |
104106
| .github/workflows/test4.yml:85:7:88:54 | Uses Step | .github/workflows/test4.yml:79:7:85:4 | Uses Step | .github/workflows/test4.yml:85:7:88:54 | Uses Step | Insufficient protection against execution of untrusted code on a privileged workflow ($@). | .github/workflows/test4.yml:5:3:5:15 | issue_comment | issue_comment |

cpp/ql/lib/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cpp-all
2-
version: 12.0.0
2+
version: 12.0.1-dev
33
groups: cpp
44
dbscheme: semmlecode.cpp.dbscheme
55
extractor: cpp

cpp/ql/src/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cpp-queries
2-
version: 1.7.0
2+
version: 1.7.1-dev
33
groups:
44
- cpp
55
- queries

0 commit comments

Comments
 (0)