Back to skill

Security audit

Server Guardian

Security checks for vulnerabilities and agentic risk

Overview

This server recovery skill is mostly purpose-aligned, but it gives agents broad operational cleanup and restart guidance with under-scoped safeguards that users should review before installing.

Review this skill carefully before installing on production hosts. Use the health check separately from recovery actions, avoid unattended cron-based full recovery, and do not run the recovery script as unrestricted root unless you accept the risks of service restarts, cache drops, log deletion, and possible termination of unrelated high-memory processes.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/health_check.sh:9
Finding

Predictable Temporary State File Allows Symlink-Based File Corruption

Content
View full analysis
/dev/null | tr -d '[]' | tr ',' '\n' | grep -v '^$' | sort -n) fi # Filter records from the last 60 seconds local recent=$(echo "$timestamps" | awk -v c="$cutoff" '$1 > c' | wc -l) if [[ "$recent" -ge 40 ]]; then echo "Rate limit reached" exit 0 fi # Write the current timestamp echo "$now," >> "$RATE_LIMIT_FILE" # Remove expired records if [[ -f "$RATE_LIMIT_FILE" ]]; then local tmp=$(mktemp) awk -v c="$cutoff" '$1 > c' "$RATE_LIMIT_FILE" > "$tmp" && mv "$tmp" "$RATE_LIMIT_FILE" fi } ``` ### Technical Analysis The script stores rate-limit state at the fixed path `/tmp/guardian_rate_limit.json`. The `/tmp` directory is normally writable by every local user. The script neither creates a private parent directory nor verifies that the destination is a regular file owned by the expected user. The append operation: ```bash echo "$now," >> "$RATE_LIMIT_FILE" ``` follows symbolic links. If this health check is run as root, a local unprivileged user can create `/tmp/guardian_rate_limit.json` as a symbolic link to a root-writable target. The privileged script will then append a timestamp and comma to that target. Creating a separate temporary file with `mktemp` later in the function does not prevent the initial append from following the symbolic link. It also does not provide safe concurrency control for multiple health-check instances. The attacker cannot select arbitrary output content: the appended content is limit ...[truncated 1377 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/auto_recover.sh:75
Finding

Recovery Workflow Can Terminate Unrelated Critical Processes

Content
View full analysis
5.0 && $11 !~ /^\[.*\]$/ {print $2}' | head -10); do pname=$(ps -o comm= -p "$pid" 2>/dev/null || true) mem_mb=$(ps -o rss= -p "$pid" 2>/dev/null | awk '{print int($1/1024)}') if [ -n "$pname" ] && [ "$mem_mb" -gt 500 ]; then warn "Process $pname (PID:$pid) uses ${mem_mb}MB" if confirm "Kill this process?"; then kill -15 "$pid" && ok "SIGTERM sent" || true sleep 2 kill -9 "$pid" 2>/dev/null && ok "Process forcibly terminated" || true fi fi done } ``` The function is included in the recommended full-recovery path when memory usage exceeds 75%: ```bash if [ "${MEM_PCT%.*}" -gt 75 ]; then warn "Memory usage is ${MEM_PCT%.*}%; starting cleanup..." clear_mem_cache kill_high_mem_procs || true fi ``` ### Technical Analysis The comment describes the selected processes as non-critical, but the implementation does not establish that property. It selects up to ten processes based on memory percentage and RSS, excluding only process command fields that resemble kernel threads. The function does not restrict candidates by: - OpenClaw executable path or process identity; - systemd service or cgroup membership; - process owner; - an explicit allowlist; - critical-service exclusions; - PID 1 or infrastructure-service status. Consequently, databases, container runtimes, SSH-related services, monitoring agents, and other unrelated workloads can be offered as termination candidates. The confirmation prompt reduces the likelihood of accidental termination but presents on ...[truncated 1852 chars]
Remediation
View remediation
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The documentation claims broad automatic recovery capabilities, including cleanup and restart actions, but the described behavior is inconsistent and may cause operators or agents to assume safeguards or diagnostics exist when they do not. This mismatch is dangerous because it can lead to inappropriate trust, incorrect incident handling, or unsafe invocation of recovery workflows under false assumptions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill invokes shell scripts and operational CLI commands but declares no explicit tool scope or permission boundaries. In an automated recovery context, this can enable unintended execution of privileged shell actions without clear user consent or runtime restriction, increasing the blast radius if the skill is triggered broadly or misused.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger scope is so broad that the skill may activate for nearly any abnormal server condition, including vague performance or connectivity complaints. In combination with recovery guidance, this increases the chance of unnecessary or unsafe remediation actions being applied in the wrong context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill recommends automatic recovery operations that can restart services, clear caches, compress or delete logs, and alter system state without an explicit warning or approval checkpoint. In a server operations context, these actions can disrupt service availability, destroy forensic evidence, or worsen an outage if triggered automatically on ambiguous symptoms.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script deletes .gz logs older than 30 days using find ... -delete with no explicit disclosure that removal is permanent. Because this skill is designed for server troubleshooting and recovery, automatic destruction of historical logs can erase operational and security evidence that may still be needed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The full recovery flow calls rotate_logs automatically, and that function permanently deletes compressed logs older than 30 days without any explicit warning or confirmation in the full-run path. In an incident-recovery skill, logs are often forensic evidence, so silent deletion can hinder troubleshooting, postmortem analysis, and incident response even if the script is intended for maintenance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script embeds Chinese-only natural-language text in its header and throughout user-facing status messages, which imposes a specific language on users without any opt-in or alternative locale support. This matches the policy category for language or locale constraints because the file does not offer a language choice or justify that it is region-specific.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The quick-start phrases are generic troubleshooting requests that can overlap with ordinary support conversations, making accidental activation more likely. While not inherently malicious, this ambiguity becomes risky because the skill is associated with privileged shell-based diagnostic and recovery operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file presents all operational guidance and cron examples exclusively in Chinese, and it does not state that the skill is intended only for Chinese-speaking users or offer any language choice. Under the policy rule for natural-language violations, forcing a specific language without opt-in can be a locale/language policy issue.

Content

No source excerpt is available for this finding.