T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/heartbeat.sh:6
- Finding
- Mutable Remote Code Is Executed During Installation and Automatic Updates<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:16-21`, `install.sh:13-27`, `scripts/heartbeat.sh:6-18`, `scripts/update.sh:17-39`, `references/CLAWLIFE_HEARTBEAT.md:105-107` **Vulnerability Type**: Remote payload retrieval and execution through an unpinned software supply chain **Risk Level**: High ### Vulnerable Code `SKILL.md:16-21`: ```bash ## Install ```bash curl -fsSL https://clawlife.world/install.sh | bash ``` Non-interactive: `curl -fsSL https://clawlife.world/install.sh | bash -s NAME FRIEND-CODE` ``` `install.sh:13-27`: ```bash # Skills directory — always use the OpenClaw workspace SKILLS_DIR="$HOME/.openclaw/workspace/skills/clawlife" mkdir -p "$HOME/.openclaw/workspace/skills" echo " 📦 Installing → $SKILLS_DIR" if [ -d "$SKILLS_DIR" ]; then echo " ↻ Updating existing installation..." cd "$SKILLS_DIR" && git checkout -- . && git pull --quiet else git clone --quiet https://github.com/mithri-claws/clawlife-skill.git "$SKILLS_DIR" fi chmod +x "$SKILLS_DIR"/scripts/*.sh 2>/dev/null || true rm -f "$SKILLS_DIR/README.md" 2>/dev/null ``` `scripts/heartbeat.sh:6-18`: ```bash # Auto-update check (once per day) SKILL_DIR="$(cd "$(dirname "$0")/.." && pwd)" UPDATE_MARKER="$SKILL_DIR/.last_update_check" NOW=$(date +%s) LAST_CHECK=$(cat "$UPDATE_MARKER" 2>/dev/null || echo 0) if [ $(( NOW - LAST_CHECK )) -gt 86400 ]; then REMOTE_VER=$(curl -sf "https://raw.githubusercontent.com/mithri-claws/clawlife-skill/main/VERSION" 2>/dev/null || echo "") LOCAL_VER=$(cat "$SKILL_DIR/VERSION" 2>/dev/null || echo "0.0.0") if [ -n "$REMOTE_VER" ] && [ "$REMOTE_VER" != "$LOCAL_VER" ]; then echo "🔄 Updating ClawLife skill ($LOCAL_VER → $REMOTE_VER)..." cd "$SKILL_DIR" && git checkout -- . 2>/dev/null && git pull -q 2>/dev/null && echo "✅ Updated!" || echo "⚠️ Update failed, continuing with current version" fi echo "$NOW" > "$UPDATE_MARKER" 2>/dev/null fi ``` `scripts/update.sh:17-39`: ```bash # Fetch remote version (lightw ...[truncated 3139 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace `curl | bash` with a download-review-verify-install workflow. 2. Publish versioned release archives and cryptographic SHA-256 checksums, preferably accompanied by Sigstore or another verifiable release signature. 3. Pin installation to a release tag or immutable commit hash rather than a mutable default branch. 4. Remove automatic `git pull` from `heartbeat.sh`; update checks may report availability but must not alter executable code. 5. Require explicit operator approval before applying an update. 6. Verify the downloaded release before extracting it into the Skill directory. 7. Avoid `git checkout -- .`, which silently discards local security review changes. 8. Run installation and updates with ordinary user privileges and restrict writes to the dedicated Skill directory. 9. Document the exact repository, release version, expected checksum, files modified, and network destinations. ]]>
