Back to skill

Security audit

Wsl Service Deploy

Security checks for vulnerabilities and agentic risk

Overview

This skill is a WSL service installer, but it normalizes unsafe root access, hardcoded weak passwords, remote Redis exposure, and destructive cleanup commands.

Review carefully before installing. Use only in a disposable WSL environment unless the skill is revised to remove hardcoded passwords, avoid echoing secrets into su or command lines, bind Redis to localhost by default, require explicit confirmation before purging packages or deleting data, and avoid running generated /tmp scripts as root.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
references/wsl-commands.md:11
Finding

Hard-Coded Root and Service Credentials Exposed Through Command Lines

Content
View full analysis
' | su -c 'bash /tmp/install_.sh' - root" & ``` ```markdown | Root password | `123456` | ``` `references/wsl-commands.md`: ```bash # Method 2: Execute as root (bypass the sudo password) wsl.exe -e bash -c "echo '123456' | su -c 'command' - root" # Method 3: SSH root connection (fallback) sshpass -p "123456" ssh root@ "command" ``` ```bash mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456'; FLUSH PRIVILEGES;" redis-cli -a 123456 PING ``` ### Technical Analysis The Skill documents and repeatedly reuses the fixed value `123456` as the WSL root password and as the default MySQL and Redis password. This makes privileged credentials predictable to anyone who can inspect the Skill, its generated commands, documentation, or audit logs. The credentials are also passed through command-line arguments or generated shell command text. Depending on the host and WSL configuration, these values may be exposed through process listings, shell history, terminal capture, Agent transcripts, or operational logs. Reusing one weak password across the operating system and multiple services further increases the blast radius of a single credential disclosure. Using `echo PASSWORD | su` also bypasses the interactive safeguards normally associated with privileged elevation and encourages unattended root execution with a globally known secret. ### Attack Path 1. An attacker reads the Skill package or otherwise learns its documented default password, `123456`. 2. The Skill is used without replacing the default credentials. 3. The attacker identifies a reachable access path, such as an ...[truncated 1150 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
references/wsl-commands.md:64
Finding

Redis Is Persistently Exposed on All Interfaces with a Weak Publicly Documented Password

Content
View full analysis
` — configure an authentication password - `bind 0.0.0.0` — permit external connections - **Autostart**: `systemctl enable redis-server` ``` ### Technical Analysis The Redis deployment procedure changes the bind address from loopback to `0.0.0.0`, making Redis listen on every available network interface. It then protects the service with the fixed password `123456`, which is weak and publicly disclosed by the Skill itself. The service is also enabled with `systemctl enable redis-server`, so the insecure exposure survives service restarts and WSL boots when systemd startup is active. The workflow does not establish firewall restrictions, network allowlists, TLS, Redis ACL users, or an explicit user-consent gate before enabling remote access. Although enabling a service is compatible with the declared deployment purpose, external exposure and boot persistence are not necessary for a default local WSL installation. They exceed the minimum configuration needed to install and locally test Redis. ### Attack Path 1. A user invokes the documented Redis deployment workflow. 2. The Skill rewrites the Redis bind address to `0.0.0.0`. 3. Redis is restarted ...[truncated 1095 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:98
Finding

Unrestricted Root Execution and Destructive Package-Management Recovery Commands

Content
View full analysis
' | su -c '' - root` to bypass the sudo password 3. **Write the script before running it** — write multi-step operations into a `/tmp/` script and execute it in one operation ``` The uninstall workflow includes recursive deletion: ```bash systemctl stop DEBIAN_FRONTEND=noninteractive aptitude purge -y rm -rf aptitude purge -y ~c ``` The general rules include forced package-manager recovery: ```bash rm -f /var/lib/dpkg/lock* /var/lib/apt/lists/lock /var/cache/apt/archives/lock ``` ```bash killall apt; killall dpkg; dpkg --configure -a ``` The generated script is then executed with full root privileges: ```bash wsl.exe -e bash -c "echo '' | su -c 'bash /tmp/install_.sh' - root" & ``` ### Technical Analysis The Skill treats unrestricted root execution as its normal mode rather than elevating only the individual commands that require administrative privileges. Generated scripts are written into the shared `/tmp` namespace and then run as root, increasing the consequences of incorrect command generation, unsafe path handling, or local interference. The package recovery procedure deletes lock files and indiscriminately terminates every process named `apt` or `dpkg`. Package-manager lock files indicate active or interrupted operations and should not be removed without first identifying the lock owner and determining whether it is safe to recover. Deleting locks or killing package processes during an active transaction can leave the package database inconsistent. The uninstall workflow also recursiv ...[truncated 2288 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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (32)

