T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/install-and-configure.sh:69
- Finding
- Externally Hosted Unsigned Binary Is Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install-and-configure.sh:69-114` **Vulnerability Type**: Remote executable retrieval and insufficient supply-chain authentication **Risk Level**: High ### Vulnerable Code ```bash # Step 1: Install via verified download from GitHub Releases if command -v 1sec >/dev/null 2>&1; then ok "1sec already installed: $(1sec version 2>/dev/null | head -1)" else RELEASE_BASE="https://github.com/1sec-security/1sec/releases/download/v${VERSION}" info "Downloading 1-SEC v${VERSION} (${BINARY}) from GitHub Releases..." if command -v wget >/dev/null 2>&1; then wget -q "${RELEASE_BASE}/${BINARY}" -O /tmp/1sec-download wget -q "${RELEASE_BASE}/checksums.txt" -O /tmp/1sec-checksums.txt elif command -v curl >/dev/null 2>&1; then curl -fsSL "${RELEASE_BASE}/${BINARY}" -o /tmp/1sec-download curl -fsSL "${RELEASE_BASE}/checksums.txt" -o /tmp/1sec-checksums.txt else fail "Neither wget nor curl found. Install one and retry." fi info "Verifying SHA256 checksum..." EXPECTED_HASH="$(grep "${BINARY}" /tmp/1sec-checksums.txt | awk '{print $1}')" ACTUAL_HASH="$(sha256sum /tmp/1sec-download | awk '{print $1}')" if [ -z "$EXPECTED_HASH" ]; then rm -f /tmp/1sec-download /tmp/1sec-checksums.txt fail "Checksum for ${BINARY} not found in checksums.txt — aborting." fi if [ "$EXPECTED_HASH" != "$ACTUAL_HASH" ]; then rm -f /tmp/1sec-download /tmp/1sec-checksums.txt fail "Checksum mismatch! Expected: $EXPECTED_HASH Got: $ACTUAL_HASH — aborting." fi ok "Checksum verified: $ACTUAL_HASH" chmod +x /tmp/1sec-download if [ "$(id -u)" -eq 0 ]; then mv /tmp/1sec-download /usr/local/bin/1sec else mkdir -p "${HOME}/.local/bin" mv /tmp/1sec-download "${HOME}/.local/bin/1sec" warn "Installed to ~/.local/bin/1sec — ensure this is in your PATH." fi rm -f /tmp/1sec-checksums.txt command -v 1sec >/dev/null 2>&1 || fail "Installation failed — 1sec not foun ...[truncated 3372 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require detached cryptographic signatures for release artifacts and verify them with a publisher public key pinned inside the audited Skill package. 2. Do not download the public verification key from the same release location during installation. 3. Pin an independently reviewed executable digest in the Skill release when practical, rather than trusting a checksum downloaded alongside the binary. 4. Publish and verify reproducible-build attestations, SBOMs, and provenance generated by a hardened build pipeline. 5. Use immutable release references and protect the upstream release workflow with restricted permissions, mandatory review, hardware-backed authentication, and protected environments. 6. Separate installation from execution. Download and verify the artifact first, display its provenance and digest, and require explicit operator approval before running it. 7. Perform initial execution in an isolated environment with minimal filesystem and network permissions. 8. Run monitoring-only functionality under a dedicated unprivileged account. Grant narrowly scoped capabilities only to components that require firewall or process-control access. 9. Avoid enabling the live `vps-agent` preset until the binary has been independently validated in dry-run mode and its provenance has been verified. ]]>
