Skip to content

ci(security): prebuilt cargo-audit binary, decouple from repo MSRV - #8

Merged
forkwright merged 1 commit into
mainfrom
fix/cargo-audit-prebuilt-msrv
Jul 7, 2026
Merged

forkwright merged 1 commit into
mainfrom
fix/cargo-audit-prebuilt-msrv

Conversation

@forkwright

Copy link
Copy Markdown
Owner

Summary

The reusable security.yml cargo-audit job compiled cargo-audit from source (cargo install cargo-audit --locked --version ^0.22), which couples cargo-audit's ever-climbing MSRV to each delegating repo's pinned toolchain. On an MSRV-pinned repo this fails both ways:

  • 0.22.x requires rustc ≥ 1.88 to compile → install fails on a repo pinning e.g. 1.85;
  • 0.21.x installs but bundles a rustsec that cannot parse the CVSS-4.0 advisories now present in the RustSec DB → the entire scan errors (unsupported CVSS version: 4.0), independent of the repo's own dependencies.

zetesis (rust-toolchain 1.85) hit exactly this during the 2026-07-07 library-repo fix pass.

Change

Install a prebuilt cargo-audit@0.22.2 binary via taiki-e/install-action (reusing harmonia's fleet-pinned SHA c93ccc0 # v2.82.8) instead of building from source:

  • 0.22.2's rustsec parses CVSS 4.0;
  • a prebuilt binary is toolchain-independent, so every repo delegating to this workflow is covered regardless of MSRV;
  • the exact version is pinned deliberately — a DB-format bump is a reviewed change, never an implicit floor (matches the fleet's cargo-auditable@0.7.4 pinning philosophy);
  • setup-rust-toolchain stays (lets a repo without a committed Cargo.lock generate one for the scan); the rust-cache step is dropped (nothing compiles now).

This is the systemic fix behind the per-repo workaround applied to zetesis.

Fixes kanon#2385.

The cargo-audit job compiled cargo-audit via `cargo install --version ^0.22`,
which couples cargo-audit's climbing MSRV to the target repo's pinned toolchain.
This fails both ways on MSRV-pinned repos: 0.22.x needs rustc >= 1.88 to build,
while 0.21.x bundles a rustsec that cannot parse the CVSS-4.0 advisories now in
the RustSec DB (the whole scan errors out). zetesis (rust-toolchain 1.85) hit
exactly this.

Install a prebuilt cargo-audit@0.22.2 binary via taiki-e/install-action instead
(reusing harmonia's fleet-pinned SHA). The binary's rustsec parses CVSS 4.0 and
its install is toolchain-independent, so every delegating repo is covered
regardless of MSRV. Drop the now-pointless rust-cache step (nothing compiles).
Pin the exact version: a DB-format bump is a deliberate, reviewed change.

Fixes kanon#2385.
@forkwright
forkwright merged commit 764a841 into main Jul 7, 2026
1 check passed
@forkwright
forkwright deleted the fix/cargo-audit-prebuilt-msrv branch July 7, 2026 13:51
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