Chaining Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The documented chain echo root密码 | su -c combines Windows-to-WSL execution, piped credentials, and root command execution in one flow, which is dangerous in an agent-driven environment. If any user-controlled package name, argument, or shell content is incorporated into that chain, it can turn routine deployment into arbitrary privileged command execution; the README also frames this as a way to bypass sudo password friction, which further increases concern.

Content

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

text
wsl.exe                   ← 从 Windows 直接调 WSL(需开安全策略)
  └─ echo root密码 | su -c  ← 切到 root,绕开 sudo 密码问题
       └─ aptitude install  ← 阿里云镜像源,下载飞快
            └─ systemctl enable  ← 配开机自启

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill markets the workflow as 'secure' while its actual procedure relies on plaintext password disclosure and password piping into su. That mismatch can cause operators or agents to trust and adopt a dangerous pattern they might otherwise reject, increasing likelihood of credential exposure and privileged misuse.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

The documented chain echo '<root密码>' | su -c '<命令>' - root combines credential disclosure, shell piping, and privileged command execution in a single injectable pattern. Because the skill is designed to substitute arbitrary commands and service names, any quoting mistake or attacker-controlled input could result in unintended root command execution while also exposing the password.

Content

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

md
### 原则

1. **首选 `wsl.exe -e bash -c`** — 直接从 Windows 侧调用 WSL 命令,无需 SSH
2. **以 root 执行** — 使用 `echo '<root密码>' | su -c '<命令>' - root` 绕过 sudo 密码
3. **脚本先写再跑** — 将多步操作写入 `/tmp/` 脚本,一次性执行,通过 `/tmp/*.log` 查看结果
4. **用 aptitude 不用 apt** — aptitude 依赖处理更可靠

Chaining Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

This concrete execution example runs a generated script as root via a plaintext password piped into su, then backgrounds it, reducing visibility and control. The combination of generated /tmp scripts, shell string composition, and privileged execution materially increases the risk of command injection, script tampering, credential leakage, and unmonitored destructive actions.

Content

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

md
chmod +x /tmp/install_<service>.sh'

# 第二步:以 root 执行脚本(后台运行,避免超时)
wsl.exe -e bash -c "echo '<root密码>' | su -c 'bash /tmp/install_<service>.sh' - root" &

# 第三步:等待后检查日志(sleep 时间视包大小调整:Redis~10s,MySQL~30-60s)
sleep 10

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

The skill recommends forcibly deleting package-manager lock files, which can corrupt package state or interfere with legitimate package operations if another process is active. In an automated root-execution context, this becomes more dangerous because it encourages destructive recovery steps without validation, potentially breaking the system or enabling unsafe command execution sequences.

Content

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

md
- 安装前先 `apt update`(镜像源已配置为阿里云)
- 安装前确认包未安装:`which <binary> || echo NOT_INSTALLED`
- 安装前清理残留锁文件:`rm -f /var/lib/dpkg/lock* /var/lib/apt/lists/lock /var/cache/apt/archives/lock`
- 有残留 dpkg 进程时先 `killall apt; killall dpkg; dpkg --configure -a`(需在 root 下执行)
- 修改配置文件前先备份:`cp <config> <config>.bak`
- 安装完成后必须验证:密码登录、版本号、端口监听

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly discloses a hardcoded root password and couples it with instructions to pipe that password into su for privilege escalation. This creates immediate full-system compromise risk for any user or agent with access to the skill and encourages unsafe credential handling that may leak through logs, shell history, process inspection, or prompt artifacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The document exposes and repeatedly uses a hardcoded root password (123456) for su, sshpass, MySQL, and Redis. Reusing a trivial static credential across privileged accounts and services enables immediate compromise by anyone who can read the document or reach the exposed services.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

