Back to skill

Security audit

Session Manager - 会话管理

Security checks for vulnerabilities and agentic risk

Overview

The skill’s session cleanup behavior is mostly disclosed, but its optional proxy/user scripts make privileged Nginx changes and expose OpenClaw tokens in unsafe ways.

Review carefully before installing. The cleanup tools are ordinary but can delete old sessions if scheduled, so confirm retention and whitelist settings first. Avoid running setup-proxy.sh or create-users.sh on shared or production hosts until usernames, ports, and tokens are strictly validated and the token is no longer placed in URLs or Nginx config. Rotate any OpenClaw token previously used with this proxy setup.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/setup-proxy.sh:6
Finding

Unvalidated Input Is Injected into Privileged Nginx Configuration

Content
View full analysis
/dev/null << NGINX_EOF server { listen $PORT; server_name _; # 访问日志 access_log /var/log/nginx/openclaw-$USERNAME-access.log; error_log /var/log/nginx/openclaw-$USERNAME-error.log; location / { # 强制绑定 session 参数 return 302 http://\$host:$OPENCLAW_PORT/?session=$USERNAME&token=$TOKEN; } } NGINX_EOF ``` ### Technical Analysis The script copies the username, listening port, backend port, and token directly from arguments or the environment into a root-owned Nginx configuration. It performs no syntax, type, range, or control-character validation. Shell quoting does not protect the generated Nginx file. An input containing newline characters or Nginx syntax can terminate the intended directive and introduce additional directives. The bulk-creation script further allows usernames to originate from an external user-list file. The resulting configuration is written using `sudo tee`, tested using `sudo nginx -t`, and activated through an Nginx reload. A payload that remains syntactically valid can therefore become active with Nginx service privileges. ### Attack Path 1. An attacker supplies a crafted username through a user-list file or convinces an administrator to use crafted command-line arguments. 2. The administrator executes `create-users.sh` or `setup-proxy.sh` and approves the privileged operation. 3. The crafted value is inserted verbatim into log directives, the redirect directive, or other positions in the Nginx server block. 4. The script writes the injected configuration under `/etc/n ...[truncated 718 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/setup-proxy.sh:69
Finding

Authentication Token Is Stored and Transmitted in a Plaintext URL

Content
View full analysis
/dev/null << NGINX_EOF server { listen $PORT; server_name _; # 访问日志 access_log /var/log/nginx/openclaw-$USERNAME-access.log; error_log /var/log/nginx/openclaw-$USERNAME-error.log; location / { # 强制绑定 session 参数 return 302 http://\$host:$OPENCLAW_PORT/?session=$USERNAME&token=$TOKEN; } } NGINX_EOF ``` ### Technical Analysis The OpenClaw authentication token is embedded directly in a persistent Nginx configuration and returned to clients as part of an HTTP redirect query string. Query-string credentials can be retained in browser history, copied URLs, screenshots, proxy telemetry, network monitoring, and application-side request records. Because the redirect uses `http://`, the redirected URL and token are also transmitted without transport encryption unless another external control provides encryption. The script states that the token is not logged, but placing it in a URL cannot guarantee that behavior across browsers, reverse proxies, the backend, observability systems, or network infrastructure. The token also remains recoverable from the root-owned Nginx configuration for as long as that file exists. ### Attack Path 1. An administrator configures a proxy using a valid OpenClaw token. 2. The script stores that token in `/etc/nginx/sites-available/openclaw-`. 3. A user visits the generated proxy endpoint. 4. Nginx returns an HTTP redirect whose `Location` value contains the token. 5. The browser follows the plaintext URL and may retain it in history or expose it to local tooling and monitoring. 6. A local user, network observer, log reader, browser-extension operator, or telemetry operator obtains the URL. 7. The observer extracts and ...[truncated 610 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create-users.sh:10
Finding

Environment-Sourced Token Is Re-Exposed Through Child Process Arguments

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup-proxy.sh:76
Finding

Redirect-Based Session Assignment Does Not Enforce User Isolation

Content
View full analysis
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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (51)

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · README.md (reported line 22)May include surrounding context.

bash
# 自动安装(setup-proxy.sh 会自动检测)
sudo apt update && sudo apt install -y nginx

# 或手动安装后使用
nginx -v  # 验证安装

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

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

bash
# 自动安装(setup-proxy.sh 会自动检测)
sudo apt update && sudo apt install -y nginx

# 或手动安装后使用
nginx -v  # 验证安装

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

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

sh
```bash
# 自动安装(setup-proxy.sh 会自动检测)
sudo apt update && sudo apt install -y nginx

# 或手动安装后使用
nginx -v  # 验证安装

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./scripts/setup-proxy.sh teacher 8081

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./scripts/setup-proxy.sh teacher 8081

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./scripts/setup-proxy.sh teacher 8081

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./scripts/setup-proxy.sh teacher 8081

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./scripts/setup-proxy.sh teacher 8081

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./scripts/setup-proxy.sh teacher 8081

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./scripts/create-users.sh users.txt 8081

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
92% confidence
Finding

The deletion example uses a privileged rm on a system configuration path with a user-derived suffix, which is a risky pattern for parameter abuse. In context, the skill adds and removes per-user Nginx site files; without strict validation and path canonicalization, a malformed or attacker-controlled username could cause deletion of arbitrary files or disable unrelated sites.

Content

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

md
ls /etc/nginx/sites-available/openclaw-*

# 删除用户
sudo rm /etc/nginx/sites-enabled/openclaw-username
sudo systemctl reload nginx

# 查看访问日志

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/create-users.sh (reported line 121)May include surrounding context.

sh
echo "💡 提示:"
echo "  - 查看 Nginx 配置:ls /etc/nginx/sites-available/openclaw-*"
echo "  - 查看运行状态:sudo systemctl status nginx"
echo "  - 删除用户:sudo rm /etc/nginx/sites-enabled/openclaw-<用户名>"

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/setup-proxy.sh (reported line 128)May include surrounding context.

sh
echo "💡 管理命令:"
echo "   查看状态:sudo systemctl status nginx"
echo "   查看日志:sudo tail -f /var/log/nginx/openclaw-$USERNAME-access.log"
echo "   删除用户:sudo rm /etc/nginx/sites-enabled/openclaw-$USERNAME"

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 · README.md (reported line 22)May include surrounding context.

bash
# 自动安装(setup-proxy.sh 会自动检测)
sudo apt update && sudo apt install -y nginx

# 或手动安装后使用
nginx -v  # 验证安装

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 · SKILL.md (reported line 87)May include surrounding context.

bash
# 自动安装(setup-proxy.sh 会自动检测)
sudo apt update && sudo apt install -y nginx

# 或手动安装后使用
nginx -v  # 验证安装

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 · SKILL.md (reported line 216)May include surrounding context.

bash
# 自动安装(setup-proxy.sh 会自动检测)
sudo apt update && sudo apt install -y nginx

# 或手动安装后使用
nginx -v  # 验证安装

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README states that install.sh will automatically create a cron job for daily cleanup, but it does not prominently warn that sessions may be deleted on a schedule. For a session-management skill, unattended deletion can cause unexpected data loss or operational disruption, especially if users install it without reviewing the cleanup policy in detail.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language content of the skill is presented in Chinese throughout the document, including installation, warnings, and usage instructions. Because the file does not offer users an English or configurable language option, this imposes a specific language/locale without opt-in.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
90% confidence
Finding

The documentation tells users to run a privileged deletion command against /etc/nginx/sites-enabled using a placeholder-derived path. If a user substitutes the placeholder incorrectly or automation passes unsanitized names into similar commands, this can delete unintended Nginx configuration and disrupt service.

Content

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

md
ls /etc/nginx/sites-available/openclaw-*

# 删除用户
sudo rm /etc/nginx/sites-enabled/openclaw-username
sudo systemctl reload nginx

# 查看访问日志

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

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

bash
# 设置正确权限
chmod +x scripts/*.sh
chmod 600 config.json

配置无效

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest presents the skill as session cleanup/management, but the declared scripts include proxy setup and user creation, which materially expand its privilege and behavior scope. This mismatch is dangerous because users or automated installers may grant trust or permissions based on the stated purpose while the skill can perform unrelated system-changing actions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Proxy setup changes network-routing behavior and can affect confidentiality, integrity, and availability of traffic, yet it is not clearly related to cleaning inactive sessions. Bundling network reconfiguration into a maintenance skill increases the chance of unexpected interception, misrouting, or hidden exfiltration paths under the guise of benign automation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Proxy setup changes network-routing behavior and can affect confidentiality, integrity, and availability of traffic, yet it is not clearly related to cleaning inactive sessions. Bundling network reconfiguration into a maintenance skill increases the chance of unexpected interception, misrouting, or hidden exfiltration paths under the guise of benign automation.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

The changelog indicates the skill includes sudo-related behavior or prompts, which implies privileged execution may be required by one or more scripts. Privileged execution significantly raises risk because any unexpected functionality already present in the package—such as proxy setup or user creation—could make system-wide changes if run with elevated rights.

Content

Scanner excerpt · _meta.json (reported line 15)May include surrounding context.

json
"category": "productivity",
  "requirements": ["bash", "jq"],
  "scripts": ["scripts/cleanup-sessions.sh", "scripts/list-sessions.sh", "scripts/monitor-sessions.sh", "scripts/setup-proxy.sh", "scripts/create-users.sh"],
  "changelog": "1.0.3: 🔐 安全修复 - 移除默认 Token,改用环境变量传递;添加 sudo 权限确认提示;修复 Token 日志泄露风险"
}

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script’s user-facing strings, prompts, and usage messages are entirely in Chinese, including the confirmation prompt at L36. This imposes a specific language on all users with no opt-in, fallback, or documented justification, which matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.