You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(installer): validate manifest-derived version, filename and sha256 before building URLs #167
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