Piping a hardcoded password into su chains credential material directly into privileged command execution, enabling unattended root access with almost no safeguards. This pattern is especially dangerous in agentic or automation contexts because any injected or mistaken command inherits full root privileges immediately.

Content

Scanner excerpt · references/wsl-commands.md (reported line 12)May include surrounding context.

方式2:以 root 执行(绕过 sudo 密码)

bash
wsl.exe -e bash -c "echo '123456' | su -c '命令' - root"

方式3:SSH root 连接(备用)

Chaining Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

The script-writing workflow culminates in echo '123456' | su -c 'bash /tmp/install_xxx.sh' - root, which chains a hardcoded secret to execution of a temporary script as root. Because the script is staged in /tmp and then executed with full privileges, tampering, substitution, or command injection in the generated script could lead to complete system compromise.

Content

Scanner excerpt · references/wsl-commands.md (reported line 37)May include surrounding context.

md
chmod +x /tmp/install_xxx.sh'

# 执行脚本
wsl.exe -e bash -c "echo '123456' | su -c 'bash /tmp/install_xxx.sh' - root"

# 查看日志
wsl.exe -e bash -c 'cat /tmp/install_xxx.log'

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

The combined recursive deletion of /var/lib/mysql /etc/mysql /var/log/mysql is destructive enough to qualify as dangerous tool usage in documentation, especially when paired with root execution and no warnings. It can erase service state and forensic logs, making recovery and auditing difficult.

Content

Scanner excerpt · references/wsl-commands.md (reported line 48)May include surrounding context.

bash
# 卸载旧版
DEBIAN_FRONTEND=noninteractive aptitude purge -y mysql-server mysql-client mysql-common mysql-server-core mysql-client-core
rm -rf /var/lib/mysql /etc/mysql /var/log/mysql
aptitude purge -y ~c

# 安装

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

The combined recursive deletion of /var/lib/mysql /etc/mysql /var/log/mysql is destructive enough to qualify as dangerous tool usage in documentation, especially when paired with root execution and no warnings. It can erase service state and forensic logs, making recovery and auditing difficult.

Content

Scanner excerpt · references/wsl-commands.md (reported line 48)May include surrounding context.

bash
# 卸载旧版
DEBIAN_FRONTEND=noninteractive aptitude purge -y mysql-server mysql-client mysql-common mysql-server-core mysql-client-core
rm -rf /var/lib/mysql /etc/mysql /var/log/mysql
aptitude purge -y ~c

# 安装

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

The combined recursive deletion of /var/lib/mysql /etc/mysql /var/log/mysql is destructive enough to qualify as dangerous tool usage in documentation, especially when paired with root execution and no warnings. It can erase service state and forensic logs, making recovery and auditing difficult.

Content

Scanner excerpt · references/wsl-commands.md (reported line 48)May include surrounding context.

bash
# 卸载旧版
DEBIAN_FRONTEND=noninteractive aptitude purge -y mysql-server mysql-client mysql-common mysql-server-core mysql-client-core
rm -rf /var/lib/mysql /etc/mysql /var/log/mysql
aptitude purge -y ~c

# 安装

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README states that Redis installation includes binding to 0.0.0.0 and setting a password, but gives no warning that exposing Redis remotely can significantly expand the attack surface. Redis instances are frequently targeted, and password-only exposure may be insufficient without firewalling, protected-mode review, network scoping, and strong secret handling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README advertises uninstalling MySQL by purging packages and deleting data directories, but does not warn that this can irreversibly destroy databases and service state. In an agent skill context, users may issue natural-language requests casually, so destructive behavior without explicit confirmation or backup guidance materially increases the risk of accidental data loss.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
91% confidence
Finding

The README explicitly describes passing the root password into su -c to execute package management and service configuration as root. In this skill context, using a password-piped root shell normalizes privileged execution with insecure credential handling, increasing the chance of credential exposure in process arguments, logs, transcripts, or agent tooling and magnifying the blast radius of any command injection or workflow error.

Content

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

text
wsl.exe                   ← 从 Windows 直接调 WSL(需开安全策略)
  └─ echo root密码 | su -c  ← 切到 root,绕开 sudo 密码问题
       └─ aptitude install  ← 阿里云镜像源,下载飞快
            └─ systemctl enable  ← 配开机自启

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

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.

