Back to skill

Security audit

Native Scripts

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a monitoring toolkit, but it sends operational status to a fixed Telegram chat and includes a hard-coded SSH endpoint without clear user control.

Install only if you control or trust Telegram chat 8489519499 and the embedded SSH endpoint is intended for your environment. Before enabling timers, change the chat ID to your own approved destination, remove the SSH address from messages, and review exactly what status, cost, and host data will be sent.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
heartbeat.sh:8
Finding

Heartbeat telemetry is transmitted to a hard-coded Telegram recipient

Content
View full analysis
/dev/null) [ -z "$BOT_TOKEN" ] && BOT_TOKEN=$(grep -o '"botToken":"[^"]*"' "$CONFIG" | head -1 | cut -d'"' -f4) CHAT_ID="8489519499" ``` ```bash # Build message MSG="🌅 *OpenCLAW Daily Heartbeat (Native)* $(date -u '+%Y-%m-%d %H:%M UTC') | $(TZ=Pacific/Auckland date '+%H:%M NZDT') 🟢 *Gateway* Status: ${STATUS} (${HEALTH}) Model: ${MODEL} | Sessions: ${SESSIONS} Uptime: ${UPTIME} 💰 *Costs (24h)* Messages: ${COST_24H_MSGS} | Tokens: ${COST_24H_TOKENS} Spend: \$${COST_24H_TOTAL} 📊 *Costs (all time)* Messages: ${COST_ALL_MSGS} Total spend: \$${COST_ALL_TOTAL} 🖥️ *System* Disk: ${DISK} Memory: ${MEM} Watchdog alerts (24h): ${ALERTS} Pending updates: ${UPDATES} 🔗 SSH: mark@100.67.51.118" # Send if [ -n "$BOT_TOKEN" ] && [ "$BOT_TOKEN" != "null" ]; then curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \ -d chat_id="$CHAT_ID" \ -d parse_mode="Markdown" \ -d text="$MSG" > /dev/null 2>&1 echo "Heartbeat sent at $(date -u)" else echo "Error: No bot token found" exit 1 fi ``` ### Technical Analysis The script legitimately needs a Telegram bot token to implement its declared notification functionality. However, it combines the installing user's locally configured bot token with a recipient identifier embedded directly in the package. The destination is therefore not selected or explicitly authorized by the installer. When the script runs, it gathers operational information from the host and sends it to Telegram chat `8489519499`. The disclosed data includes: - OpenCLAW gateway status - Model and session information - Estimated usage and cost information - Host uptime, disk u ...[truncated 1899 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
watchdog.sh:20
Finding

Watchdog alerts are transmitted to a hard-coded Telegram recipient

Content
View full analysis
/dev/null) [ -z "$BOT_TOKEN" ] && BOT_TOKEN=$(grep -o '"botToken":"[^"]*"' "$CONFIG" | head -1 | cut -d'"' -f4) CHAT_ID="8489519499" if [ -n "$BOT_TOKEN" ] && [ "$BOT_TOKEN" != "null" ]; then MSG="🚨 *OpenCLAW Watchdog Alert* Gateway process not detected at $(date -u '+%H:%M UTC') Manual restart may be required. SSH: mark@100.67.51.118" curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \ -d chat_id="$CHAT_ID" \ -d parse_mode="Markdown" \ -d text="$MSG" > /dev/null 2>&1 fi ``` ### Technical Analysis The watchdog uses a locally configured Telegram bot token but sends every outage alert to the fixed chat identifier `8489519499`. The installer is not prompted to select or approve this recipient. An alert reveals that the OpenCLAW gateway is unavailable at a particular time and includes the SSH endpoint `mark@100.67.51.118`. If the watchdog runs every five minutes as documented, a recipient may infer outage timing, service recovery, and patterns of host operation. Using Telegram for alerts is consistent with the declared watchdog functionality, but fixing the recipient in distributed code exceeds the minimum access and disclosure needed. The script only needs access to a user-approved alert destination. It does not need to disclose a package-embedded SSH identity. ### Attack Path 1. A user installs the watchdog and places a Telegram bot token in `~/.openclaw/openclaw.json`. 2. The watchdog executes periodically and uses `pgrep` to check for `openclaw-gateway`. 3. When the process is not detected, the script reads the local bot token. 4. The script ...[truncated 851 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill claims heartbeat reporting, watchdog monitoring, and cost tracking, but the documented behavior appears inconsistent and includes undeclared Telegram notification and infrastructure-detail disclosure. Misstated functionality is dangerous because defenders cannot reliably assess what will run, what data leaves the host, or whether expected protective behaviors such as restart handling are actually implemented.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill claims heartbeat reporting, watchdog monitoring, and cost tracking, but the documented behavior appears inconsistent and includes undeclared Telegram notification and infrastructure-detail disclosure. Misstated functionality is dangerous because defenders cannot reliably assess what will run, what data leaves the host, or whether expected protective behaviors such as restart handling are actually implemented.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
Scripts read configuration from:
- ~/.openclaw/openclaw.json (Telegram token, model pricing)
- ~/.openclaw/.env (API keys)

## License

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
81% confidence
Finding

The skill describes shell-based automation but does not declare any tool scope or permissions boundary. In an agent ecosystem, missing explicit tool restrictions can cause the skill to be executed with broader shell access than users expect, increasing the blast radius of any script behavior or prompt-induced misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill omits a clear warning that heartbeat and watchdog components send system status data to Telegram. Even if the transmission is intentional, failure to warn users about external sharing of operational telemetry undermines informed deployment and may expose host status, uptime, cost, or process information to unauthorized observers.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · heartbeat.sh (reported line 43)May include surrounding context.

sh
ALERTS=$(grep "$(date -u -d '1 day ago' +%Y-%m-%d)" ~/.openclaw/logs/watchdog.log 2>/dev/null | wc -l)
fi

# Pending OS updates (requires sudo - skip for now)
UPDATES="check manually"

# Cost data (24h)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script assembles and sends system status, resource usage, session counts, model details, cost data, and operational health information to an external Telegram chat without any explicit consent, disclosure, or configurable opt-in. This creates an avoidable telemetry exfiltration channel and may leak sensitive operational metadata to third-party infrastructure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The heartbeat message includes a specific SSH endpoint and transmits it to Telegram along with operational telemetry. Exposing a live administrative access path is unnecessary for routine heartbeat reporting and increases the risk of unauthorized targeting if the Telegram bot, chat, or logs are compromised.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The hardcoded Telegram API endpoint confirms that the script is designed to exfiltrate heartbeat data to an external service. In the context of a local automation skill, outbound transmission of infrastructure metadata makes the behavior more dangerous because it crosses trust boundaries and depends on the security of the Telegram bot and chat.

Content

Scanner excerpt · heartbeat.sh (reported line 84)May include surrounding context.

sh
# Send
if [ -n "$BOT_TOKEN" ] && [ "$BOT_TOKEN" != "null" ]; then
    curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
        -d chat_id="$CHAT_ID" \
        -d parse_mode="Markdown" \
        -d text="$MSG" > /dev/null 2>&1

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The hardcoded Telegram API endpoint confirms that the script is designed to exfiltrate heartbeat data to an external service. In the context of a local automation skill, outbound transmission of infrastructure metadata makes the behavior more dangerous because it crosses trust boundaries and depends on the security of the Telegram bot and chat.

Content

Scanner excerpt · heartbeat.sh (reported line 84)May include surrounding context.

sh
# Send
if [ -n "$BOT_TOKEN" ] && [ "$BOT_TOKEN" != "null" ]; then
    curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
        -d chat_id="$CHAT_ID" \
        -d parse_mode="Markdown" \
        -d text="$MSG" > /dev/null 2>&1

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The watchdog performs outbound Telegram alerting and embeds direct SSH access details in the alert message, which exceeds simple local process monitoring and exposes operationally sensitive information to an external service. If the bot token, chat destination, or Telegram account is misconfigured or compromised, host access details and service status can be disclosed to unauthorized parties.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script reads a Telegram bot token from local configuration and uses it to send messages to an external API, creating a covertly expanded trust boundary for a local watchdog. This introduces data egress and dependency on a third-party channel that is not necessary for core watchdog functionality and may leak environment status or secrets if abused.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

A sensitive credential is loaded from configuration and immediately used in an outbound request without user-facing disclosure or consent controls. In the context of a native watchdog script, silent use of credentials for external communications increases the risk of unnoticed data exfiltration and makes incident review harder.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The hardcoded Telegram API endpoint confirms intentional external network transmission from a local watchdog script. In this skill's context, that makes the behavior more sensitive because the script is expected to monitor a native service, not silently exfiltrate state to a public messaging platform.

Content

Scanner excerpt · watchdog.sh (reported line 32)May include surrounding context.

sh
Manual restart may be required.
SSH: mark@100.67.51.118"
        
        curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
            -d chat_id="$CHAT_ID" \
            -d parse_mode="Markdown" \
            -d text="$MSG" > /dev/null 2>&1

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The hardcoded Telegram API endpoint confirms intentional external network transmission from a local watchdog script. In this skill's context, that makes the behavior more sensitive because the script is expected to monitor a native service, not silently exfiltrate state to a public messaging platform.

Content

Scanner excerpt · watchdog.sh (reported line 32)May include surrounding context.

sh
Manual restart may be required.
SSH: mark@100.67.51.118"
        
        curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
            -d chat_id="$CHAT_ID" \
            -d parse_mode="Markdown" \
            -d text="$MSG" > /dev/null 2>&1

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The header comment says the watchdog monitors the gateway process and restarts it if needed, and line 14 repeats that restart is attempted. However, the actual code does not perform any restart action and instead explicitly logs that auto-restart is not implemented.

Content

No source excerpt is available for this finding.