@devries-cameron20 / composio Mirror · read-only / commits / bd071f528
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 17:15 UTC

fix(cli): require checksum verification for official release downloads

For the default ComposioHQ GitHub source a missing checksums.txt or a missing manifest entry is now a hard error instead of a warning; malformed entries and mismatches stay fatal for every source. Overridden mirrors keep the lenient path, and a missing SHA-256 utility still warns that verification was skipped.

jkomyno committed Aug 4, 2026 at 00:15 UTC bd071f528c7519b7fdbbdb48b52114f1b8e0a634
2 files changed +78 -5
install.sh
+18 -1
@@ -223,6 +223,9 @@ verify_checksum() {
223 checksum_expected=$(awk -v name="$checksum_name" '$2 == name || $2 == "*" name { print $1; exit }' "$checksum_manifest")
224
225 if [ -z "$checksum_expected" ]; then
226 + if [ "$official_release_source" = 1 ]; then
227 + error "checksums.txt has no entry for $checksum_name. Official releases always publish complete checksums, so this release cannot be verified. Refusing to install."
228 + fi
229 warn "No checksum entry found for $checksum_name; continuing without verification"
230 return 0
231 fi
@@ -234,7 +237,7 @@ verify_checksum() {
237 elif command -v shasum >/dev/null 2>&1; then
238 checksum_actual=$(shasum -a 256 "$checksum_archive" | awk '{ print $1 }')
239 else
237 - warn 'No SHA-256 utility found; continuing without verification'
240 + warn 'Checksum verification skipped: no SHA-256 utility (sha256sum or shasum) is available on this system'
241 return 0
242 fi
243
@@ -835,6 +838,18 @@ main() {
838 github_api_repo=$github_api_base/repos/$COMPOSIO_GITHUB_OWNER/$COMPOSIO_GITHUB_REPO
839 archive_name=composio-$target.zip
840
841 + # Official ComposioHQ releases always publish a complete checksums.txt, so
842 + # a missing manifest or entry is a hard error there. Any overridden source
843 + # (mirror, test host, custom API base) keeps the lenient warn-and-continue
844 + # behavior, since its manifests are outside our control.
845 + official_release_source=0
846 + if [ "$COMPOSIO_GITHUB_URL" = https://github.com ] &&
847 + [ "$COMPOSIO_GITHUB_OWNER" = ComposioHQ ] &&
848 + [ "$COMPOSIO_GITHUB_REPO" = composio ] &&
849 + [ -z "$COMPOSIO_GITHUB_API_BASE_URL" ]; then
850 + official_release_source=1
851 + fi
852 +
853 requested_version=$version_arg
854 if [ -z "$requested_version" ]; then
855 requested_version=${COMPOSIO_INSTALL_VERSION:-}
@@ -871,6 +886,8 @@ main() {
886
887 if curl_download "$checksums_url" "$tmpdir/checksums.txt" 1; then
888 verify_checksum "$tmpdir/$archive_name" "$tmpdir/checksums.txt" "$archive_name"
889 + elif [ "$official_release_source" = 1 ]; then
890 + error "Failed to download checksums.txt from \"$checksums_url\". Official releases always publish checksums, so this release cannot be verified. Refusing to install."
891 else
892 warn 'No checksums.txt in this release; continuing without verification'
893 fi
test/install-sh-release-resolution.test.sh
+60 -4
@@ -324,6 +324,7 @@ JSON
324 valid) printf '%064d %s\n' 0 "$TEST_ARCHIVE_NAME" | tr '0' 'a' >"$output" ;;
325 mismatch) printf '%064d %s\n' 0 "$TEST_ARCHIVE_NAME" | tr '0' 'b' >"$output" ;;
326 malformed) printf 'not-a-hash %s\n' "$TEST_ARCHIVE_NAME" >"$output" ;;
327 + absent-entry) printf '%064d %s\n' 0 'some-other-asset.zip' | tr '0' 'a' >"$output" ;;
328 esac
329 ;;
330 *)
@@ -444,7 +445,7 @@ EOF
445 export TEST_COMPOSIO_LOG="$composio_log"
446
447 reset_case() {
447 - unset CASE_GITHUB_URL CASE_API_BASE CASE_INSTALL_VERSION CASE_INSTALL_SHELL CASE_PLUGINS CASE_QUIET CASE_DEBUG CASE_HELP
448 + unset CASE_GITHUB_URL CASE_GITHUB_OWNER CASE_GITHUB_REPO CASE_API_BASE CASE_INSTALL_VERSION CASE_INSTALL_SHELL CASE_PLUGINS CASE_QUIET CASE_DEBUG CASE_HELP
449 unset CASE_ALLOW_HTTP_HOST CASE_CHECKSUM_MODE CASE_API_ASSET_URL CASE_BASE_MODE CASE_REDIRECT_DOWNGRADE
450 unset CASE_SHELL_CAPABILITY CASE_INSTALL_EXIT CASE_SETUP_EXIT CASE_VERSION_EXIT CASE_PATH_PREFIX CASE_UNSET_SHELL
451 unset CASE_CURL_DELAY_URL CASE_CURL_DELAY_SECONDS CASE_SHELL_VALUE CASE_INSTALL_HINT CASE_INSTALL_RECONCILE
@@ -465,9 +466,11 @@ EOF
466 COMPOSIO_BIN_DIR="$bin_dir"
467 COMPOSIO_INSTALL_PLUGINS="${CASE_PLUGINS:-0}"
468 COMPOSIO_GITHUB_URL="${CASE_GITHUB_URL:-$github_url}"
468 - COMPOSIO_GITHUB_API_BASE_URL="${CASE_API_BASE:-$api_base}"
469 - COMPOSIO_GITHUB_OWNER=FakeOwner
470 - COMPOSIO_GITHUB_REPO=fake-repo
469 + # CASE_API_BASE set-but-empty passes an empty API base through, which the
470 + # installer treats as "no override" (official-source cases need this).
471 + COMPOSIO_GITHUB_API_BASE_URL="${CASE_API_BASE-$api_base}"
472 + COMPOSIO_GITHUB_OWNER="${CASE_GITHUB_OWNER:-FakeOwner}"
473 + COMPOSIO_GITHUB_REPO="${CASE_GITHUB_REPO:-fake-repo}"
474 TEST_CHECKSUM_MODE="${CASE_CHECKSUM_MODE:-missing}"
475 TEST_SHELL_CAPABILITY="${CASE_SHELL_CAPABILITY:-supported}"
476 TEST_INSTALL_EXIT="${CASE_INSTALL_EXIT:-0}"
@@ -630,6 +633,59 @@ EOF
633 grep -qi 'checksum' <<<"$checksum_output" || fail "$interpreter_name $checksum_mode checksum error"
634 done
635
636 + # Overridden sources (mirrors, test hosts) keep the lenient behavior: a
637 + # missing checksums.txt or a manifest without an entry for the archive warns
638 + # and the install proceeds.
639 + reset_case
640 + CASE_CHECKSUM_MODE=missing
641 + lenient_output=$(run_installer "$case_root/lenient-home" "$case_root/lenient-install" "$case_root/lenient-bin" "$stable_tag" 2>&1) ||
642 + fail "$interpreter_name overridden source with missing checksums.txt must proceed"
643 + assert_contains "$lenient_output" 'No checksums.txt in this release; continuing without verification' \
644 + "$interpreter_name overridden-source missing manifest warning"
645 + [[ -x "$case_root/lenient-install/composio" ]] || fail "$interpreter_name overridden-source missing manifest must still install"
646 +
647 + reset_case
648 + CASE_CHECKSUM_MODE=absent-entry
649 + entry_lenient_output=$(run_installer "$case_root/entry-lenient-home" "$case_root/entry-lenient-install" "$case_root/entry-lenient-bin" "$stable_tag" 2>&1) ||
650 + fail "$interpreter_name overridden source with no checksum entry must proceed"
651 + assert_contains "$entry_lenient_output" 'No checksum entry found' "$interpreter_name overridden-source absent entry warning"
652 +
653 + # The official ComposioHQ source always publishes complete checksums, so the
654 + # installer must hard-fail there when the manifest or the entry is missing.
655 + # The env triple below matches the installer defaults exactly; the pinned
656 + # version tag keeps the release API (and its overridden base) out of play.
657 + official_env() {
658 + CASE_GITHUB_URL=https://github.com
659 + CASE_GITHUB_OWNER=ComposioHQ
660 + CASE_GITHUB_REPO=composio
661 + CASE_API_BASE=
662 + }
663 +
664 + reset_case
665 + official_env
666 + CASE_CHECKSUM_MODE=valid
667 + run_installer "$case_root/official-valid-home" "$case_root/official-valid-install" "$case_root/official-valid-bin" "$stable_tag" >/dev/null 2>&1 ||
668 + fail "$interpreter_name official source with a valid checksum must install"
669 + [[ -x "$case_root/official-valid-install/composio" ]] || fail "$interpreter_name official-source valid checksum install"
670 +
671 + reset_case
672 + official_env
673 + CASE_CHECKSUM_MODE=missing
674 + if official_missing_output=$(run_installer "$case_root/official-missing-home" "$case_root/official-missing-install" "$case_root/official-missing-bin" "$stable_tag" 2>&1); then
675 + fail "$interpreter_name official source with a missing checksums.txt must fail"
676 + fi
677 + assert_contains "$official_missing_output" 'Failed to download checksums.txt' "$interpreter_name official missing manifest error"
678 + [[ ! -e "$case_root/official-missing-install/composio" ]] || fail "$interpreter_name official missing manifest must not install"
679 +
680 + reset_case
681 + official_env
682 + CASE_CHECKSUM_MODE=absent-entry
683 + if official_entry_output=$(run_installer "$case_root/official-entry-home" "$case_root/official-entry-install" "$case_root/official-entry-bin" "$stable_tag" 2>&1); then
684 + fail "$interpreter_name official source with no checksum entry must fail"
685 + fi
686 + assert_contains "$official_entry_output" 'checksums.txt has no entry for' "$interpreter_name official absent entry error"
687 + [[ ! -e "$case_root/official-entry-install/composio" ]] || fail "$interpreter_name official absent entry must not install"
688 +
689 reset_case
690 CASE_PLUGINS=1
691 run_installer "$case_root/plugins-home" "$case_root/plugins-install" "$case_root/plugins-bin" "$stable_tag" >/dev/null 2>&1