mirror of
https://github.com/dcarbone/install-jq-action.git
synced 2026-11-25 11:24:59 +00:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* fix(security): verify download integrity and harden install scripts Addresses gaps in the jq install path that could allow a corrupted or tampered binary to be installed into the tool cache and GITHUB_PATH. - Add SHA256 checksum verification for jq 1.7+ downloads (unixish-17.sh, windowsish-17.ps1) against each release's sha256sum.txt. Fails closed on mismatch; warns and proceeds only when no checksum file is published (e.g. jq 1.7.0 and the legacy stedolan 1.5/1.6 releases). - Harden curl in unixish.sh / unixish-17.sh with --fail and --retry so a 404/5xx response no longer exits 0 and writes an error page to disk as the binary. - Validate the JQ_VERSION input (digits and dots only) across all four install scripts, rejecting malformed or path-traversal values before they reach download URLs. - Bump the test-container image from node:20 to node:24 so JS actions run on a supported Node runtime. * fix(security): use portable sha256 for macOS in unixish-17.sh sha256sum is a GNU/coreutils binary and is absent on stock macOS (e.g. the macos-13/macos-14 runner images), which broke checksum verification there with "sha256sum: command not found". Newer images (macos-15/26) ship coreutils and happened to work, but the action must not depend on that. Add a _compute_sha256 helper that prefers sha256sum (Linux) and falls back to shasum -a 256 (ships with macOS via Perl) then openssl, so integrity verification works across all supported runners. * ci: drop macos-13 from test matrix (runner image decommissioned) macOS 13 runner image is closing down (see https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/), so macos-13 jobs sit perpetually queued and can no longer be allocated. Remove it from the matrix; macos-14/15/26 remain. * fix(security): address review feedback on validation and ps1 strings Addresses CoPilot review comments on PR #25: - Tighten JQ_VERSION validation in unixish.sh and unixish-17.sh to require dot-separated numeric components (rejects ".", "..", "1..7", "1.7.", trailing dots) via: printf '%s' "$JQ_VERSION" | grep -Eq '^[0-9]+\.[0-9]+(\.[0-9]+)*$'. Uses printf rather than echo so values like "-n" are passed through to grep rather than consumed as an echo flag. - Add the missing JQ_VERSION validation to windowsish-17.ps1 (the 1.7+ Windows path) before $_dl_url is constructed, matching the check already present in windowsish.ps1. - Fix PowerShell double-quote escaping in error/checksum messages: \" is not a valid escape in PowerShell double-quoted strings and rendered literal backslashes. Use single quotes around interpolated values instead (e.g. 'jq-windows-amd64.exe') so output is clean. All four install scripts now enforce the same version regex and render clean diagnostic output. * fix(security): fail closed on checksum download errors (non-404) The checksum-file fetch treated any download failure as 'checksum file not published' and silently skipped verification — a fail-open path where a transient network error or intentional disruption to the checksum download would bypass integrity verification while the (possibly tampered) binary still installed. - windowsish-17.ps1: in the catch, only treat HTTP 404 as 'not published' (skip with warning); any other failure prints a message and throws to abort the install. (Adopts CoPilot's suggestion.) - unixish-17.sh: same fail-closed logic — capture curl's %{http_code}; 200 verifies, 404 warns+skips, anything else (incl. 000 for DNS/timeout) exits 1. Ports the fix CoPilot flagged on the PowerShell script to the Unix script, which had the identical gap. |
||
| .. | ||
| unixish-17.sh | ||
| unixish.sh | ||
| windowsish-17.ps1 | ||
| windowsish.ps1 | ||