Skip to content

feat(installer): validate manifest-derived version, filename and sha256 before building URLs #167

Closed

Description

@nc9

Part of #164.

The CLI's own updater (apps/cli/src/self/releases.ts) validates every manifest field against strict patterns before using it: isValidReleaseVersion, RELEASE_FILENAME_PATTERN (^[A-Za-z0-9][A-Za-z0-9._-]*$), SHA256_PATTERN, and size as a positive safe integer.

The shell installers do not. install.sh and install.ps1 interpolate version (from the releases endpoint or the GitHub API) and filename (from manifest.json) straight into download URLs. A compromised or misbehaving metadata response containing path segments (../) could retarget the download URL to a different path on the release host. Checksum verification limits the impact, but the checksum also comes from the same manifest, so the scripts should validate inputs the same way the CLI does.

In both install.sh and install.ps1, before use:

  • version must match ^v?[0-9A-Za-z.-]+$ (no slashes)
  • filename must match ^[A-Za-z0-9][A-Za-z0-9._-]*$
  • sha256 must match ^[0-9a-fA-F]{64}$, and the comparison normalizes both sides to lowercase

Acceptance Criteria

  • install.sh aborts with a clear error when the resolved version or filename contains / or any out-of-pattern character
  • install.ps1 applies the same validation with the same patterns
  • the sha256 comparison is case-insensitive in both scripts
  • the patterns match the ones in apps/cli/src/self/releases.ts (single source of truth documented in a comment in each script)

Activity

  1. added
    enhancement
    P2
    size: S
    security
    on Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2enhancementsecuritysize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions