Back to skill

Security audit

Gateway Keepalive

Security checks for vulnerabilities and agentic risk

Overview

The skill’s keepalive purpose is coherent, but it installs persistent background services and has unsafe configuration handling that can repeatedly run user-level shell code or overwrite local OpenClaw configuration.

Review carefully before installing. This skill will create persistent macOS LaunchAgents, run a shell recovery script every minute, restart OpenClaw Gateway, and overwrite OpenClaw configuration from a backup after repeated failures. Treat the Telegram option as sensitive credential storage, secure or avoid keepalive.conf, and prefer a version that parses config without source and requires explicit user action before updating the golden backup.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/health-check-recovery.sh:21
Finding

Recurring Arbitrary Command Execution Through Sourced Configuration

Content
View full analysis
~/.openclaw/config/keepalive.conf <
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/install.sh:61
Finding

Telegram Bot Credential Stored Without Restrictive File Permissions

Content
View full analysis
~/.openclaw/config/keepalive.conf <
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/health-check-recovery.sh:106
Finding

Unreliable Health Detection and Automatic Corruption of the Recovery Baseline

Content
View full analysis
ProgramArguments /opt/homebrew/opt/node/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 18789 ``` The script also overwrites the recovery baseline after every successful health check: ```bash update_golden_backup() { if check_health > /dev/null 2>&1; then cp "$CURRENT_CONFIG" "$GOLDEN_CONFIG" log "Golden backup updated because health check passed" fi } main() { rotate_log log "Starting health check" if check_health; then log "Health check passed" reset_failure update_golden_backup else reason=$(check_health) increment_failure count=$(cat "$STATE_FILE") if [ $count -ge $MAX_FAILURES ]; then log_recovery "Consecutive failures reached $count; triggering automatic recovery" trigger_recovery "$reason" else log "Failure count: $count/$MAX_FAILURES" fi fi } ``` ### Technical Analysis The recovery mechanism has two related integrity problems. First, its process test relies on an imprecise textual search for `openclaw-gateway`. The in ...[truncated 2537 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (77)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill reads process state, localhost port status, logs, backups, and state files as part of health monitoring, but this monitoring footprint is broader than the simple keepalive description implies. Even if operationally justified, undocumented enumeration and inspection of local state reduces user awareness and can expose sensitive operational data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill reads process state, localhost port status, logs, backups, and state files as part of health monitoring, but this monitoring footprint is broader than the simple keepalive description implies. Even if operationally justified, undocumented enumeration and inspection of local state reduces user awareness and can expose sensitive operational data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The skill reads process state, localhost port status, logs, backups, and state files as part of health monitoring, but this monitoring footprint is broader than the simple keepalive description implies. Even if operationally justified, undocumented enumeration and inspection of local state reduces user awareness and can expose sensitive operational data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill reads process state, localhost port status, logs, backups, and state files as part of health monitoring, but this monitoring footprint is broader than the simple keepalive description implies. Even if operationally justified, undocumented enumeration and inspection of local state reduces user awareness and can expose sensitive operational data.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/uninstall.sh (reported line 25)May include surrounding context.

sh
# 删除 LaunchAgent 配置文件
echo "🗑️ 删除 LaunchAgent 配置..."
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
rm -f ~/Library/LaunchAgents/com.openclaw.health-check.plist

# 询问是否删除备份

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/uninstall.sh (reported line 26)May include surrounding context.

sh
# 删除 LaunchAgent 配置文件
echo "🗑️ 删除 LaunchAgent 配置..."
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
rm -f ~/Library/LaunchAgents/com.openclaw.health-check.plist

# 询问是否删除备份
read -p "是否删除黄金备份?(y/N) " -n 1 -r

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/uninstall.sh (reported line 33)May include surrounding context.

sh
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
    echo "🗑️ 删除黄金备份..."
    rm -rf ~/.openclaw/backups/golden-config
fi

# 询问是否删除日志

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/uninstall.sh (reported line 33)May include surrounding context.

sh
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
    echo "🗑️ 删除黄金备份..."
    rm -rf ~/.openclaw/backups/golden-config
fi

# 询问是否删除日志

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/uninstall.sh (reported line 41)May include surrounding context.

sh
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
    echo "🗑️ 删除日志..."
    rm -f ~/.openclaw/logs/health-recovery.log*
    rm -f ~/.openclaw/logs/health-check.log*
    rm -f ~/.openclaw/state/recovery-count
fi

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/uninstall.sh (reported line 42)May include surrounding context.

sh
if [[ $REPLY =~ ^[Yy]$ ]]; then
    echo "🗑️ 删除日志..."
    rm -f ~/.openclaw/logs/health-recovery.log*
    rm -f ~/.openclaw/logs/health-check.log*
    rm -f ~/.openclaw/state/recovery-count
fi

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/uninstall.sh (reported line 43)May include surrounding context.

sh
echo "🗑️ 删除日志..."
    rm -f ~/.openclaw/logs/health-recovery.log*
    rm -f ~/.openclaw/logs/health-check.log*
    rm -f ~/.openclaw/state/recovery-count
fi

echo ""

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill clearly instructs users to execute shell scripts and install persistent LaunchAgents, yet it declares no permissions or allowed tool scope. This creates a transparency and consent failure: users and any hosting platform cannot accurately understand that the skill can modify files, start background services, and run recurring shell commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill describes automatic recovery actions that can overwrite local configuration from a golden backup, restart processes, and maintain persistent agents, but it does not prominently warn about the operational impact. Automatic rollback and restart behavior can cause data loss, revert intentional configuration changes, or create service instability if triggered incorrectly.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · SKILL.md (reported line 282)May include surrounding context.

自动恢复失败

bash
ls -la ~/.openclaw/backups/golden-config/
cp ~/.openclaw/backups/golden-config/openclaw.json ~/.openclaw/openclaw.json
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · docs/gateway-keepalive-setup-guide.md (reported line 413)May include surrounding context.

自动恢复失败

bash
ls -la ~/.openclaw/backups/golden-config/
cp ~/.openclaw/backups/golden-config/openclaw.json ~/.openclaw/openclaw.json
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · docs/gateway-keepalive-setup-guide.md (reported line 416)May include surrounding context.

自动恢复失败

bash
ls -la ~/.openclaw/backups/golden-config/
cp ~/.openclaw/backups/golden-config/openclaw.json ~/.openclaw/openclaw.json
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway

Session Persistence

Medium
Category
Rogue Agent
Confidence
96% confidence
Finding

The skill establishes persistence via macOS LaunchAgents so it can auto-start and run health checks continuously. Persistence is a sensitive capability because it survives user sessions, continuously executes code, and can be abused or forgotten if not transparently disclosed and explicitly authorized.

Content

Scanner excerpt · SKILL.md (reported line 310)May include surrounding context.

md
└── health-check-recovery.sh          # 健康检测脚本

~/Library/LaunchAgents/
├── ai.openclaw.gateway.plist         # Gateway LaunchAgent
└── com.openclaw.health-check.plist   # 健康检测 LaunchAgent

~/.openclaw/backups/golden-config/

Session Persistence

Medium
Category
Rogue Agent
Confidence
96% confidence
Finding

The second LaunchAgent reference confirms an additional persistent background component for periodic health checks. Multiple persistent agents increase attack surface and reduce visibility if users are not clearly informed, especially when combined with auto-restart logic and config restoration.

Content

Scanner excerpt · SKILL.md (reported line 311)May include surrounding context.

md
~/Library/LaunchAgents/
├── ai.openclaw.gateway.plist         # Gateway LaunchAgent
└── com.openclaw.health-check.plist   # 健康检测 LaunchAgent

~/.openclaw/backups/golden-config/
└── openclaw.json                     # 黄金备份配置

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · docs/gateway-keepalive-setup-guide.md (reported line 45)May include surrounding context.

Step 1: 创建黄金备份目录

bash
mkdir -p ~/.openclaw/backups/golden-config
mkdir -p ~/.openclaw/logs
mkdir -p ~/.openclaw/state

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · docs/gateway-keepalive-setup-guide.md (reported line 45)May include surrounding context.

Step 1: 创建黄金备份目录

bash
mkdir -p ~/.openclaw/backups/golden-config
mkdir -p ~/.openclaw/logs
mkdir -p ~/.openclaw/state

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The guide instructs users to create a LaunchAgent that automatically starts and persistently restarts a network-exposed gateway process at login. Although this appears intended for reliability, persistence mechanisms materially increase risk because they ensure the service continues running after failures and user sessions, making misconfiguration or compromise more durable.

Content

Scanner excerpt · docs/gateway-keepalive-setup-guide.md (reported line 71)May include surrounding context.

Step 3: 创建 Gateway LaunchAgent

bash
cat > ~/Library/LaunchAgents/ai.openclaw.gateway.plist <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

This duplicate match still points to the same LaunchAgent persistence mechanism. The risk is contextual: persistent user-level service startup is not inherently malicious, but it does make any underlying gateway weakness continuously available.

Content

Scanner excerpt · docs/gateway-keepalive-setup-guide.md (reported line 73)May include surrounding context.

bash
cat > ~/Library/LaunchAgents/ai.openclaw.gateway.plist <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

This duplicate match still points to the same LaunchAgent persistence mechanism. The risk is contextual: persistent user-level service startup is not inherently malicious, but it does make any underlying gateway weakness continuously available.

Content

Scanner excerpt · docs/gateway-keepalive-setup-guide.md (reported line 73)May include surrounding context.

bash
cat > ~/Library/LaunchAgents/ai.openclaw.gateway.plist <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

This finding corresponds to the declared LaunchAgent service label for the persistent gateway. In this skill context, the persistence is intentional for availability, but such mechanisms are still security-relevant because they create durable execution and automatic recovery after termination.

Content

Scanner excerpt · docs/gateway-keepalive-setup-guide.md (reported line 74)May include surrounding context.

md
cat > ~/Library/LaunchAgents/ai.openclaw.gateway.plist <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>ai.openclaw.gateway</string>

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This line closes the same persistent LaunchAgent definition. The issue is not the XML itself but the operational effect: installing a persistent auto-restarting service that may keep an exposed gateway available indefinitely.

Content

Scanner excerpt · docs/gateway-keepalive-setup-guide.md (reported line 117)May include surrounding context.

/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin EOF

text

Static analysis

No suspicious patterns detected.