Security Finding
Severity: medium
Type: unsafe-pattern (PR-triggered code execution)
.github/workflows/validate-brewfiles.yml runs on pull_request targeting custom/brew/** and executes:
brew bundle check --file="$brewfile"
A Brewfile is a Ruby DSL. brew bundle check loads the file via Homebrew's DSL evaluator, which executes arbitrary Ruby in the Brewfile (e.g. system "..." or backticks at top level). A malicious PR touching custom/brew/** therefore gets code execution in CI without merge.
Impact
Mitigations present: the workflow declares permissions: contents: read, uses no repository secrets, and the runner is ephemeral — so blast radius is bounded to:
- Arbitrary code execution on the runner (compute abuse, network egress)
- PR check spoofing (attacker controls exit status of the validation check)
- Outbound requests from the GitHub Actions IP range (could be leveraged against rate-limited/internal-adjacent services)
No secrets or write tokens are exposed, which is why this is medium and not high.
Recommendation
Pick one:
- Gate on fork PRs — require maintainer approval before the workflow runs on
pull_request from forks (repo setting: "Require approval for all outside contributors"), and document why.
- Static-parse instead of eval — replace
brew bundle check with a syntax-only check (ruby -c equivalents / grep-based validation of brew/cask lines) so the Brewfile is never executed.
- Sandbox the eval — run the check inside a networkless container (
--network none) with no mounted credentials.
Option 2 is the strongest; option 1 is the cheapest.
Filed by sec-check agent (ACMM L4/L5 — hold-gated mode)
🐝 Hive Agent: security | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: unknown
— hive: agent=sec-check backend=copilot model=kimi-k3
Security Finding
Severity: medium
Type: unsafe-pattern (PR-triggered code execution)
.github/workflows/validate-brewfiles.ymlruns onpull_requesttargetingcustom/brew/**and executes:brew bundle check --file="$brewfile"A Brewfile is a Ruby DSL.
brew bundle checkloads the file via Homebrew's DSL evaluator, which executes arbitrary Ruby in the Brewfile (e.g.system "..."or backticks at top level). A malicious PR touchingcustom/brew/**therefore gets code execution in CI without merge.Impact
Mitigations present: the workflow declares
permissions: contents: read, uses no repository secrets, and the runner is ephemeral — so blast radius is bounded to:No secrets or write tokens are exposed, which is why this is medium and not high.
Recommendation
Pick one:
pull_requestfrom forks (repo setting: "Require approval for all outside contributors"), and document why.brew bundle checkwith a syntax-only check (ruby -cequivalents / grep-based validation ofbrew/casklines) so the Brewfile is never executed.--network none) with no mounted credentials.Option 2 is the strongest; option 1 is the cheapest.
Filed by sec-check agent (ACMM L4/L5 — hold-gated mode)
🐝 Hive Agent:
security| Instance:hosted-projectbluefin-knuckle-gjvq| SHA:unknown— hive: agent=sec-check backend=copilot model=kimi-k3