other
Warning
- Location
- scripts/test-update-pipeline.sh:195
- Finding
- Bundled Maintenance Script Exceeds the Advertised Read-Only Skill Scope<![CDATA[ ## Vulnerability Details **File Location**: `scripts/test-update-pipeline.sh`, lines 6-7, 52-74, 144-181, 195-249, 336-350, and 381-390 **Vulnerability Type**: Excessive Scope and Environment Reconnaissance **Risk Level**: Medium ### Vulnerable Code ```bash SKILL_DIR="/home/dev/.openclaw/skills/pr-ship" OPENCLAW_DIR="/home/dev/openclaw" ``` ```bash cd "$SKILL_DIR" # Test .gitignore blocks .env files TRAP_FILE="$SKILL_DIR/.env.test-trap" echo "SECRET_KEY=do-not-commit" > "$TRAP_FILE" if git check-ignore -q "$TRAP_FILE" 2>/dev/null; then pass ".gitignore blocks .env files" else fail ".gitignore does not block .env files" fi rm -f "$TRAP_FILE" # Test .gitignore blocks swap files SWAP_FILE="$SKILL_DIR/SKILL.md.swp" touch "$SWAP_FILE" if git check-ignore -q "$SWAP_FILE" 2>/dev/null; then pass ".gitignore blocks .swp files" else warn ".gitignore does not block .swp files" fi rm -f "$SWAP_FILE" ``` ```bash cd "$OPENCLAW_DIR" git fetch upstream --quiet 2>/dev/null || true LOCAL_SHA=$(git rev-parse main:CHANGELOG.md 2>/dev/null || echo none) UPSTREAM_SHA=$(git rev-parse upstream/main:CHANGELOG.md 2>/dev/null || echo none) # ... cd "$SKILL_DIR" LOCAL_SHA=$(git rev-parse --short HEAD 2>/dev/null || echo "none") REMOTE_SHA=$(git ls-remote origin HEAD 2>/dev/null | cut -c1-7 || echo "none") ``` ```bash JOBS_FILE="$HOME/.openclaw/cron/jobs.json" if [ -f "$JOBS_FILE" ]; then JOB_MSG=$(python3 -c " import json jobs=json.load(open('$JOBS_FILE'))['jobs'] j=[x for x in jobs if x['id']=='492d067a-5cb1-47c5-92bc-fd8985c64a1f'] if j: print(j[0]['payload']['message']) else: print('NOT_FOUND') " 2>/dev/null || echo "PARSE_ERROR") if [ "$JOB_MSG" = "NOT_FOUND" ]; then fail "Cron job 492d067a not found in jobs.json" elif [ "$JOB_MSG" = "PARSE_ERROR" ]; then fail "Could not parse jobs.json" else pass "Cron job 492d067a found" if echo "$JOB_MSG" | grep -q "git push"; then fail "Cron still has git push — should be removed (manual sy ...[truncated 4510 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the maintenance script from the distributed Skill package unless it is required for end users. 2. Move the live cron trigger into a separately distributed administrative script with an explicit warning and confirmation prompt. 3. Split validation into distinct modes: - Offline, read-only validation by default. - Network validation only after explicit opt-in. - Live cron execution only through a separate command. 4. Replace hard-coded `/home/dev/...` paths with explicit command-line arguments or securely validated configuration. 5. Do not load the complete cron payload merely to validate job metadata. Parse only the minimum required fields and avoid retaining or printing sensitive message content. 6. Before executing a cron job, display its identifier and intended operation and require interactive confirmation. 7. Validate that the targeted job belongs to this Skill and restrict execution to an allowlisted, immutable operation. 8. Create temporary files with `mktemp` in a private temporary directory rather than writing trap files into the installed Skill directory. 9. Add cleanup traps so temporary files are removed on interruption or failure. 10. Document every filesystem, network, configuration-access, and live-execution side effect in README.md. 11. Avoid suppressing failures with `|| true` for network and live cron operations; return a clear error so users can determine whether an operation ran successfully. ]]>
