T03 · Remote Payload Retrieval and Execution
Error
- Location
- install.sh:3
- Finding
- Mutable Remote Installer Executes Unpinned Repository Content<![CDATA[ ## Vulnerability Details **File Location**: `install.sh:3`, `install.sh:45-56`, `install.sh:81-90`, `install.sh:98-103` **Vulnerability Type**: Remote payload retrieval and execution through a mutable branch **Risk Level**: Critical ### Vulnerable Code ```bash # 使用方法: curl -fsSL https://raw.githubusercontent.com/sfsf332/claw-loudyai-skill/main/install.sh | bash ``` ```bash get_install_path() { # 优先使用 OPENCLAW_SKILLS_DIR 环境变量 if [ -n "$OPENCLAW_SKILLS_DIR" ]; then INSTALL_DIR="$OPENCLAW_SKILLS_DIR" else # 默认路径 INSTALL_DIR="/usr/lib/node_modules/openclaw/skills" fi info "安装路径: $INSTALL_DIR" } ``` ```bash clone_repository() { info "克隆仓库..." cd "$INSTALL_DIR" # 如果目录已存在,先删除 if [ -d "loudy-ai-auto-task" ]; then warning "目录已存在,正在删除..." rm -rf loudy-ai-auto-task fi # 克隆仓库 git clone https://github.com/sfsf332/claw-loudyai-skill.git loudy-ai-auto-task || error "克隆仓库失败" success "仓库克隆完成" } ``` ```bash set_permissions() { info "设置权限..." cd "$INSTALL_DIR/loudy-ai-auto-task" # 设置脚本可执行权限 if [ -d "scripts" ]; then chmod +x scripts/*.py scripts/*.sh 2>/dev/null || true fi success "权限设置完成" } ``` ### Technical Analysis The documented installation command downloads `install.sh` from the mutable `main` branch and immediately passes it to a shell. Users cannot reliably inspect the exact payload before execution, and the command performs no signature, checksum, release-tag, or commit verification. The downloaded installer then clones the repository without specifying an immutable commit or tag. Consequently, both the first-stage installer and second-stage Skill content can differ from the version that was audited. The installer also marks retrieved scripts executable and defaults to `/usr/lib/node_modules/openclaw/skills`, a location that commonly requires elevated privileges. The installation process additionally deletes any existing `l ...[truncated 1477 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all `curl | bash` installation instructions. 2. Distribute the Skill as an immutable, versioned release archive. 3. Pin installation to a full Git commit hash or immutable release identifier. 4. Publish and verify a SHA-256 digest or cryptographic signature before extracting or executing content. 5. Display the expected repository revision to the user and fail closed if verification fails. 6. Default to a user-owned Skill directory instead of `/usr/lib/node_modules`. 7. Do not recommend running the installer as root or through `sudo`. 8. Avoid deleting an existing installation automatically; use a safe update process with confirmation and rollback support. 9. Set executable permissions only on an explicit allowlist of reviewed scripts. 10. Audit the exact immutable artifact that will be installed rather than a mutable branch. ]]>
