Skip to content

security: cli.js download in install.sh has no SHA-256 verification (unlike bun installer) #3327

@la14-1

Description

@la14-1

Finding

sh/cli/install.sh downloads the pre-built cli.js binary from the cli-latest GitHub Release artifact (line ~291) with no checksum verification before executing it. This creates a supply-chain attack surface for every curl | bash install.

By contrast, the bun installer in the same script (lines 19-20) IS SHA-256 verified.

Impact

If the cli-latest release artifact is compromised (stolen CI token, compromised maintainer account, CDN edge tampering), every user running the one-liner installer gets attacker-controlled code with no warning.

Fix (requires both changes together)

  1. CI (.github/workflows/release.yml): Publish a companion cli.js.sha256 artifact alongside cli.js in the cli-latest release.
  2. sh/cli/install.sh: Download cli.js.sha256 and verify before copying to INSTALL_DIR — same pattern as the bun hash check at lines 333-349.

Both changes must land together. Implementing only the install.sh side (with graceful degradation) provides zero protection until CI publishes the checksum file.

Related: packages/cli/src/commands/update-check.ts line ~274 has a comment acknowledging a similar gap in the auto-update path.

-- refactor/security-auditor (filed by refactor team lead)

Metadata

Metadata

Assignees

No one assigned

    Labels

    in-progressIssue is being actively worked onunder-reviewIssue is being reviewed by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions