Skip to content

ci: gate setup-bun cache off tag refs (zizmor cache-poisoning)#23

Open
John-David Dalton (jdalton) wants to merge 2 commits into
mainfrom
fix/ci-cache-poisoning-setup-bun
Open

ci: gate setup-bun cache off tag refs (zizmor cache-poisoning)#23
John-David Dalton (jdalton) wants to merge 2 commits into
mainfrom
fix/ci-cache-poisoning-setup-bun

Conversation

@jdalton

Copy link
Copy Markdown
Collaborator

What

🔎 Check fails on every recent run with a zizmor high-severity finding, exit 14:

```
error[cache-poisoning]: runtime artifacts potentially vulnerable to a cache poisoning attack
--> .github/workflows/ci.yml:128:9
128 | uses: oven-sh/setup-bun@22457c8
| ^^^ enables caching by default
```

ci.yml runs on push: tags: ['*'] and the repo-local Setup Bun step (oven-sh/setup-bun) caches by default. A tag/release ref restoring a bun cache that a less-trusted branch/PR run populated is the cache-poisoning vector zizmor flags.

Fix

Gate the setup-bun cache off for tag refs only:

```yaml
no-cache: ${{ startsWith(github.ref, 'refs/tags/') }}
```

Ordinary branch and PR CI keep a warm bun cache; only release-shaped refs skip it. This is zizmor's documented remediation (disable caching for tag/release events, keep it elsewhere) and is more surgical than a wholesale no-cache: true.

Scope

This is a bun-security-scanner-local workflow step, not a fleet-source issue. The fleet-standard actions nest their caching inside composite actions (which zizmor's cache-poisoning audit does not descend into) and their publish workflows are workflow_dispatch-triggered, so the fleet actions themselves are clean.

Verification

  • Before: zizmor .github --min-severity medium (the exact 🔎 Check invocation, zizmor 1.26.1 per external-tools.json) -> exit 14, 1 high.
  • After: same invocation -> exit 0, no findings. 0 cache-poisoning findings even at --min-severity low.
  • pre-commit hook passed locally (lint + full bun test: 47 pass, 2 skip, 0 fail).

ci.yml runs on `push: tags: ['*']` and the repo-local `Setup Bun`
step (oven-sh/setup-bun) caches by default. zizmor's cache-poisoning
audit flags this as high severity (error[cache-poisoning] at
ci.yml:128) — a tag/release ref could restore a bun cache a
less-trusted branch/PR run populated, so the CI "Check" step exits 14.

Gate the setup-bun cache off for tag refs only
(no-cache when github.ref starts with refs/tags/). Ordinary branch
and PR CI keep a warm bun cache; only release-shaped refs skip it,
which is zizmor's documented remediation.

This is a bun-security-scanner-local workflow step, not a fleet-source
issue — the fleet-standard actions nest caching inside composites and
their publish workflows are workflow_dispatch-triggered, so they don't
trip this audit.
…llowlisted)

The release-tier 🔎 Check (check-package-files-are-allowlisted) failed
with two findings on the publish output:

  - [missing_essential]: no file matching ^LICENSE(\.md|\.txt)?$ —
    every published package must ship a README and LICENSE. package.json
    declares "license": "MIT" but no LICENSE file existed.
  - [undershoot]: `files` entry `CHANGELOG.md` matched nothing in the
    publish output — the file was listed but never seeded.

Add a standard MIT LICENSE (Copyright (c) 2025 Socket Inc, matching the
sibling fleet repos) and seed a Keep-a-Changelog CHANGELOG.md with an
`## [Unreleased]` section the release pipeline prepends to. Both are
repo-local; no fleet-source change needed.
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