T09 · Insecure Skill Coding Practices
- Location
scripts/update_openclaw_config.py:17- Finding
Publicly Hard-Coded and Reused Hook Authentication Token
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Wake-on-LAN skill is mostly purpose-aligned, but it adds a persistent local message hook with weak authentication and broad access to message and device data.
Review before installing. Use only with trusted local users, generate and rotate a unique hook token, avoid the published fixed token, prefer a least-privilege user service, restrict who can send WoL commands, protect ~/.openclaw files with private permissions, and disable or redact message-body logging.
scripts/update_openclaw_config.py:17Publicly Hard-Coded and Reused Hook Authentication Token
scripts/openclaw_hook.py:120Missing Sender-Level Authorization for Shared Device Operations
scripts/openclaw_hook.py:56Hook Authentication Fails Open When No Token Is Configured
scripts/install.py:204Sensitive Tokens, Device Data, and Session State Are Stored Without Enforced Permissions
scripts/openclaw_hook.py:113Inbound Message Content and User Identifiers Are Logged in Plaintext
scripts/install.py:27Installer Downloads and Executes an Unpinned PyPI Dependency
scripts/install.py:115Automatic and Privileged Persistence Exceeds Minimum Required Privileges
scripts/openclaw_hook.py:95Unbounded HTTP Bodies and Workflow Notes Permit Resource Exhaustion
The skill claims to perform conversational WoL operations, but the documented integration also modifies local OpenClaw configuration, enables hooks, stores a fixed or persistent authentication token, configures a local HTTP endpoint, and prompts a gateway restart. These are privileged, persistent changes with security implications, and hiding them behind a benign automation label can mislead users and administrators.
The skill claims to perform conversational WoL operations, but the documented integration also modifies local OpenClaw configuration, enables hooks, stores a fixed or persistent authentication token, configures a local HTTP endpoint, and prompts a gateway restart. These are privileged, persistent changes with security implications, and hiding them behind a benign automation label can mislead users and administrators.
The skill claims to perform conversational WoL operations, but the documented integration also modifies local OpenClaw configuration, enables hooks, stores a fixed or persistent authentication token, configures a local HTTP endpoint, and prompts a gateway restart. These are privileged, persistent changes with security implications, and hiding them behind a benign automation label can mislead users and administrators.
The skill claims to perform conversational WoL operations, but the documented integration also modifies local OpenClaw configuration, enables hooks, stores a fixed or persistent authentication token, configures a local HTTP endpoint, and prompts a gateway restart. These are privileged, persistent changes with security implications, and hiding them behind a benign automation label can mislead users and administrators.
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
3', 'text': '添加网络唤醒' }
response = handle_openclaw_message(message_data) print(response)
### 在 message 工具中调用
```bash
# 通过 OpenClaw message 工具接收消息后
python3 /path/to/wol-wakeup/scripts/message_handler.py "添加网络唤醒" "user123"
建议设置定时任务(cron)每分钟检查超时:
# 添加到 crontab
* * * * * python3 /path/to/wol-wakeup/scripts/message_handler.py check-timeouts
或在消息处理时惰性检查(已内置)。
# 测试添加设备工作流
cd /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/scripts
python3 wol_workflow.py test-add
# 交互式测试
python3 wol_workflow.py interactive-add
# 查看活跃会话
python3 wol_workflow.py list-sessions
# 查看会话信息
python3 wol_workflow.py session-info <session_id>
# 检查超时
python3 wol_workflow.py check-timeouts
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).
解决:
# 删除状态文件(会丢失所有活跃会话)
rm ~/.openclaw/wol/workflows/sessions.json
The guide introduces an inbound HTTP hook server and workflow engine that materially expands the skill from simple WoL automation into a message-intercepting integration component. Broadening a narrowly scoped skill into a generic hook processor increases attack surface, trust boundaries, and the chance that unrelated messages are captured or processed unexpectedly.
The nohup-based background start keeps the hook server running detached from the terminal and writes logs to /tmp, creating ad hoc persistence and a harder-to-monitor long-lived process. In this skill context, that means a generic inbound message hook can continue operating beyond the user's immediate intent, with possible token or message metadata exposure through temporary logs.
后台启动:
cd /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/scripts
nohup python3 openclaw_hook.py --port 8765 --token 6fb57eb806f64da4e70b1b7a8c41f6b97a4788dc9f6b15430cdfedc0b61c75b1 > /tmp/hook_server.log 2>&1 &
systemd 服务启动(推荐生产环境):
The guide instructs users to install a systemd service, copy files into /etc/systemd/system, restart gateway components, and modify configuration, but it does not prominently warn that these steps change persistent system state and could disrupt existing services. Users may apply the commands without understanding rollback, privilege requirements, or service exposure implications.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
systemd 服务启动(推荐生产环境):
# 创建日志目录
sudo mkdir -p /var/log/openclaw
# 安装服务
sudo cp /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/openclaw-hook.service /etc/systemd/system/
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
systemd 服务启动(推荐生产环境):
# 创建日志目录
sudo mkdir -p /var/log/openclaw
# 安装服务
sudo cp /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/openclaw-hook.service /etc/systemd/system/
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
systemd 服务启动(推荐生产环境):
# 创建日志目录
sudo mkdir -p /var/log/openclaw
# 安装服务
sudo cp /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/openclaw-hook.service /etc/systemd/system/
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
systemd 服务启动(推荐生产环境):
# 创建日志目录
sudo mkdir -p /var/log/openclaw
# 安装服务
sudo cp /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/openclaw-hook.service /etc/systemd/system/
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
systemd 服务启动(推荐生产环境):
# 创建日志目录
sudo mkdir -p /var/log/openclaw
# 安装服务
sudo cp /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/openclaw-hook.service /etc/systemd/system/
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
systemd 服务启动(推荐生产环境):
# 创建日志目录
sudo mkdir -p /var/log/openclaw
# 安装服务
sudo cp /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/openclaw-hook.service /etc/systemd/system/
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo mkdir -p /var/log/openclaw
# 安装服务
sudo cp /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/openclaw-hook.service /etc/systemd/system/
# 重载 systemd 并启动
sudo systemctl daemon-reload
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo mkdir -p /var/log/openclaw
# 安装服务
sudo cp /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/openclaw-hook.service /etc/systemd/system/
# 重载 systemd 并启动
sudo systemctl daemon-reload
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo mkdir -p /var/log/openclaw
# 安装服务
sudo cp /root/.openclaw/workspace-zhongshu/skills/wol-wakeup/openclaw-hook.service /etc/systemd/system/
# 重载 systemd 并启动
sudo systemctl daemon-reload
Enabling the service for automatic startup creates persistence for the hook server, which intercepts inbound messages and processes tokens and workflow state. In the context of a WoL skill, making a message-processing hook persist across reboots increases blast radius if the service is misconfigured, compromised, or broader than users expect.
# 重载 systemd 并启动
sudo systemctl daemon-reload
sudo systemctl enable openclaw-hook
sudo systemctl start openclaw-hook
# 查看状态
The documentation recommends enabling a persistent boot-time service for the hook server, which means the message-handling component remains resident without requiring a deliberate per-session launch. For a skill whose stated purpose is WoL automation, persistent background interception infrastructure is a significant expansion and can prolong exposure if vulnerabilities or token leakage occur.
# 重载 systemd 并启动
sudo systemctl daemon-reload
sudo systemctl enable openclaw-hook
sudo systemctl start openclaw-hook
# 查看状态
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
健康检查:
curl http://127.0.0.1:8765/health
# 预期输出:{"status": "healthy", "active_sessions": 0}
The testing instructions send inbound message content, channel names, and user identifiers such as 'from' values to the hook service, but the guide omits any privacy or data-handling warning. Even on localhost, this can normalize collection of personal identifiers and message content without documenting retention, logging, or minimization expectations.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
1. 使用强随机 token(至少 32 字符)
2. Hook 服务仅监听 localhost(127.0.0.1)
3. 定期更新 token
4. 限制文件权限(`chmod 600 openclaw.json`)
---
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
- 检查 Authorization header 格式:`Bearer <token>`
### 会话状态丢失
- 检查状态文件权限:`ls -la ~/.openclaw/wol/workflows/`
- 确保磁盘空间充足
- 避免同时运行多个 Hook 服务实例
The extension section explicitly markets the workflow engine as reusable for surveys, order creation, reservations, and information collection, turning a WoL skill into a general-purpose conversation platform. That scope creep is dangerous because users may install the skill for WoL but unknowingly gain infrastructure suitable for broader data collection and message handling.