Skip to content

fix(workflow): route sync target input through env in bootstrap step - #1287

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1279-sync-target-env-indirection
Jul 28, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1279-sync-target-env-indirection

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

The DEVKIT_SYNC_TARGET mirror-bootstrap step (injected at scaffold time by render_sync_settings() in assets/init-workspace.sh) interpolated the target-branch workflow_dispatch input directly into its run: block — a zizmor template-injection (High) in the rendered consumer workflow. First hit in the wild: vig-os/org-config#80, which carries a local forward-port of this exact fix until the template ships it. The #1182 hardening sweep never saw it because the step only renders when the knob is set.

The heredoc now uses standard env indirection, matching the template's existing TARGET_BRANCH: pattern: the dispatch input is forwarded as TARGET_INPUT in the step's env:, and the run body reads TARGET="${TARGET_INPUT:-<manifest-target>}". The scaffold-time default is safe as a literal — DEVKIT_SYNC_TARGET is allowlist-validated ([A-Za-z0-9._/-]) at scaffold time. Cron-triggered runs still fall back to the default (empty input → :- expansion).

Changes

  • assets/init-workspace.sh — env indirection in the bootstrap-step heredoc
  • tests/bats/init-workspace.bats — new test: rendered bootstrap step forwards the input via env, has no inline ${{ github.event.inputs in the run body, and still lands the default (TDD: committed RED first)
  • CHANGELOG.md + assets/workspace/.devcontainer/CHANGELOG.md — ### Security entry (mirror synced by the sync-manifest hook)

Verification

  • TDD: test committed failing (26bdb254), fix turns it green (953a930a)
  • Full bats tests/bats/init-workspace.bats: 244/244 ok, including the hostile-DEVKIT_SYNC_TARGET guard test
  • Rendered scaffold (with DEVKIT_SYNC_TARGET=sync/issue-mirror) structural check: 0 inline ${{ github.event.inputs in the run body, 1 TARGET_INPUT: env forward; rendered form is functionally identical to org-config#80's forward-port
  • shellcheck on assets/init-workspace.sh: clean; prek run --all-files: all hooks green

Rollout note

org-config#80 can drop its local forward-port once this ships — and conversely, org-config's next devkit upgrade would re-introduce the zizmor finding if this doesn't ship first.

Closes #1279

@c-vigo c-vigo added this to the 1.4.3 milestone Jul 28, 2026
@c-vigo
c-vigo merged commit 0bc5ac0 into dev Jul 28, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1279-sync-target-env-indirection branch July 28, 2026 13:42
c-vigo added a commit that referenced this pull request Jul 28, 2026
…on blocks (#1288)

## Summary

Advances the pinned `nixpkgs` rev from nixos-26.05 @ `34268251`
(2026-06-22) to @ `8623c4c2` (2026-07-26) and drops the `.vulnixignore`
exception blocks whose fixes have propagated to the channel.
Deliberately kept out of the 1.4.2 patch train (mass rebuild); the jq
block's expiry (2026-08-03) was the nearest deadline.

## Before/after vulnix diff (per docs/CONTAINER_SECURITY.md §4)

Scanned `.#devkitImageEnv` closure at both pins against the nvd-mirror.
**Unique CVEs: 112 → 56. No new HIGH/CRITICAL (CVSS ≥ 7.0) findings
introduced.**

| Package | Before | After | Register action |
|---|---|---|---|
| openssl | 3.6.2 | **3.6.3** | block dropped (10 CVEs) |
| curl | 8.20.0 | **8.21.0** | block dropped (17 CVEs) |
| openssh | 10.3p1 | **10.4p1** | block dropped (CVE-2026-60002) |
| jq | 1.8.1 | **1.8.2** | CVE-2026-49839 entry dropped (line-granular;
shared `Expiration: 2026-08-03` directive and libssh2/socat survivors
preserved) |
| unbound | 1.25.1 | 1.25.1 | kept — fix not propagated |
| gawk | 5.4.0 | 5.4.0 | kept — fix not propagated |
| podman | 5.8.2 | 5.8.2 | kept — fix not propagated |
| fzf | 0.72.0 | 0.72.0 | kept — fix not propagated |
| libssh2 | 1.11.1 | 1.11.1 | kept — fix not propagated |

- Kept blocks' re-verification notes refreshed to 2026-07-28 with the
new pin context.
- New surface: jq 1.8.2 shows three unrelated advisories (CVE-2026-33948
5.3, CVE-2026-39979 6.5, CVE-2026-44777 5.5) — all below the 7.0 gate
threshold, awareness-only, **no new exceptions added**.
- gzip/ldns/libxml2 also cleared from the report incidentally; their
(harmless, non-gating) register entries were left untouched per minimal
diff.

## Verification

- `nix flake update nixpkgs` — flake.lock diff touches only the nixpkgs
node
- `uv run check-expirations .trivyignore .vulnixignore` — 37 exceptions
validated, exit 0
- `uv run vulnix-gate vulnix-after.json --register .vulnixignore` — "No
unexcepted HIGH/CRITICAL findings (CVSS >= 7.0); 33 exception(s)
applied", exit 0 (independently re-run at review)
- `nix build .#devkitImage` — image builds at the new pin
- `prek run --all-files` — all hooks green
- TDD n/a (lockfile + exception-register change)

Includes a merge of current dev (changelog-overlap resolution with
#1286/#1287).

Closes #1273
@c-vigo c-vigo modified the milestones: 1.4.3, 1.5.0 Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant