Back to skill

Security audit

wzz-server-monitor

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real server monitoring skill, but it installs recurring cron execution and handles SMTP credentials with security choices users should review first.

Review before installing. Use a virtual environment with pinned dependencies, prefer a trusted package index, require SSL or STARTTLS for SMTP, avoid smtp.security: none with credentials, and inspect the exact crontab entry. Install only if you are comfortable with a user-level cron job running this monitor every five minutes and storing local config, state, logs, and an SMTP secret file.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

T08 · Insecure Dependencies

Warning
Location
assets/install.sh:17
Finding

Automatic installation of unpinned dependencies from a third-party package index

Content
View full analysis

Vulnerability Details

File Location: assets/install.sh:17-24; related installation instructions appear in SKILL.md:59-63 and README.md:60-64
Vulnerability Type: Supply-chain exposure through mutable, unverified dependencies
Risk Level: Medium

Vulnerable Code

bash
MIRROR="${PIP_MIRROR:--i https://pypi.tuna.tsinghua.edu.cn/simple}"

echo "==> 1/5 检查依赖"
if ! "$PY" -c "import psutil, yaml, jinja2" 2>/dev/null; then
  echo "缺少依赖,尝试安装 psutil pyyaml jinja2 ..."
  "$PY" -m pip install "$MIRROR" psutil pyyaml jinja2
else
  echo "依赖已就绪 (psutil / pyyaml / jinja2)"
fi

The documentation provides the same unpinned installation pattern:

bash
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple psutil pyyaml jinja2

Technical Analysis

The installer automatically retrieves psutil, pyyaml, and jinja2 without exact version constraints, package hashes, or a reviewed lock file. The default package source is a third-party mirror rather than the canonical package index.

Package versions are therefore mutable after the Skill has been audited. If a dependency maintainer account, release, or configured mirror is compromised, a later installation can retrieve code that was not included in this audit. Python packages can execute code during installation and are subsequently imported by the monitoring process.

The installer also stores the index option and URL in one shell variable and passes it as one quoted argument:

bash
"$PY" -m pip install "$MIRROR" psutil pyyaml jinja2

This does not reliably represent the two command-line arguments expected by pip and may cause installation failure. It should not be addressed by unquoted expansion, because that would introduce unsafe argument splitting; an array or explicit arguments should be used instead.

Attack Path

  1. The user runs bash assets/install.sh.
  2. At least one required Python module is missing.
  3. The i ...[truncated 1177 chars]
Remediation
View remediation

Remediation Suggestions

  1. Create a reviewed dependency lock file containing exact versions and cryptographic hashes.
  2. Install with hash verification, for example:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  3. Default to the canonical Python package index unless the user explicitly selects a trusted organizational mirror.
  4. Consider making dependency installation a separate, explicit user action instead of automatically installing packages from the setup script.
  5. Install dependencies into a dedicated virtual environment with only the permissions needed by the monitor.
  6. Pass pip options as distinct arguments using a shell array:
    bash
    PIP_ARGS=(--index-url "https://pypi.org/simple")
    "$PY" -m pip install "${PIP_ARGS[@]}" --require-hashes -r requirements.txt
    
  7. Regularly review and update pinned dependencies through a controlled process that includes vulnerability scanning and regression testing.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/monitor.py:535
Finding

Authenticated SMTP can be configured without transport encryption

Content
View full analysis

Vulnerability Details

File Location: scripts/monitor.py:162-164,535-544; insecure mode is exposed in assets/config.example.yaml:33-35
Vulnerability Type: Plaintext transmission of SMTP credentials and monitoring telemetry
Risk Level: Medium

Vulnerable Code

Configuration validation explicitly accepts plaintext SMTP:

python
if smtp.get("security") not in ("ssl", "tls", "none"):
    errors.append("smtp.security 必须是 ssl / tls / none")

The SMTP connection logic authenticates even when no encryption is selected:

python
if security == "ssl":
    s = smtplib.SMTP_SSL(host, port, timeout=timeout)
elif security == "tls":
    s = smtplib.SMTP(host, port, timeout=timeout)
    s.ehlo()
    s.starttls()
    s.ehlo()
else:
    s = smtplib.SMTP(host, port, timeout=timeout)
if username:
    s.login(username, password)
s.send_message(msg)

The example configuration advertises the insecure option:

yaml
smtp:
  host: smtp.qq.com
  port: 465
  security: ssl                  # ssl(465) | tls(587, STARTTLS) | none
  username: your@qq.com

Technical Analysis

When smtp.security is set to none, the script establishes an ordinary plaintext SMTP connection. If a username is present, it then calls login() with the configured SMTP password or authorization code.

Depending on the server's advertised authentication mechanisms, the credentials may be transmitted using a reversible encoding or another mechanism that does not provide transport confidentiality. The alert message itself—including hostname, resource utilization, uptime, load average, disk paths, and timestamps—is also transmitted without encryption.

Validation does not reject the combination of plaintext transport and SMTP authentication, and it does not require explicit acknowledgement of the exposure.

