…t by arch (#838)
The release signature covers plugin.yaml, but sha256: on a fetch step was
optional, so a signed spec could download an unverified artifact and spored
would run it as root. Every remote fetch must now pin its download:
- Validate and CheckArtifactPins refuse a fetch with no (or a malformed)
sha256, a negative size or an unknown arch. spored checks the whole spec
before any install step runs, on every path (push API and launch-time
declarations), and fetch() itself refuses an unpinned step before a byte
is requested.
- New optional size: (exact byte length, read at most one byte past it) and
arch: (x86_64|arm64, aliases amd64|aarch64) on fetch steps, so a spec can
pin a different artifact per architecture instead of curling in a run step.
- spawn plugin inspect shows arch, size and the sha256, and marks an
unpinned fetch REFUSED.
Compatibility: refused, no warning period. No tagged spore-plugins release
has a fetch step, so no official install breaks.
Fixes #838
What
A plugin signature covers
plugin.yaml, butsha256:on afetchstep was optional. A signed, verified spec could therefore download whatever its URL served, and spored ran it as root. The digest afetchstep carries is insideplugin.yaml, so the release manifest and its cosign signature already cover it.manifest.jsondoesn't change. What was missing was a requirement to set it, plus a way to pin per-architecture artifacts so plugins stop working aroundfetchwithcurlinrunsteps.sha256:required on every remotefetchstep. It is enforced in three places:Validate, used byspawn plugin validate, byspawn plugin installbefore any local step, and by spored's push API.plugin.CheckArtifactPins, which spored runs inInstallWithProvenancebefore any step. That covers launch-time declarations, which skipValidate.RemoteExecutor.fetch, which refuses an unpinned step before making a request.size:(optional): the exact byte length. spored reads at most one byte past it, and on any other length it deletes the file and fails.arch:(optional):x86_64/amd64orarm64/aarch64. The fetch runs only on that architecture, so a spec can pin a different artifact, with its own sha256, per architecture.spawn plugin inspectshows arch, size and the sha256 prefix, and shows an unpinned fetch asREFUSED — no sha256.Compatibility policy: refuse, no warning release
An unpinned
fetchis refused for every source: official,github:and local.--insecuredoes not bypass it. I chose this over warn-then-refuse because a warning release keeps the hole open and protects no one. Measured 2026-11-08: none of the 12 tagged releases inspore-host/spore-pluginshas afetchstep at all, so no official install breaks. Third-party and local specs with an unpinned fetch do break.validatenames each step, and the fix is to addsha256:. The CHANGELOG states this under Security.Third-party (
github:) specs are held to the same rule, which settles #838's open question 3. The author's pin doesn't make the author trustworthy, but it does stop the URL's content changing underneath a spec someone reviewed. It also keeps spored's rule one rule, independent of where the spec came from.Not covered (stated in the CHANGELOG)
A download inside a
runstep (curl … | sh,pip install) is opaque to spawn. spore-plugins now has CI that fails new ones and lists the ten plugins that still do this (spore-host/spore-plugins#33).Release order
mountpoint-s3to four pinnedfetchsteps (sha256 + size + arch). It validates and runs on the current spawn: an older spawn ignoresarch:/size:and fetches all four, each still sha256-checked by spored ≥ v0.86.0. Merge it, then push the tagmountpoint-s3-v1.0.1so the release workflow signs it.Strictly, neither order breaks an official install, because no tagged plugin has a
fetchstep. The order above makes sure the first spawn that enforces pins already has a pinnedmountpoint-s3to resolve as latest.Tests
pkg/pluginruntime:arch:selects the right artifact on amd64 and on arm64.pkg/plugin: a pin-problem table run through bothValidateandCheckArtifactPins, every remote section, andStepRunsOnArch.cmd: inspect output.TestValidatorAcceptsExactlyWhatTheExecutorsRun) now builds a "bare" fetch with its required sha256, and coverssize/arch.&& false): the unpinned refusal, the arch filter, the install-time check, the size check, the hash check, and the Validate wiring.Local runs:
make check(GOTOOLCHAIN=go1.27.3, AWS env stripped): gofmt, vet ×3 GOOS, staticcheck, golangci-lint and the hermetic short tests all pass. Two later steps failed locally only because the clone's path contains a space (/Volumes/External HD):lambda/dashboard-apiTestSetupAllRunsEveryStepFromAnyDirectoryandcheck-build-tags. Neither touches these files, and CI on Linux is authoritative.semgrep scan --config=auto --error .: clean.spawn plugin validate --stricton every spore-plugins spec (main and the spawn launch fails with "failed to parse JSON" when stdin is a pipe (non-interactive) #34 branch): passes with this build and with v0.161.0.