T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/qq_map_cli.sh:12
- Finding
- Unverified Remote Binary Download and Execution<![CDATA[ ## Vulnerability Details **File Location**: `scripts/qq_map_cli.sh:12-20, 31-37` **Vulnerability Type**: Remote payload retrieval and execution without integrity verification **Risk Level**: High ### Vulnerable Code ```bash if [ "$OS" = "Darwin" ]; then DOWNLOAD_URL="https://github.com/scottkiss/qq-map-cli/releases/download/v1.0.2/qq-map-cli-darwin-arm64.zip" CMD_NAME="qq-map-cli" elif [ "$OS" = "Linux" ]; then DOWNLOAD_URL="https://github.com/scottkiss/qq-map-cli/releases/download/v1.0.2/qq-map-cli-linux-x86_64.zip" CMD_NAME="qq-map-cli" elif echo "$OS" | grep -iq 'mingw\|cygwin\|msys\|windows_nt'; then DOWNLOAD_URL="https://github.com/scottkiss/qq-map-cli/releases/download/v1.0.2/qq-map-cli-windows-x86_64.zip" CMD_NAME="qq-map-cli.exe" ``` ```bash if [ ! -x "$CMD_PATH" ] && [ ! -f "$CMD_PATH" ]; then echo "Downloading $CMD_NAME..." >&2 mkdir -p "$BIN_DIR" curl -L -s "$DOWNLOAD_URL" -o "$BIN_DIR/$ZIP_FILE" unzip -q -o "$BIN_DIR/$ZIP_FILE" -d "$BIN_DIR" if [ "$CMD_NAME" = "qq-map-cli" ]; then chmod +x "$CMD_PATH" fi rm -f "$BIN_DIR/$ZIP_FILE" echo "Download complete: $CMD_PATH" >&2 else echo "$CMD_NAME is already downloaded at $CMD_PATH" >&2 fi ``` ### Technical Analysis The installation script downloads a precompiled executable from a release belonging to a personal GitHub repository. It extracts the archive and marks the resulting file as executable without verifying a cryptographic checksum, digital signature, trusted publisher identity, or reproducible build provenance. Pinning the URL to release tag `v1.0.2` limits accidental version changes but does not establish artifact integrity. A compromised repository account, release asset, hosting platform, or redirected download destination could supply a different executable while retaining the expected filename and URL. The use of `curl -L` follows redirects, and the script performs no validation of the final destination or downl ...[truncated 1854 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Publish and audit the CLI source, then build it locally or through a verifiable, trusted build process. 2. Record a separate SHA-256 or stronger digest for every supported platform artifact in the Skill package. 3. Verify the digest before extraction and execution, and terminate immediately on any mismatch. 4. Cryptographically sign release artifacts and verify signatures against a pinned, documented maintainer key. 5. Use `curl --fail --show-error --location` and validate the final download origin rather than suppressing errors with `-s`. 6. Download into a securely created temporary directory, validate the archive contents, and only then atomically install the expected executable. 7. Avoid overwriting arbitrary extracted files and reject archives containing unexpected names, links, or paths. 8. Prefer an official Tencent API client or a source-based dependency from a well-governed package registry. 9. Clearly disclose that the executable is third-party code and obtain user approval before downloading and running it. 10. Run the client with restricted filesystem and network permissions where sandboxing is available. ]]>
