Repository navigation
Description
Symptom
External-fork PR #2752 (from JChalka/FastLED:master) automatically triggered the full CI matrix on every commit. Visible runs include:
build (ubuntu-24.04)— 2m38sbuild / build(×3 variants) — 18m44s + 3m53s + 23m44stest / build(×2 variants) — 5m57s + 6m9s- Additional
pull_request-triggered runs visible in the run history:unit tests linux,wasm,uno,teensy41,example tests linux
That's ~60+ minutes of GHA runner time per push with no maintainer gate. For a contributor with normal iteration cadence (5–10 force-pushes per PR) on a multi-target build matrix, a single review cycle can easily burn 5–10 hours of runner time — and JChalka/FastLED:master is not an outside collaborator nor a previously-merged contributor, so this is the worst case.
Why this happens
Six workflows currently trigger on pull_request:
.github/workflows/build_esp32s3.yml
.github/workflows/build_teensy41.yml
.github/workflows/build_uno.yml
.github/workflows/build_wasm.yml
.github/workflows/example_test_linux.yml
.github/workflows/unit_test_linux.yml
All use the safe pull_request trigger (not pull_request_target), so there is no secrets-leak / RCE risk — fork code runs without write tokens. The only file using pull_request_target is project_automation.yml, and it sparse-checks-out only the base repo's ci/ dir, never the PR head. Confirmed safe.
So this is purely a runner-minutes / cost issue, not a security issue. But it's a real cost issue.
Repository settings observed
// GET /repos/FastLED/FastLED/actions/permissions
{"enabled":true,"allowed_actions":"all","sha_pinning_required":false}
// GET /repos/FastLED/FastLED/actions/permissions/workflow
{"default_workflow_permissions":"write","can_approve_pull_request_reviews":true}The fork-pull-request approval policy itself (Settings > Actions > General > Fork pull request workflows from outside collaborators) is not exposed in the REST API — it's UI-only. Based on the observed auto-run behavior, the setting is currently Require approval for first-time contributors only (the GitHub default) or looser. JChalka has prior merged contributions, so subsequent fork PRs auto-run forever.
Prevention options (pick one or combine)
Option A — Tighten the UI setting (cheapest, most aggressive)
Set Settings → Actions → General → Fork pull request workflows from outside collaborators → "Require approval for all outside collaborators". Every fork PR run will require a maintainer to click "Approve and run" on each push.
- Pros: One UI click, zero workflow edits, fully blocks runaway runs.
- Cons: Approve-each-push friction for active external contributors. Maintainers must remember to re-approve after every force-push during a review cycle.
Option B — Label-gated trigger ("ok-to-test" pattern)
Convert the 6 pull_request-triggered workflows to add an if: guard requiring a maintainer-applied label:
jobs:
build:
if: >-
github.event.pull_request.head.repo.full_name == github.repository ||
contains(github.event.pull_request.labels.*.name, 'ok-to-test')
# ...Maintainer applies ok-to-test once → all subsequent runs auto-fire until the label is removed (or until a fresh head_ref_force_pushed event, depending on how strict you want it).
- Pros: One-time approval per PR (not per push); maintainer keeps explicit control.
- Cons: Six workflow files to edit; need a small process doc explaining the label.
Option C — Workflow-level fork short-circuit + manual workflow_dispatch
Add if: github.event.pull_request.head.repo.full_name == github.repository to skip ALL pull_request-triggered runs from forks. Then expose workflow_dispatch so a maintainer can manually trigger the matrix against the PR head when they're ready to review.
- Pros: Zero auto-runs on forks, completely opt-in.
- Cons: Most friction for the contributor (they can't iterate against CI feedback themselves without maintainer involvement).
Recommendation
Combine A + B. Set the UI to "Require approval for all outside collaborators" as the safety floor (covers everything including any new pull-request-triggered workflow added later by mistake), AND add an ok-to-test label gate so that once a maintainer has vetted the PR, the contributor can iterate without per-push approval clicks. This is the pattern used by Kubernetes, Envoy, Istio, etc.
Not in scope for this issue (but worth noting)
default_workflow_permissions: writeis the GHA default; consider tightening toreadand explicitly grantingpermissions: write-allper-workflow only where needed (most workflows here are pure CI and don't need write).can_approve_pull_request_reviews: true— Actions are allowed to approve PRs. Almost certainly not used, but worth disabling if not.- Both of the above are separate hardening tasks; they don't address the runner-minutes issue directly.
Reference
- PR that surfaced this: fix(rgbw_colorimetric) Fix dual-channel Y ratio solving, Fix 3-channel solve granularity issues, re-implement legacy_lp solver #2752 (external fork from JChalka, all CI ran automatically)
- GitHub docs: https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks
- Label-gate pattern in the wild: https://github.com/kubernetes/test-infra/blob/master/prow/plugins/trigger/README.md (the
ok-to-testconvention)
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Jun 4, 2026
Correction to the original security claim
The user (zackees) challenged my unqualified "no secrets-leak / RCE risk" claim in the issue body. They're right that
pull_requestfrom forks is NOT a magic safety boundary — the attack classes (self-hosted runner takeover, cache poisoning, secrets-in-env exfiltration) are real and well-documented in the GitHub Actions security literature.I ran three parallel deep-dive audits to try to prove an attack is feasible against FastLED's current config. All three came back negative for currently exploitable, but the conditions that defend against them are fragile (one workflow edit away). Honest report:
What's currently mitigated
runs-on: self-hostedanywhere. All 6 fork-triggerable workflows terminate on stock GitHub-hosted Ubuntu.secrets.*references in any of the 6 fork-triggerable workflows OR their reusable templates (build_template.yml,template_unit_test.yml,template_example_test.yml,build_wasm.yml). The onlyenv:isBUILD_ARGS: ${{ inputs.args }}(literal input, no secret).GITHUB_TOKENwrite-scopeGITHUB_TOKENto read-only regardless ofpermissions:ordefault_workflow_permissions: write. Verified against current docs.actions/checkoutin PR-triggered workflows usespersist-credentials: false— so even the ephemeral checkout token is wiped from.git/configBEFORE./install/./test/./compile/ci/*.py(fork-controlled) runs.actions/cache@v*. The indirect caches viaastral-sh/setup-uv@v6andFastLED/fbuild/.github/actions/setup@mainuse keys that look shared, but GitHub server-side scopes fork-PR cache writes torefs/pull/N/mergeinvisibly.push-to-master cannot restore a fork-PR-written cache.type=ghacache (docker_*.yml) areworkflow_call-only, not reachable frompull_request.What's NOT mitigated (one edit away from exploit)
The templates execute extensive fork-controlled code:
./install(template_unit_test.yml:52,template_example_test.yml:57) →uv syncof fork'spyproject.toml→ Hatchling build backend executes whatever the fork ships./test(template_unit_test.yml:63)./compile(build_template.yml:86)ci/wasm_compile.py,ci/wasm_test.py(build_wasm.yml:91, :129)ci/ci-compile.py,ci/symbol_analysis_runner.py,ci/optimization_report.py, etc.If any future PR adds
env: TOKEN: ${{ secrets.X }}at the JOB level of one of those three templates, that secret IS immediately readable by every fork PR's./install,./test, orci/*.py. The "no secrets in PR-triggered workflows" rule is currently an unenforced convention.Additionally:
FastLED/fbuild/.github/actions/setup@main(build_template.yml:64) is pinned to a mutable branch ref. A compromise ofFastLED/fbuildbecomes immediate RCE on every FastLED CI runner. SHA-pin recommended.Additional ask: add an enforced invariant
The cost-control recommendations from the original issue (UI tightening +
ok-to-testlabel) still stand. To make the security side robust, add a CI-side lint that fails the workflow if anyone addssecrets.*to apull_request-triggered workflow or its callees. Sketch:That converts the "currently-safe-but-one-edit-away" status into a durable invariant.
Net change to original issue
Changing the framing from "this is purely a cost-control issue, not a security issue" to "this is a cost-control issue today, and there's a small but real security cliff one workflow edit away — worth adding a lint to defend the invariant."
The recommendations themselves (UI tightening +
ok-to-testlabel-gate + workflow-level short-circuit) don't change — they remain the right cost-control mix. The lint check is an additional, orthogonal defensive measure.ci(project_automation): restore pull_request_target after audit; docu…
ci: hard-block external-fork PRs; ban pull_request_target except audi…
ci(esp32): bloat regression gate with ratcheting baseline (#2886 Stag…