Attack Path

  1. A user or deployment configuration selects smtp.security: none.
  2. Th ...[truncated 1178 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove none from the accepted SMTP security modes.
  2. Reject any configuration that combines authentication credentials with an unencrypted SMTP connection.
  3. Prefer implicit TLS through SMTP_SSL or mandatory STARTTLS.
  4. For STARTTLS, abort if TLS negotiation fails; never fall back to plaintext.
  5. Retain normal certificate and hostname verification and do not introduce an option to disable them in production.
  6. Update the example configuration and documentation to state that plaintext SMTP is unsupported.
  7. If unauthenticated plaintext SMTP must be supported for a tightly controlled local relay, restrict it to an explicit loopback or Unix-domain deployment model and ensure no credential is ever transmitted.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (26)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `SKILL.md` | 本文档 |

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'env' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

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

md
python3 scripts/monitor.py setup

# 2. 编辑 ~/.config/resource-monitor/config.yaml,填入 SMTP 与阈值
#    SMTP 密码写入 ~/.config/resource-monitor/.smtp_secret(chmod 600)

# 3. 校验 + 测试 + 安装定时任务
python3 scripts/monitor.py validate-config

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 45)May include surrounding context.

md
python3 scripts/monitor.py setup

# 2. 编辑 ~/.config/resource-monitor/config.yaml,填入 SMTP 与阈值
#    SMTP 密码写入 ~/.config/resource-monitor/.smtp_secret(chmod 600)

# 3. 校验 + 测试 + 安装定时任务
python3 scripts/monitor.py validate-config

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 85)May include surrounding context.

md
python3 scripts/monitor.py setup

# 2. 编辑 ~/.config/resource-monitor/config.yaml,填入 SMTP 与阈值
#    SMTP 密码写入 ~/.config/resource-monitor/.smtp_secret(chmod 600)

# 3. 校验 + 测试 + 安装定时任务
python3 scripts/monitor.py validate-config

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 195)May include surrounding context.

md
python3 scripts/monitor.py setup

# 2. 编辑 ~/.config/resource-monitor/config.yaml,填入 SMTP 与阈值
#    SMTP 密码写入 ~/.config/resource-monitor/.smtp_secret(chmod 600)

# 3. 校验 + 测试 + 安装定时任务
python3 scripts/monitor.py validate-config

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 · assets/config.example.yaml (reported line 38)May include surrounding context.

yaml
python3 scripts/monitor.py setup

# 2. 编辑 ~/.config/resource-monitor/config.yaml,填入 SMTP 与阈值
#    SMTP 密码写入 ~/.config/resource-monitor/.smtp_secret(chmod 600)

# 3. 校验 + 测试 + 安装定时任务
python3 scripts/monitor.py validate-config

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

本 skill 遵循 Agent Skills 开放标准,Claude Code 与 Codex 均识别。将目录软链到目标 Agent 的 skills 路径:

sh
mkdir -p ~/.codex/skills        # 或 .agents/skills
ln -s /path/to/wzz-server-monitor ~/.codex/skills/wzz-server-monitor

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

本 skill 遵循 Agent Skills 开放标准,Claude Code 与 Codex 均识别。将目录软链到目标 Agent 的 skills 路径:

sh
mkdir -p ~/.codex/skills        # 或 .agents/skills
ln -s /path/to/wzz-server-monitor ~/.codex/skills/wzz-server-monitor

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

本 skill 遵循 Agent Skills 开放标准,Claude Code 与 Codex 均识别。将目录软链到目标 Agent 的 skills 路径:

sh
mkdir -p ~/.codex/skills        # 或 .agents/skills
ln -s /path/to/wzz-server-monitor ~/.codex/skills/wzz-server-monitor

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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 80)May include surrounding context.

本 skill 遵循 Agent Skills 开放标准,Claude Code 与 Codex 均识别。将目录软链到目标 Agent 的 skills 路径:

sh
mkdir -p ~/.codex/skills        # 或 .agents/skills
ln -s /path/to/wzz-server-monitor ~/.codex/skills/wzz-server-monitor

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The description says to use the skill whenever the user asks about server resource monitoring, load, or email alerts, and also includes broad Chinese phrasing like '服务器资源、负载、告警、监控通知、设置或查看资源监控'. This lacks clear boundaries or exclusion conditions, so ordinary discussion about server load or alerts could invoke the skill unintentionally.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
94% confidence
Finding

This duplicate finding points to the same core issue: the skill exposes write and cron-manipulation capabilities from a user-invocable interface, while the skill's purpose includes scheduled background execution. In agent environments, that materially increases persistence risk because an invocation about monitoring can transition into modifying crontab and writing long-lived state on disk.

Content

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

md
user-invocable: true
allowed-tools:
  - Read
  - Write
  - Bash(monitor.py *)
  - Bash(crontab *)
---

Session Persistence

Medium
Category
Rogue Agent
Confidence
94% confidence
Finding

