T09 · Insecure Skill Coding Practices
- Location
scripts/lib/config.sh:6- Finding
Predictable Temporary Configuration Allows Command Resolution Hijacking
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
SysGuard is mostly a coherent system-monitoring skill, but it exposes system cleanup and long-running monitoring through broadly usable chat commands with weak scoping and a risky temporary configuration fallback.
Install only in an admin-controlled OpenClaw environment, preferably under a dedicated unprivileged account. Restrict who can send SysGuard commands, disable or gate sgc and sgm unless needed, use a private 0600 config path instead of any /tmp fallback, and only configure trusted Feishu or WeCom webhooks because alert content leaves the host.
scripts/lib/config.sh:6Predictable Temporary Configuration Allows Command Resolution Hijacking
scripts/clean.sh:10Destructive System-Wide Cleanup Is Exposed Without Authorization
The installation note says all users can invoke the skill in any IM conversation by simply saying sg, which indicates an overly broad trigger surface. This can cause unintended activation in normal chats and may launch system-observing or system-modifying behavior in contexts where the user did not explicitly intend to run an administrative skill.
The README advertises 'Safe Cleaning' and the sgc cache cleanup command without warning that it may delete files or alter local state. Framing a destructive or state-changing operation as safe, especially in a chat-invoked skill, can mislead users into triggering cleanup in the wrong environment and causing data loss or operational disruption.
The README explicitly states that all users can invoke SysGuard 'in any IM conversation' by simply talking to the bot, which encourages overly broad activation semantics for an operational skill that exposes monitoring, diagnostics, and cleanup actions. In an agent environment, ambiguous natural-language triggering increases the chance of accidental execution, social-engineering abuse, or invocation by unauthorized participants in shared chats.
The skill advertises cache cleaning and persistent background monitoring but provides no visible warnings about side effects, resource usage, permissions, or operational risk. Users may trigger disk-affecting cleanup or long-running monitoring without understanding the impact, increasing the chance of accidental disruption or privacy-sensitive system observation.
The phrase 中文优先 indicates a language preference policy baked into the skill, but the documentation does not offer the user a choice of language or describe opt-in behavior. This can violate language or locale policy requirements when users have not explicitly selected Chinese output.
The entire skill-facing text is written only in Chinese, with no indication that the skill is intended exclusively for a Chinese-speaking audience or that users can choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.
The file header states 'Clean Script - Cache & Temp Cleanup', which implies a limited cleanup scope focused on caches and temporary files. However, the implementation also vacuums system journal logs at L33 and deletes JSON history data at L40, which goes beyond cache/temp cleanup and contradicts the documented intent.
This shell script emits multiple user-facing status messages only in Chinese, such as cleanup progress and completion notices. That creates a language/locale policy issue because the skill forces a specific language without any opt-in or documented regional constraint.
User-visible strings throughout the diagnostics output are hard-coded in Chinese, including status messages and recommendations, with no indication of user opt-in or locale selection. This is a natural-language policy concern because it constrains the skill to a specific language without offering a choice or documenting a justified region-specific scope.
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.
fi
# --- Event 7: Cron 堆积 ---
local cron_count=$(crontab -l 2>/dev/null | grep -v "^#" | grep -v "^$" | wc -l)
if [[ $cron_count -gt 20 ]]; then
issues[issue_index++]="[7/8] ℹ️ 定时任务较多 | 当前: $cron_count 个 | 可能影响: 系统负载 | 建议: 清理不必要的定时任务"
fi
The script persists sensitive webhook URLs directly into a configuration file at CONFIG_FILE, which defaults to a path under /tmp when CONFIG_DIR is unset. This creates a realistic risk of credential disclosure to other local users or processes, especially if file permissions are not restricted, and /tmp is a shared, world-accessible location on many systems.
The user-facing notification message is written entirely in Chinese, including the title and operational guidance, with no indication that language is configurable or limited to a justified region-specific context. This creates a natural-language policy issue because the skill imposes a specific locale on users without opt-in.
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.
# === Run as Daemon ===
run_daemon() {
nohup "$0" monitor > /dev/null 2>&1 &
echo $!
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
EOF
)
curl -s -X POST "$webhook" \
-H "Content-Type: application/json" \
-d "$payload" > /dev/null 2>&1
This shell script sends the provided title and message to an external Feishu webhook via HTTP, which can transmit user or system-generated data off-host. While the script logs success afterward, there is no prior warning, confirmation, or inline comment/docstring disclosing that message content will be sent to a third-party service.
This shell script posts the title and message to an external WeCom webhook, potentially sharing operational or user data with an external service. The file does not provide a prior disclosure, confirmation, or explanatory comment making this data transmission explicit.
This shell script presents command hints and, elsewhere, help text exclusively in Chinese, which imposes a specific language on users without opt-in. The file does not indicate that the skill is intended only for a Chinese-speaking or region-specific audience, so this is a natural-language policy concern.
The help and usage strings from these lines are entirely Chinese-language, and the script provides no alternative language option or opt-in flow. That can violate language/locale policy when a skill is expected to be generally usable across users.
The user-facing output strings in this shell script are written in Chinese, including status messages and installation guidance, with no indication that language is configurable or limited to a justified region-specific context. This violates the language/locale policy criterion because it imposes a specific language without user opt-in.
The script includes user-facing Chinese text such as '测试' and '系统守护' with no indication that the skill is intentionally locale-specific or that users can select their preferred language. This can violate language/locale policy when a skill imposes a language without opt-in.
At L079 the documentation explicitly says the tool only discovers issues and notifies the user, emphasizing that the user decides whether to restart. Later, L151 and L171 describe a persistent monitoring/guarding mode running in the background, which conflicts with the earlier portrayal of a passive, notification-only tool and creates intent ambiguity about autonomy.
Advertising one-click cleanup without warning that it deletes logs, caches, or temporary files normalizes a potentially destructive action as harmless. Users may trigger cleanup casually through chat, causing loss of forensic data, troubleshooting artifacts, or application state needed for recovery.
The article states that any user in any IM conversation can invoke the skill with sg, with no mention of authorization, role checks, or trusted-chat restrictions. In a bot-connected environment, unrestricted invocation can expose sensitive system status and create a path to abuse operational commands from untrusted users.
The sgc example shows deletion of OpenClaw temporary files, NPM cache, and system logs while presenting it as a simple conversational command, without any safety warning or approval step. If exposed through a chat bot, this can let users erase logs or operational data remotely, undermining incident response and potentially disrupting applications.
The manifest description is written entirely in Chinese and does not indicate that the skill is region-specific or that other language options are available. Under the language/locale policy, this can be a natural-language policy concern because it implicitly fixes the skill presentation to a specific language without user opt-in or justification.