Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/stack/src/Artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ const definitions: Readonly<Record<ServiceKind, ArtifactDefinition>> = {
),
storage: definition(
"storage",
"v1.73.0",
"ghcr.io/supabase/cli/storage:v1.73.0@sha256:69590a75f916837641976d4018e5ead7c7d2c2305312d9bfb06d86aec8fb1cdd",
"v1.79.14",
"ghcr.io/supabase/cli/storage:v1.79.14@sha256:84efa51b455e952f71f98a2b4f5309307482770d94baf6e72655a02ac69233ba",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ Severity: LOW

This pin secures only the GHCR container: native mode ignores image, while artifactFor builds download URLs from the mutable storage-v1.79.14 release. SlimServicesSource trusts SHA256SUMS fetched from that same release before executing bin/storage; a compromised release asset can therefore achieve code execution on a developer host.
Helpful? Add 👍 / 👎

💡 Fix Suggestion

Suggestion: To address the trust-on-first-use risk for native binaries, add hardcoded per-target SHA256 checksums to each service's artifact definition and use them as the authoritative source rather than the dynamically fetched SHA256SUMS file from the same mutable GitHub release. Specifically: (1) Extend the ArtifactDefinition interface (around line 48) to include a checksums: Readonly<Record<NativeTarget, string>> field mapping each target platform to its expected SHA256 hash. (2) Update the definition() helper function (around line 56) to accept and store these per-target checksums. (3) Update the storage definition (lines 92–98) to include the actual SHA256 hex digests for each target (darwin-arm64, linux-amd64, linux-arm64) — these values must be obtained out-of-band from a trusted source and committed alongside the version pin. (4) Modify artifactFor (lines 160–183) to pass the pinned checksum for the selected target into SlimServicesArtifact. (5) Update SlimServicesSource.ts's slimServicesChecksum function (around line 209) to compare the network-fetched checksum against the pinned value rather than trusting the downloaded SHA256SUMS file unconditionally. This ensures that even if the GitHub release assets are replaced, the in-code checksum acts as a pinned root of trust that cannot be silently bypassed.

"bin/storage",
["bin/storage", "bin/prepare"],
),
Expand Down
Loading