This duplicate finding points to the same core issue: the skill exposes write and cron-manipulation capabilities from a user-invocable interface, while the skill's purpose includes scheduled background execution. In agent environments, that materially increases persistence risk because an invocation about monitoring can transition into modifying crontab and writing long-lived state on disk.

Content

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

md
user-invocable: true
allowed-tools:
  - Read
  - Write
  - Bash(monitor.py *)
  - Bash(crontab *)
---

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 147)May include surrounding context.

WSL2 与多数容器默认不启动 cron 服务。手动启动:

sh
sudo service cron start

开机自启(WSL2):编辑 /etc/wsl.conf:

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

在 Codex 等其他 Agent 中使用时,把本 skill 目录软链到它的 skills 发现路径:

sh
mkdir -p ~/.codex/skills   # 或 .agents/skills
ln -s <skill-dir> ~/.codex/skills/wzz-server-monitor

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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 189)May include surrounding context.

在 Codex 等其他 Agent 中使用时,把本 skill 目录软链到它的 skills 发现路径:

sh
mkdir -p ~/.codex/skills   # 或 .agents/skills
ln -s <skill-dir> ~/.codex/skills/wzz-server-monitor

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The security section understates the skill's capabilities by claiming it only reads metrics and sends email, while the document elsewhere explicitly instructs users to install cron jobs and create or modify config, state, secret, and log files. This kind of misleading security note can cause users or agents to grant more trust or permissions than warranted, reducing scrutiny around persistence and filesystem changes.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The installer persists execution by writing a cron entry that runs every 5 minutes, which establishes ongoing code execution in the user's session. Even though this appears to be legitimate monitoring behavior for the stated skill purpose, persistence mechanisms are security-sensitive because a compromised or later-modified monitor script would execute repeatedly without further user approval.

Content

Scanner excerpt · assets/install.sh (reported line 58)May include surrounding context.

sh
echo "==> 5/5 安装 crontab(每 5 分钟检查一次)"
CRON_LINE="*/5 * * * * $PY $MONITOR check --config $CONFIG >> $STATE_DIR/monitor.log 2>&1"
( crontab -l 2>/dev/null | grep -v "$CRON_TAG" ; echo "# $CRON_TAG" ; echo "$CRON_LINE" ) | crontab -
echo "已写入 crontab:"
crontab -l | grep -A1 "$CRON_TAG" || true

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% 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 174)May include surrounding context.

md
CRON_LINE="*/5 * * * * $PY $MONITOR check --config $CONFIG >> $STATE_DIR/monitor.log 2>&1"
( crontab -l 2>/dev/null | grep -v "$CRON_TAG" ; echo "# $CRON_TAG" ; echo "$CRON_LINE" ) | crontab -
echo "已写入 crontab:"
crontab -l | grep -A1 "$CRON_TAG" || true

# WSL2 / 容器中 cron 服务默认不启动
if ! pgrep -x cron >/dev/null 2>&1 && ! pgrep -x crond >/dev/null 2>&1; then

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% 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 · assets/install.sh (reported line 60)May include surrounding context.

sh
CRON_LINE="*/5 * * * * $PY $MONITOR check --config $CONFIG >> $STATE_DIR/monitor.log 2>&1"
( crontab -l 2>/dev/null | grep -v "$CRON_TAG" ; echo "# $CRON_TAG" ; echo "$CRON_LINE" ) | crontab -
echo "已写入 crontab:"
crontab -l | grep -A1 "$CRON_TAG" || true

# WSL2 / 容器中 cron 服务默认不启动
if ! pgrep -x cron >/dev/null 2>&1 && ! pgrep -x crond >/dev/null 2>&1; then

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 · assets/install.sh (reported line 65)May include surrounding context.

sh
# WSL2 / 容器中 cron 服务默认不启动
if ! pgrep -x cron >/dev/null 2>&1 && ! pgrep -x crond >/dev/null 2>&1; then
  echo "⚠️  未检测到 cron 服务进程。若在 WSL2 / Docker 容器中,请先启动:"
  echo "    sudo service cron start"
  echo "  如需开机自启,参见 SKILL.md 中「WSL2 cron 自启」一节。"
fi

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This HTML template sets lang="zh-CN" and all visible notification text is in Chinese, which forces a specific language/locale for recipients. The policy allows locale constraints only when user choice is offered or the restriction is clearly documented and justified, neither of which is evident in this file.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% 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 · scripts/monitor.py (reported line 646)May include surrounding context.

python
print("  1. 编辑配置文件,填入 SMTP 与阈值")
    print("  2. 运行 validate-config 校验")
    print("  3. 运行 send-test 发送测试邮件")
    print("  4. 用 install.sh 或 crontab -e 安装定时任务")
    return 0

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
73% confidence
Finding

The file is primarily written in Chinese, but the description contains the directive 'Make sure to use whenever...' in English as a mandatory instruction. This may impose language-specific behavior or expectations without stating that the user can choose their preferred language or locale.

Content

No source excerpt is available for this finding.