Skip to content

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 11 Oct 18:19
· 52 commits to main since this release

v0.6.0 — the release where the macOS binaries actually start

If you downloaded selo-darwin-arm64 or selo-darwin-amd64 from v0.4.1,
v0.5.0 or v0.5.1, that binary cannot start on a current macOS. This release
fixes it.
Everything else here is housekeeping; that is the one that mattered.

Nothing about the receipt format, the policy format or the CLI changed. If you
were on Linux, you were never affected, and this upgrade is a no-op for you.

What was broken

The darwin binaries in v0.4.1, v0.5.0 and v0.5.1 were all missing the Mach-O
LC_UUID load command:

$ otool -l selo-darwin-arm64 | grep -c LC_UUID
0

Newer macOS dyld refuses to load a Mach-O without it:

dyld: missing LC_UUID load command in ./selo
signal: abort trap

So the failure mode was this: read the README, run install.sh, watch it verify a
SHA-256 against checksums.txt, watch cosign verify-blob succeed against the
pinned workflow identity, watch slsa-verifier confirm the provenance — and then
get abort trap when you ran the binary. The installer worked perfectly. The tool
it installed could not run.

Post-mortem

Root cause. Go toolchains before 1.24 omit LC_UUID from darwin binaries.
Not "sometimes", not "under some flags": the toolchain decides it, and
CGO_ENABLED and -ldflags "-s -w" make no difference. Measured:

toolchain LC_UUID in a darwin binary
1.21.13 absent
1.22.0 absent
1.23.0 absent
1.24.0 present
1.25.5 present

The release workflow pinned go-version-file: go.mod, and go.mod says
go 1.21. So the release job had been building with 1.21 the whole time, and
had been quietly shipping macOS binaries that the loader rejects. The CI leg that
would have caught it only ran on Linux, and Linux does not care about LC_UUID.

Why nothing noticed. install.sh verifies supply-chain integrity: the bytes
are ours, they are unmodified, and they were built by this workflow from this
commit. A binary that cannot be loaded satisfies every one of those properties
perfectly. Loadability is a property of the loader, not of the bytes, so no
amount of hashing or signing can see it. The trust chain was complete and
pointed at an unusable artifact.

How it surfaced. Only when CI was extended to run on macos-latest. The
macOS job went red, and — this is the tell — only the test binaries that import
net/net/http died. Those are the ones that take Go's external-linking path,
and it is that path where the missing load command bites. A partial failure set
like that is a toolchain signature, not a test bug. otool -l on the downloaded
v0.5.1 assets confirmed LC_UUID: 0 on both darwin binaries.

What changed

The toolchain is pinned to a floor, not to go.mod. Both workflows now set
go-version: '1.24.x' with a comment explaining why. go-version-file: go.mod
must not come back — it resolves to 1.21 and silently reintroduces this.

Loadability is now a fail-closed release gate. scripts/check-macho-uuid is
a small Go command that parses the Mach-O load commands and fails if LC_UUID is
absent. It runs in the release job before anything is signed or published, so a
non-loadable binary can no longer reach a release page:

ok    selo-darwin-arm64 carries LC_UUID
ok    selo-darwin-amd64 carries LC_UUID

It exits 0 only when every Mach-O input carries the load command, 1 if any
does not or any input cannot be read, and 2 if no Mach-O was checked at all —
so a glob that matches nothing fails rather than passing vacuously. Non-Mach-O
inputs (the Linux ELF binaries) are reported and skipped. CI runs the same check
on the macOS leg, so a toolchain regression fails on the commit that introduces
it rather than at tag time.

Receipt IDs no longer collide on a coarse clock. GenerateReceiptID returned
c1f-<UnixNano>, but macOS reports time.Now() at microsecond granularity —
measured 1000 ns on darwin/amd64. Calls landing in the same tick produced the same
id: 3217 duplicates out of 5000 back-to-back calls. That is not cosmetic, because
the id is the receipt's file name (receipts/c1f-<id>.json), so a duplicate
overwrote an earlier receipt instead of writing a new one. The old test compared
two ids, which usually straddled a tick and passed by luck. GenerateReceiptID
now holds a mutex and steps past the previous id; a new test asserts 5000
consecutive ids are distinct. This had been hidden behind the dyld abort too —
internal/receipt's test binary never ran on macOS at all.

Fixed

  • A malformed glob in a scope contract silently disabled that boundary.
    VerifyScopeContract evaluated each allowed_paths / forbidden_paths entry
    with filepath.Match and dropped the error, so a pattern that does not compile
    matched nothing and the run still reported clean. An operator who typed [a-z
    instead of [a-z]* turned the control off with no signal. Patterns are now
    validated at config load and at the top of the contract check; an invalid one
    refuses the run and names the field and the pattern. (The validation probes each
    pattern against its own bytes — filepath.Match returns ErrBadPattern only
    for the chunks it walks, so probing with a short string misses a malformed chunk
    further along.)
  • The forbidden-claims scan failed open. It shelled out to grep and
    discarded the error, so on a host without grep — or with a grep that
    rejected the arguments — every term was silently skipped and the control
    reported no forbidden claims. It was also weaker than its own diff-scoped
    sibling: plain substring matching (missing pr0duct1on_ready) over 7 file
    extensions (missing .yml and .py). Both paths now share one in-process
    matcher, so they cannot disagree.
  • install.sh no longer invokes sudo unnecessarily, and no longer fails
    spuriously when grep loses a SIGPIPE race on the version lookup.

Security

  • SECURITY.md now draws the boundary explicitly. New section: What
    install.sh verifies — and what it does not
    . install.sh proves supply-chain
    integrity and provenance; loadability is enforced fail-closed at build time by
    the release job. Together they are the delivery trust chain; neither alone is
    sufficient.
  • The documented cosign identity used the wrong case. SECURITY.md told users
    to pin C1-run/selo. cosign's identity regexp is case-sensitive, so anyone
    following the docs would have rejected our own signature. Now C1-run/Selo,
    matching install.sh.

Upgrade notes

  • Go 1.24 or newer is required to build a working darwin binary. Building with
    1.21–1.23 still compiles; the resulting macOS binary just will not load. The
    go directive in go.mod is unchanged, so nothing breaks for contributors on
    older toolchains building for Linux.
  • If you are on macOS and on v0.5.1 or earlier, upgrade. Your current binary may
    work on an older macOS and fail on a newer one, which is a confusing way to
    discover this.
  • No config, receipt or policy changes. Receipts written by v0.5.x verify
    unchanged.

Closing note

This shipped broken for three releases and nobody reported it. We found it by
extending CI to macos-latest and taking the red job seriously instead of
rerunning it. The unflattering version of this story is that a project whose
entire pitch is verifiable provenance spent three releases cryptographically
attesting to an artifact that could not start — and its own verifier could not
tell.

That is the argument for running your CI on the platform you ship to, and for
treating "the binary cannot load" as a first-class failure mode of a release
pipeline rather than something the installer is expected to notice.

Full Changelog: v0.5.1...v0.6.0