Skip to content

security: sign juliaup SHA256SUMS and verify Julia tarball hashes - #1457

Draft
IanButterworth wants to merge 1 commit into
ib/security_verify_installsfrom
ib/security_verify_installs_more
Draft

security: sign juliaup SHA256SUMS and verify Julia tarball hashes#1457
IanButterworth wants to merge 1 commit into
ib/security_verify_installsfrom
ib/security_verify_installs_more

Conversation

@IanButterworth

Copy link
Copy Markdown
Member

On top of #1455 and #1456.

Developed with Claude:


What this adds

Signature verification for the SHA256SUMS file (non-Windows)

The unsigned SHA256SUMS file introduced in #1456 could itself be replaced by a server-side attacker. This PR closes that gap:

  • A project Ed25519 keypair is generated with minisign. The public key is embedded as JULIAUP_MINISIGN_PUBLIC_KEY in src/operations.rs.
  • CI (package-unix) signs the SHA256SUMS file immediately after creating it; the .minisig is uploaded to S3 alongside the archives.
  • download_sha256sums_entry now fetches <url>.minisig first, verifies the signature against the embedded key, and only then returns the hash. An invalid signature is a hard error before any bytes touch disk.
  • Adds minisign-verify = "0.2" (non-Windows only).
  • The private key must be added as the JULIAUP_MINISIGN_SECRET_KEY secret in the GitHub package Actions environment before releasing.

SHA256 verification extended to Julia version tarballs (non-Windows, non-macOS)

  • JuliaupVersionDBVersion gains an optional Sha256 field.
  • updateversiondb.jl now emits "Sha256" from the upstream versions.json (the value was already fetched but discarded).
  • install_version calls download_extract_sans_parent_verified when the DB entry includes a hash; falls back to the unverified path for older entries that predate the field.

juliaup SHA256SUMS signing (non-Windows):
- CI package-unix job now signs the SHA256SUMS file immediately after
  creating it; the .minisig is uploaded to S3 alongside the archives.
- download_sha256sums_entry fetches <url>.minisig, verifies the signature
  against the JULIAUP_MINISIGN_PUBLIC_KEY constant embedded in
  operations.rs, then returns the hash. Bails before touching disk if
  the signature is invalid.
- JULIAUP_MINISIGN_SECRET_KEY Actions secret (package environment) holds
  the private key; the public key is baked into the binary.
- Adds minisign-verify = "0.2" (non-Windows only).

Julia tarball SHA256 verification (non-Windows, non-macOS):
- JuliaupVersionDBVersion gains an optional Sha256 field.
- updateversiondb.jl now emits "Sha256" from the upstream versions.json
  (was already fetched but discarded).
- install_version uses download_extract_sans_parent_verified when the
  DB entry carries a Sha256; falls back to the unverified path for
  older entries that predate the field.

Co-Authored-By: Claude <claude@users.noreply.github.com>
@fingolfin

Copy link
Copy Markdown
Member

clippy test fails

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.

2 participants