T03 · Remote Payload Retrieval and Execution
Warning
- Location
- SKILL.md:91
- Finding
- External Source Retrieval, Build, Installation, and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:91-96`; `setup.sh:25-55` **Vulnerability Type**: Remote payload retrieval and execution through an unaudited external source **Risk Level**: Medium ### Vulnerable Code `SKILL.md:91-96`: ```bash git clone https://github.com/neothelobster/ghostfetch.git cd ghostfetch go build -o ghostfetch . cp ghostfetch ~/.openclaw/workspace/tools/ ``` `setup.sh:25-55`: ```bash # Clone at pinned commit REPO_DIR="/tmp/ghostfetch-build" rm -rf "$REPO_DIR" echo "Cloning ghostfetch at pinned commit..." git clone "$REPO_URL" "$REPO_DIR" git -C "$REPO_DIR" checkout "$PINNED_COMMIT" # Verify checkout ACTUAL_COMMIT="$(git -C "$REPO_DIR" rev-parse HEAD)" if [ "$ACTUAL_COMMIT" != "$PINNED_COMMIT" ]; then echo "ERROR: Commit verification failed." echo "Expected: $PINNED_COMMIT" echo "Got: $ACTUAL_COMMIT" exit 1 fi echo "Commit verified: $PINNED_COMMIT" # Build echo "Building ghostfetch..." cd "$REPO_DIR" go build -o ghostfetch . # Install mkdir -p "$TOOLS_DIR" cp ghostfetch "$TOOLS_DIR/ghostfetch" chmod +x "$TOOLS_DIR/ghostfetch" # Verify binary works if "$TOOLS_DIR/ghostfetch" --help >/dev/null 2>&1; then ``` ### Technical Analysis The submitted project does not contain the source code or Go dependency manifests used to build the `ghostfetch` executable. Instead, users are instructed to retrieve source from an external GitHub repository, compile it, install it into the OpenClaw tool directory, and execute it. The installation command documented in `SKILL.md` clones the repository's mutable default branch without checking a commit, release signature, or content digest. Consequently, the source compiled by a user can differ from the source that existed when this Skill was reviewed. The included `setup.sh` provides a meaningful mitigation by checking out and verifying commit `6e6876a90470d4bb53e38be32e8f43e67b695b48`. However, the pinned source and its dependency lock data are absent from the s ...[truncated 2206 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Vendor the reviewed Ghostfetch source, `go.mod`, and `go.sum` inside the Skill package so the effective implementation is available during audit. 2. Remove the unpinned `git clone` installation example from `SKILL.md`. Require an immutable commit or signed release for every installation path. 3. Verify the downloaded source or release artifact against a cryptographic SHA-256 digest stored in the reviewed package. 4. Build with locked dependencies and enforce module checksum verification. Consider a vendored dependency tree or an approved internal module proxy. 5. Use reproducible builds and verify the final executable against a published expected digest before installation or execution. 6. Do not automatically execute the newly built binary as a setup verification step. If verification is necessary, perform it only after integrity checks and in a restricted environment. 7. Install the tool into a Skill-specific, non-global location where possible, rather than a shared tools directory available across sessions. 8. Document that search queries, requested URLs, cookies, and optional CAPTCHA credentials are transmitted to external services. Recommend `--no-cookies` by default and avoid passing CAPTCHA API keys through command-line arguments, where they may be exposed in process listings or shell history. ]]>
