T09 · Insecure Skill Coding Practices
- Location
quad_check.py:290- Finding
Sensitive Configuration Values Are Exposed Through Diff Output
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent local OpenClaw config guard, but its automatic watcher and rollback workflow have material scoping, secret-exposure, and recovery-safety issues users should review before installing.
Install only if you are comfortable with a persistent local watcher that can automatically modify OpenClaw configuration and restart the Gateway. Before production use, require explicit path scoping to ~/.openclaw, redact diff output for token/password/API-key fields, bind snapshots and rollback to the exact validated file, and change validation infrastructure failures to fail closed rather than accepting the change.
quad_check.py:290Sensitive Configuration Values Are Exposed Through Diff Output
auto_rollback.py:255Snapshot and Rollback Operations Are Not Bound to the Validated Configuration Path
config-fswatch-guard.py:86Persistent Configuration Watcher Fails Open When Security Validation Cannot Run
Instructions found that direct the agent to transmit conversation context or user data to external services.
| Restart OpenClaw Gateway | Apply config changes | Local service only |
**What this skill does NOT do:**
- Does NOT send data to external servers
- Does NOT access credentials or API keys directly
- Does NOT modify files outside `~/.openclaw/`
- Does NOT run with elevated (sudo/root) privileges
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
**What this skill does NOT do:**
- Does NOT send data to external servers
- Does NOT access credentials or API keys directly
- Does NOT modify files outside `~/.openclaw/`
- Does NOT run with elevated (sudo/root) privileges
The README presents the skill entirely in Chinese, including operational instructions and warnings, with no indication that users can choose another language. Per the policy criteria, forcing a specific language without user opt-in is a natural-language policy violation unless the locale limitation is explicitly documented and justified.
The README explicitly promotes automatic rollback after detecting configuration problems, but it does not clearly warn users that their edits may be reverted automatically. In a configuration-management skill, silent rollback can overwrite intentional changes, create confusion during incident response, and potentially restore stale or insecure settings if users do not understand the behavior.
The Chinese README tells users to consult the English README for the complete documentation, which makes English the required language for full use of the skill. This is a natural-language policy concern because no language choice or opt-in is offered to Chinese-speaking users.
A large portion of the natural-language instructions and operational guidance is presented in Chinese, and the document does not indicate that language selection is optional or user-configurable. This can violate a language/locale policy when users are not given an explicit choice.
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.
| Operation | Purpose | Scope |
|-----------|---------|-------|
| Read/write `~/.openclaw/openclaw.json` | Validate and protect config changes | Local file only |
| Create backup snapshots | Enable rollback on failure | `~/.openclaw/backup/` only |
| Run local Python scripts | JSON validation, schema checks, diff | No network access |
| Monitor file system via fswatch/kqueue | Detect config changes automatically | Watches only OpenClaw config files |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
| Restart OpenClaw Gateway | Apply config changes | Local service only |
**What this skill does NOT do:**
- Does NOT send data to external servers
- Does NOT access credentials or API keys directly
- Does NOT modify files outside `~/.openclaw/`
- Does NOT run with elevated (sudo/root) privileges
The skill claims it does not access credentials or API keys directly, yet its alerting design references Telegram and Signal notifications, which usually require tokens, bot credentials, or linked local clients. This mismatch is dangerous because operators may trust the declaration and deploy the skill without realizing it depends on external messaging integrations that can expose configuration data or trigger outbound communications.
The trigger conditions are extremely broad and mandatory for essentially any JSON configuration change under ~/.openclaw/, with 'no exceptions.' Overbroad automatic interception and monitoring can cause unintended execution, denial of service to legitimate workflows, or repeated rollback behavior when unrelated files change.
The module docstring is entirely in Chinese, including the title, usage guidance, and operational descriptions. This imposes a specific language on users without any visible opt-in, alternative locale, or justification that the skill is region-specific.
The trigger list is broad enough to match many ordinary configuration-related requests, which can cause this skill to activate outside its intended scope. Because the skill appears to perform config modification and rollback actions, overbroad routing increases the chance of unintended execution on sensitive configuration tasks.
The rollback API accepts a config_path argument, but _execute_rollback ignores it and always invokes the rollback helper with only a generic 'rollback' command. This can cause the system to roll back the wrong target or a global/default configuration instead of the failed one, creating integrity and availability issues during incident handling.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print(f"\n🔄 正在执行自动回滚: {config_path}")
try:
result = subprocess.run(
["python3", str(self.rollback_script), "rollback"],
capture_output=True,
text=True,
This manifest says the skill 'automatically monitors file changes' and that 'file changes automatically trigger the full process,' but it does not specify which files, directories, or contexts are in scope. Without explicit constraints or exclusion conditions, the trigger condition is ambiguous and could lead to unintended invocation on routine edits.
The top-level documentation says the watcher does three things on config change: validate JSON, roll back on syntax error, and reset a health-check counter. In reality, the implementation additionally loads another skill from disk for "four-check" validation, may trigger automatic rollback based on those results, and explicitly restarts the Gateway after rollback on JSON errors, which materially expands the behavior beyond the stated intent.
The module docstring and operational log messages are written in Chinese, which establishes a fixed language for user-visible behavior. Under the stated policy, forcing a specific language without offering user choice or documenting a justified locale restriction is a natural-language policy violation.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 立即回滚
_self_writing = True
try:
result = subprocess.run(
["python3", ROLLBACK_SCRIPT, "rollback"],
capture_output=True, text=True, timeout=10
)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
os.path.expanduser("~/.local/share/fnm/node-versions/v24.13.0/installation/bin/openclaw")
)
try:
result = subprocess.run(
[openclaw_bin, "gateway", "restart"],
capture_output=True, text=True, timeout=30
)
This code presents its primary description, usage instructions, status messages, and errors in Chinese, which imposes a specific language on users. There is no opt-in, alternate locale, or explanation that the skill is intended only for a Chinese-speaking or region-specific environment.
The documentation claims the tool 'intercepts' configuration modifications, but the implementation only performs checks and possible rollback after actions are already underway or completed. This can create a false sense of enforcement, causing operators or dependent tooling to assume unsafe changes are blocked when they are not, which may allow harmful configuration changes to take effect before detection or rollback.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# Step 1: 创建快照
print("\n[1/4] 📸 创建快照...")
import subprocess
result = subprocess.run(
["python3", BACKUP_SCRIPT, "snapshot"],
capture_output=True, text=True
)
This Python file presents its module docstring, usage guidance, and operational descriptions entirely in Chinese, which can constitute a language policy violation when no user opt-in or alternative locale is offered. The rule applies to all file types, including code files, when natural-language strings impose a specific language.
The phase docstring describes two checks: gateway reachability and config writability, but line L357 only says '配置文件可写性' as a health criterion without indicating that writability is mandatory for overall health. In practice, the function returns failure solely because the file is not writable, which expands 'health' from service availability into a write-permission gate for the config path.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
try:
# 1. 检查 Gateway 健康
try:
result = subprocess.run(
["curl", "-s", "-o", "/dev/null", "-w", "%{http_code}",
"http://127.0.0.1:18789/health"],
timeout=5, capture_output=True, text=True
No suspicious patterns detected.