Back to skill

Security audit

zlm

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly does what it says, but its helper script has a real shell-command injection risk through the workspace path, so it should be reviewed before installation.

Install only if you are comfortable with the skill cloning/updating ZLMediaKit, querying GitHub, and writing a local report. Before running the helper script, fix the shell=True command construction or run it in a tightly controlled workspace with a trusted WORKSPACE_DIR. Use a least-privilege GitHub token only when needed, and avoid configuring scheduled runs until the command-injection issue is corrected.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/sync_and_analyze.py:11
Finding

OS Command Injection via Environment-Controlled Workspace Path

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (15)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

Using a generic helper that invokes subprocess.run with shell=True is a genuine tool-parameter abuse pattern because it allows shell interpretation of dynamically built command strings. In this skill, environment-derived paths flow into commands such as git clone and can make the repository sync step dangerous if the runtime environment is attacker-influenced, leading to arbitrary command execution on the host.

Content

Scanner excerpt · scripts/sync_and_analyze.py (reported line 15)May include surrounding context.

python
def run_cmd(cmd, cwd=None):
    print(f"Running: {cmd}")
    result = subprocess.run(cmd, shell=True, cwd=cwd, capture_output=True, text=True)
    if result.returncode != 0:
        print(f"Error executing {cmd}:\n{result.stderr}")
    return result.stdout.strip()

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · .trae/skills/zlmediakit-analyzer/SKILL.md (reported line 45)May include surrounding context.

powershell
  gh pr list -R ZLMediaKit/ZLMediaKit --limit 5 --state all

(注:如果没有 gh CLI,可以使用 curl -s https://api.github.com/repos/ZLMediaKit/ZLMediaKit/issues?per_page=5 替代)

3. 源码深度分析 (Code Analysis)

Skill Enumeration

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

md
- `SKILL.md`: OpenClaw 识别该 Skill 的元数据和工作流定义。
- `scripts/sync_and_analyze.py`: 一个 Python 辅助脚本,可直接运行来拉取代码并生成包含 Issue/PR 的报告 `zlmediakit_report.md`。
- `.trae/skills/zlmediakit-analyzer/SKILL.md`: 兼容 Trae IDE 格式的 Skill 描述文件。

## 如何使用

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README instructs users to set a GitHub personal access token in a persistent user environment variable without any guidance on secret sensitivity, least privilege, rotation, or avoiding accidental disclosure. In an agent/automation context, this increases the chance that credentials are over-scoped, stored longer than necessary, or exposed through logs, screenshots, shell history, or downstream tooling.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares powerful capabilities via metadata and workflow steps that involve shell execution, network access, and local repository writes, but it does not define a restrictive tool scope such as explicit permissions or allowed-tools. This increases the blast radius of prompt injection or accidental misuse because the agent may invoke broader tools than necessary when handling repository analysis tasks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger description is broad enough to match common user requests about ZLMediaKit updates, issues, PRs, or source analysis, which can cause the skill to activate unexpectedly. Unexpected activation is risky here because the workflow includes shell commands, repository synchronization, and outbound network access rather than purely local, read-only analysis.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs the agent to run git clone/git pull and GitHub queries, which perform local file writes and outbound network access, but it does not clearly disclose those side effects to the user at execution time. This undermines informed consent and can surprise users with filesystem modifications or external requests triggered by what appears to be an analysis task.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
import argparse

REPO_URL = "https://github.com/ZLMediaKit/ZLMediaKit.git"
API_BASE = "https://api.github.com/repos/ZLMediaKit/ZLMediaKit"
WORKSPACE_DIR = os.environ.get("WORKSPACE_DIR", r"D:\.openclaw\workspace")
TARGET_DIR = os.path.join(WORKSPACE_DIR, "ZLMediaKit")

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/sync_and_analyze.py (reported line 9)May include surrounding context.

python
import argparse

REPO_URL = "https://github.com/ZLMediaKit/ZLMediaKit.git"
API_BASE = "https://api.github.com/repos/ZLMediaKit/ZLMediaKit"
WORKSPACE_DIR = os.environ.get("WORKSPACE_DIR", r"D:\.openclaw\workspace")
TARGET_DIR = os.path.join(WORKSPACE_DIR, "ZLMediaKit")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
95% confidence
Finding

The script executes shell commands via subprocess.run(..., shell=True), which makes command parsing dependent on the shell and turns any attacker-influenced command string into a command-injection risk. In this skill, the command strings incorporate filesystem paths derived from WORKSPACE_DIR, so a maliciously crafted environment value could inject arbitrary shell metacharacters and execute unintended commands during git clone/pull or git log.

Content

Scanner excerpt · scripts/sync_and_analyze.py (reported line 15)May include surrounding context.

python
def run_cmd(cmd, cwd=None):
    print(f"Running: {cmd}")
    result = subprocess.run(cmd, shell=True, cwd=cwd, capture_output=True, text=True)
    if result.returncode != 0:
        print(f"Error executing {cmd}:\n{result.stderr}")
    return result.stdout.strip()

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code accesses the sensitive GITHUB_TOKEN environment variable and sends it to GitHub via the Authorization header. Although the network fetch is part of the script's purpose, there is no explicit warning in code comments, docstrings, or user-facing output that credentials may be used and transmitted.

Content

No source excerpt is available for this finding.

Tainted flow: 'report_path' from os.environ.get (line 81, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/sync_and_analyze.py (reported line 82)May include surrounding context.

python
report_content = "\n".join(report_lines)
    
    report_path = os.path.join(WORKSPACE_DIR, "zlmediakit_report.md")
    with open(report_path, "w", encoding="utf-8") as f:
        f.write(report_content)
        
    print(f"\nReport generated at: {report_path}")

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file states that the skill will automatically clone or update a repository into a fixed local workspace and generate a report file, which are user-data-affecting filesystem writes. While the behavior is described functionally, there is no clear warning or caution that running the skill will modify local files/directories.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

L03 的整体描述仅以中文给出,且全文未说明是否支持按用户偏好切换语言或地区设置。根据语言/区域政策,若技能输出或交互被隐含地固定为单一语言,应提供用户选择或明确的适用范围。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated report includes Chinese-only headings and warning text, which imposes a specific language on output regardless of user preference. There is no opt-in, configuration, or justification indicating that the skill is intended to be Chinese-only or region-specific.

Content

No source excerpt is available for this finding.