Skip to content

Verify checksum in official CLI install scripts - #3704

Merged
ehl-jf merged 2 commits into
masterfrom
feature/JGC-543
Sep 8, 2026
Merged

ehl-jf merged 2 commits into
masterfrom
feature/JGC-543

Conversation

@ehl-jf

@ehl-jf ehl-jf commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The five official install scripts (build/getcli/jf.sh, build/getcli/jfrog.sh, build/installcli/jf.sh, build/installcli/jfrog.sh, build/setupcli/jf.sh) now verify the downloaded jf/jfrog binary's SHA256 before ever chmod +x-ing or installing it onto PATH, and no longer skip TLS verification (curl -k removed).

The checksum is fetched from the per-binary .sha256 sidecar JGC-542 publishes at the exact same path as the binary (e.g. jfrog-cli-linux-amd64/jf.sha256) — verified end-to-end against the real, published releases.jfrog.io endpoint. The install aborts (deleting the partial binary) on a checksum mismatch, an unreachable/missing sidecar, or an empty/malformed one, with failure messages naming both the binary and checksum URLs and both hashes where relevant.

Adds a dependency-free test driver (build/scripts_test/run_tests.sh, 17 cases) that builds fixtures on the fly matching whatever OS/arch the machine actually is — real subprocess execution against file:// URLs, no mocks, no network dependency — and wires it into CI alongside a new smoke test for build/setupcli/jf.sh, which previously had no coverage at all.


  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • The pull request is targeting the master branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....

Comment thread build/setupcli/jf.sh Resolved
Comment thread build/setupcli/jf.sh Resolved
The five official install scripts (build/getcli/jf.sh, build/getcli/jfrog.sh,
build/installcli/jf.sh, build/installcli/jfrog.sh, build/setupcli/jf.sh) now
verify the downloaded jf/jfrog binary's SHA256 before ever chmod +x'ing or
installing it onto PATH, and no longer skip TLS verification (curl -k
removed).

The checksum is fetched from the per-binary .sha256 sidecar JGC-542
publishes at the exact same path as the binary (e.g.
jfrog-cli-linux-amd64/jf.sha256), matching the live production format:
a bare 64-character hex digest, verified end-to-end against the real,
published releases.jfrog.io endpoint. The install aborts - deleting the
partial binary - on a checksum mismatch, an unreachable/missing sidecar,
or an empty/malformed one, with failure messages naming both the binary
and checksum URLs and both hashes where relevant.

Adds a dependency-free test driver (build/scripts_test/run_tests.sh, 17
cases) that builds fixtures on the fly matching whatever OS/arch the
machine actually is - real subprocess execution against file:// URLs, no
mocks, no network dependency - and wires it into CI alongside a new smoke
test for build/setupcli/jf.sh, which previously had no coverage at all.
…l scripts

The env var let anyone set BASE_URL for both the binary download and its
checksum sidecar to the same attacker-controlled server, trivially
defeating checksum verification. Hardcode BASE_URL in all 5 scripts and
have the test harness redirect fixtures by sed-patching a throwaway
script copy instead.
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@ehl-jf
ehl-jf merged commit 30a0a1f into master Sep 8, 2026
249 of 251 checks passed
@ehl-jf
ehl-jf deleted the feature/JGC-543 branch September 8, 2026 09:46

This branch was previously deployed

1 inactive deployment
build-gate — ec745d0c Deployed Sep 8, 2026 by ehl-jf via Approval gate #1137
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants