T03 · Remote Payload Retrieval and Execution
- Location
SKILL.md:12- Finding
Unverified Mutable Binary Download and System-Wide Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12-27
Vulnerability Type: Remote retrieval and execution of an unverified executable
Risk Level: Highbash # Detect architecture ARCH=$(uname -m) if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then URL="https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-arm64.tar.gz" else URL="https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-amd64.tar.gz" fi # Install cd /tmp wget -q "$URL" tar xzf hcloud-linux-*.tar.gz sudo mv hcloud /usr/local/bin/ chmod +x /usr/local/bin/hcloudTechnical Analysis
The installation procedure downloads an executable archive from an external URL and installs its contents into the system-wide executable directory. Although the URL points to the official
hetznercloud/cliGitHub repository over HTTPS rather than a personal pastebin, the procedure uses the mutablelatestrelease reference and performs no checksum or cryptographic-signature verification.Consequently, the executable that is installed can change after the Skill has been reviewed. Compromise of the upstream release process, repository, release asset, or delivery infrastructure could cause different code to be installed without any corresponding change to this Skill.
The procedure also operates directly in the shared
/tmpdirectory and extractshcloud-linux-*.tar.gzusing a wildcard rather than an exact downloaded filename. A local attacker able to create files in/tmpmay attempt to influence which archives are processed or exploit pre-existing files and archive contents. No private temporary directory, archive-content validation, or cleanup is used.Finally,
sudo mvplaces the unverified executable in/usr/local/bin, which crosses a system-wide privilege boundary. A root-level installation is not the minimum privilege necessary to run the CLI because it could instead be installed int ...[truncated 2328 chars]- Remediation
View remediation
Remediation Suggestions
- Pin an explicit, reviewed CLI version instead of using the mutable
latestURL. - Obtain the expected SHA-256 digest from a trusted, version-specific source and verify it before extraction. Prefer verification of a vendor-provided cryptographic signature where available.
- Abort installation if integrity or signature verification fails.
- Create a private temporary directory with
mktemp -d, set restrictive permissions, and remove it with a shell trap after installation. - Download to an exact filename and extract that filename explicitly; do not use
hcloud-linux-*.tar.gz. - Inspect or constrain archive paths before extraction to prevent absolute-path or path-traversal entries.
- Prefer installation into a user-owned directory such as
~/.local/binso thatsudois unnecessary. - If a system-wide installation is explicitly required, verify the artifact first and use
sudo install -m 0755only for the final, validated executable. - Reject unsupported architectures explicitly rather than treating every non-ARM architecture as AMD64.
- Document the exact source, version, expected digest, and trust assumptions so future reviewers can reproduce provenance verification.
- Pin an explicit, reviewed CLI version instead of using the mutable
