What changed, and why it matters
This commit tightens a GitHub Actions workflow that runs tests on physical Trezor devices. It adds a read-only permission for repository contents and switches from using GitHub's matrix variable directly in shell commands to using an environment variable. These are defensive hardening changes that reduce the risk of code-injection or over-permission attacks in the CI pipeline, but they do not fix any known active vulnerability in the firmware itself.
No immediate action required. Treat as routine security hygiene. Review remaining zizmor findings and consider applying similar hardening to other workflows.
Security signals we found
Workflow permission reduction (contents: read)
Mitigation of GitHub Actions template injection via matrix.model -> env var
Tooling-driven hardening (zizmor lints)
Evidence from the diff
The patch modifies .github/workflows/core-hw.yml. It adds a top-level permissions: contents: read block, limiting the workflow’s default GitHub token to read access. It also replaces two shell command interpolations of ${{ matrix.model }} with the “$TREZOR_MODEL” environment variable. This is consistent with zizmor’s recommendations (excessive permissions and template injection lints). The changes are preventive CI hardening; no product code or cryptographic logic is changed.
Changed components
.github/workflows/core-hw.ymlInspect captured patch +5 / −2
diff --git a/.github/workflows/core-hw.yml b/.github/workflows/core-hw.yml
index 09f4749a..38f343a9 100644
--- a/.github/workflows/core-hw.yml
+++ b/.github/workflows/core-hw.yml
@@ -11,6 +11,9 @@ on:
required: true
default: "[\"T1B1\",\"T2B1\",\"T2T1\",\"T3B1\",\"T3T1\",\"T3W1\"]"
+permissions:
+ contents: read # for actions/checkout
+
# [Device tests](../tests/device-tests.md) that run against an actual physical Trezors.
# The device needs to have special bootloader, found in `core/embed/projects/bootloader_ci`, that
# makes it possible to flash firmware without confirmation on the touchscreen.
@@ -93,7 +96,7 @@ jobs:
- uses: ./.github/actions/environment
- run: nix-shell --arg hardwareTest true --run uhubctl
- run: nix-shell --run "uv run make -C core build_firmware"
- - run: nix-shell --arg hardwareTest true --run "uv run python ci/hardware_tests/bootstrap.py ${{ matrix.model }} core/build-xtask/artifacts/latest/firmware.bin"
+ - run: nix-shell --arg hardwareTest true --run "uv run python ci/hardware_tests/bootstrap.py \"$TREZOR_MODEL\" core/build-xtask/artifacts/latest/firmware.bin"
- run: |
nix-shell --run "uv run trezorctl list"
nix-shell --run "uv run trezorctl get-features"
@@ -143,7 +146,7 @@ jobs:
full-deps: "true"
- run: nix-shell --arg hardwareTest true --run uhubctl
- run: nix-shell --run "uv run make -C core build_firmware"
- - run: nix-shell --arg hardwareTest true --run "uv run python ci/hardware_tests/bootstrap.py ${{ matrix.model }} core/build-xtask/artifacts/latest/firmware.bin"
+ - run: nix-shell --arg hardwareTest true --run "uv run python ci/hardware_tests/bootstrap.py \"$TREZOR_MODEL\" core/build-xtask/artifacts/latest/firmware.bin"
- run: nix-shell --run "uv run trezorctl list"
- run: nix-shell --run "uv run trezorctl get-features"
- run: |
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.