T09 · Insecure Skill Coding Practices
- Location
auto-rollback.sh:128- Finding
Environment-Controlled Paths Are Embedded into an Executable Rollback Script Without Shell Escaping
- Content
View full analysis
"$rollback_script" <> "\$LOG_FILE" echo "\$1" } check_gateway_health() { if ! pgrep -f "openclaw.*gateway" >/dev/null 2>&1; then return 1 fi if curl -s -o /dev/null -w "%{http_code}" "http://127.0.0.1:\$GATEWAY_PORT/health" 2>/dev/null | grep -q "200"; then return 0 fi return 1 } log "🚨 rollback task started" if check_gateway_health; then log "✅ Gateway is already healthy, cancelling rollback" rm -f "\$STATE_FILE" "\$OPENCLAW_HOME_DIR/\$LAUNCHD_LABEL.plist" "\$OPENCLAW_HOME_DIR/.rollback_execute.sh" exit 0 fi log "❌ Gateway still unhealthy, restoring backup: \$BACKUP_FILE" cp "\$BACKUP_FILE" "$CONFIG_FILE" || { log "❌ Failed to restore backup" exit 1 } log "🔄 Restarting Gateway" "\$OPENCLAW_CMD" gateway restart || log "❌ Gateway restart command failed" sleep 5 if check_gateway_health; then log "🎉 Rollback completed and Gateway is healthy" else log "⚠️ Rollback completed but Gat ...[truncated 2364 chars]- Remediation
View remediation
