Skip to content

install.sh runs get.docker.com and its own re-staged fetch through an unpinned-protocol curl #9977

Closed

Description

@Adityaj0

Investigation Summary

scripts/install.sh — the shell script that curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash
actually runs — downloads and executes two remote scripts without pinning the
transfer protocol:

  1. Docker convenience script (scripts/install.sh:4065, in ensure_docker):

    curl -fsSL https://get.docker.com -o "$docker_tmp"
    ...
    verify_downloaded_script "$docker_tmp" "Docker installer"
    sudo sh "$docker_tmp"

    verify_downloaded_script (scripts/install.sh:371) only checks the file is
    non-empty and starts with a shell shebang when called without an
    expected_hash argument (as it is here — Docker's script isn't pinnable to a
    fixed hash). It performs no cryptographic integrity check. A redirect from
    https://get.docker.com to a non-HTTPS location would pass this check and
    then run as root via sudo sh.

  2. Installer self re-stage (scripts/install.sh:6185, the BASH_SOURCE
    empty / curl | bash re-exec path):

    curl -fsSL "$_installer_url" -o "$_staged" ...
    ...
    exec bash "$_staged" "$@"

    Same shape: no protocol pinning, and the only gate before exec is a
    shebang check and bash -n syntax check — neither of which stops a
    downgrade-redirected payload that happens to be syntactically valid shell.

This is the same fetch-shape issue as #9698 (fixed in #9703 for
install-ollama-linux.ts) and #9861 (the nemoclaw update Node-side fetch),
but in the shell installer itself, and the Docker case is worse: it executes
the downloaded bytes with sudo.

Description

curl -fsSL follows a redirect to a non-HTTPS location, so the bytes that
land in $docker_tmp / $_staged need not have arrived over TLS.
--proto '=https' --proto-redir '=https' (already used by
src/lib/onboard/install-ollama-linux.ts:158-161 and, after #9861, by
src/lib/actions/update.ts) makes the transfer fail closed on a downgrade
redirect instead of silently accepting whatever the redirect chain returns.

The nvm installer fetch at scripts/install.sh:2170 is not affected — it's the
one call site that already pins a SHA-256 (NVM_SHA256) and verifies it before
execution, so a substituted payload is caught regardless of transport.

Reproduction Steps

Same shape as #9861's repro: two loopback servers, A (HTTPS, self-signed)
redirects to B (HTTP).

$ curl -fsSL -k https://127.0.0.1:8411/get-docker-like.sh -o out.sh; cat out.sh
# payload from the plaintext hop lands in out.sh unfiltered

$ curl -fsSL -k --proto '=https' --proto-redir '=https' https://127.0.0.1:8411/get-docker-like.sh -o out.sh
curl: (1) Protocol "http" disabled (in redirect)
# fetch aborts before anything reaches disk

verify_downloaded_script without an expected_hash does not distinguish the
first case from a legitimate Docker script — both start with #!/bin/sh (or
similar) and are non-empty.

Environment

NemoClaw main at 7601ab2 (same base as #9861); curl 8.7.1
(x86_64-apple-darwin25.0), LibreSSL/3.3.6.

Activity

  1. added a commit that references this issue on Aug 23, 2026
    9ffe7d9
  2. added
    area: install
    area: security
    on Nov 3, 2026
  3. added theissue type on Nov 3, 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

    area: installarea: security

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions