T08 · Insecure Dependencies
Warning
- Location
- hytale.sh:40
- Finding
- Downloader Executed Without Integrity or Authenticity Verification<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:10-13`; `hytale.sh:40-65` **Vulnerability Type**: Unverified third-party executable **Risk Level**: Medium ### Complete Code Snippet ```markdown 1. **Download the Hytale Downloader:** - Get the zip from: `https://downloader.hytale.com/hytale-downloader.zip` - Unzip it and place `hytale-downloader-linux-amd64` in `~/hytale_server/`. - Make it executable: `chmod +x ~/hytale_server/hytale-downloader-linux-amd64` ``` ```bash # Check if downloader exists in server dir; if not, check for the linux binary specifically if user unzipped it if [ ! -f "$DOWNLOADER" ]; then # Try to find the linux binary if the generic name isn't there if [ -f "$SERVER_DIR/hytale-downloader-linux-amd64" ]; then DOWNLOADER="$SERVER_DIR/hytale-downloader-linux-amd64" else echo "Error: Hytale Downloader not found in $SERVER_DIR." echo "Please download it from: $DOWNLOAD_URL" echo "Unzip it and place the binary (hytale-downloader-linux-amd64) in $SERVER_DIR" echo "Make sure to mark it executable: chmod +x $SERVER_DIR/hytale-downloader-linux-amd64" exit 1 fi fi echo "Running Hytale Downloader..." cd "$SERVER_DIR" # Use explicit credentials file if present CRED_ARG="" if [ -f "hytale-downloader-credentials.json" ]; then CRED_ARG="-credentials-path hytale-downloader-credentials.json" fi chmod +x "$DOWNLOADER" "$DOWNLOADER" -download-path "$SERVER_DIR" $CRED_ARG ``` ### Technical Analysis The skill instructs the user to download a third-party executable and place it in a user-writable server directory. During an update, the script executes any regular file found under either expected downloader name. It does not verify a cryptographic digest, vendor signature, file ownership, or expected permissions before execution. HTTPS protects the download while it is in transit but does not independently establish the integrity of a file after download or protec ...[truncated 1711 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Obtain an official SHA-256 digest or vendor signing key through an independently trusted channel. 2. Verify the downloader before every execution, for example with `sha256sum -c`, and terminate on any mismatch. 3. Prefer vendor signature verification over a hardcoded digest when an official signing mechanism is available. 4. Reject symbolic links and unexpected file types before execution. 5. Validate that the downloader is owned by the expected user and is not writable by group or other users. 6. Do not automatically make an unverified file executable. Perform verification first and only then apply the minimum required permissions. 7. Store credentials outside the downloader and server-content directory, restrict them to mode `0600`, and pass only the required credentials path. 8. Check and propagate the downloader's exit status so failed or incomplete updates are not treated as successful. ]]>