Content

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

wsl.exe ← 从 Windows 直接调 WSL(需开安全策略) └─ echo root密码 | su -c ← 切到 root,绕开 sudo 密码问题 └─ aptitude install ← 阿里云镜像源,下载飞快 └─ systemctl enable ← 配开机自启

text

全程本地操作,不依赖 SSH,不需要知道 WSL 的 IP。

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

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.

Content

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

wsl.exe ← 从 Windows 直接调 WSL(需开安全策略) └─ echo root密码 | su -c ← 切到 root,绕开 sudo 密码问题 └─ aptitude install ← 阿里云镜像源,下载飞快 └─ systemctl enable ← 配开机自启

text

全程本地操作,不依赖 SSH,不需要知道 WSL 的 IP。

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

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.

Content

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

wsl.exe ← 从 Windows 直接调 WSL(需开安全策略) └─ echo root密码 | su -c ← 切到 root,绕开 sudo 密码问题 └─ aptitude install ← 阿里云镜像源,下载飞快 └─ systemctl enable ← 配开机自启

text

全程本地操作,不依赖 SSH,不需要知道 WSL 的 IP。

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

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.

Content

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

wsl.exe ← 从 Windows 直接调 WSL(需开安全策略) └─ echo root密码 | su -c ← 切到 root,绕开 sudo 密码问题 └─ aptitude install ← 阿里云镜像源,下载飞快 └─ systemctl enable ← 配开机自启

text

全程本地操作,不依赖 SSH,不需要知道 WSL 的 IP。

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

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.

Content

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

wsl.exe ← 从 Windows 直接调 WSL(需开安全策略) └─ echo root密码 | su -c ← 切到 root,绕开 sudo 密码问题 └─ aptitude install ← 阿里云镜像源,下载飞快 └─ systemctl enable ← 配开机自启

text

全程本地操作,不依赖 SSH,不需要知道 WSL 的 IP。

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

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.

Content

Scanner excerpt · references/wsl-commands.md (reported line 55)May include surrounding context.

wsl.exe ← 从 Windows 直接调 WSL(需开安全策略) └─ echo root密码 | su -c ← 切到 root,绕开 sudo 密码问题 └─ aptitude install ← 阿里云镜像源,下载飞快 └─ systemctl enable ← 配开机自启

text

全程本地操作,不依赖 SSH,不需要知道 WSL 的 IP。

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

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.

Content

Scanner excerpt · references/wsl-commands.md (reported line 77)May include surrounding context.

wsl.exe ← 从 Windows 直接调 WSL(需开安全策略) └─ echo root密码 | su -c ← 切到 root,绕开 sudo 密码问题 └─ aptitude install ← 阿里云镜像源,下载飞快 └─ systemctl enable ← 配开机自启

text

全程本地操作,不依赖 SSH,不需要知道 WSL 的 IP。

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
90% confidence
Finding

The skill normalizes running commands as root and specifically instructs bypassing normal sudo prompting via echo '<root密码>' | su -c .... In context, this is more dangerous than ordinary admin documentation because it encourages insecure automation of privileged execution using exposed credentials and shell pipelines.

Content

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

md
### 原则

1. **首选 `wsl.exe -e bash -c`** — 直接从 Windows 侧调用 WSL 命令,无需 SSH
2. **以 root 执行** — 使用 `echo '<root密码>' | su -c '<命令>' - root` 绕过 sudo 密码
3. **脚本先写再跑** — 将多步操作写入 `/tmp/` 脚本,一次性执行,通过 `/tmp/*.log` 查看结果
4. **用 aptitude 不用 apt** — aptitude 依赖处理更可靠

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The uninstall instructions include service stop, package purge, and recursive data-directory deletion without warning that these actions are irreversible. In an automation context, this can lead to accidental destruction of databases, configs, and application state if invoked on the wrong service or environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The Redis guidance recommends bind 0.0.0.0 to allow external connections but does not explain the exposure risk or require compensating controls. This can unintentionally publish Redis to untrusted networks, where weak or misconfigured authentication may permit data theft, tampering, or abuse of the service.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.