Back to skill

Security audit

Vocational Report Generator

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its report-writing purpose, but it tells the agent to run a locally found conversion script that is not included or verified.

Review this skill before installing. Its research and report-writing workflow is clear, but the HTML conversion step should be changed to use a bundled, fixed, verified converter or a non-executable conversion path, and it should fail closed if that converter is missing.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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)

T07 · Tool Hijacking and Spoofing

Error
Location
SKILL.md:333
Finding

Untrusted Local Script Discovery and Execution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 333–338
Vulnerability Type: Untrusted tool discovery and execution
Risk Level: High

Vulnerable Code Snippet:

markdown
**必须操作**:执行工作区根目录的脚本:
```bash
python scripts/md_to_html.py --input "报告.md" --output "报告.html" --title "标题"

如脚本在预期路径找不到,先用 glob 搜索 md_to_html.py 定位后另存为临时文件运行。脚本是稳定的转换工具,不需修改。确保输出 HTML 在浏览器中离线可打开。

text

### Technical Analysis

The Skill mandates execution of `scripts/md_to_html.py`. If that expected file is absent, it directs the Agent to search for any file named `md_to_html.py`, copy it to a temporary location, and execute it.

The audited project contains only `SKILL.md`; the expected converter is not bundled and therefore cannot be verified as trusted. Filename-based discovery across a workspace does not establish file provenance or integrity. An attacker who can place a same-named script in a searchable directory can cause that script to be selected as the purported converter.

Copying the discovered script to a temporary file does not make it trustworthy. Executing it with Python gives the script the same operating-system permissions, environment access, filesystem access, and potentially network access available to the Agent process.

### Attack Path

1. The expected project-relative `scripts/md_to_html.py` is absent, as it is in the audited artifact.
2. An attacker places a malicious file named `md_to_html.py` elsewhere in the searchable workspace.
3. The Agent follows the Skill instructions and uses a glob search to locate a same-named file.
4. The Agent copies the attacker-controlled script to a temporary file without validating its origin or cryptographic digest.
5. The Agent invokes the copied file with Python.
6. The malicious script executes with the Agent process's permissions and can perform arbitrary actions available in that environment.

### Impact Assessment

Successful exploitation enables arbit
...[truncated 732 chars]
Remediation
View remediation

Remediation Suggestions

  1. Bundle the reviewed md_to_html.py converter inside the Skill package at a fixed, project-relative path.
  2. Resolve the converter path relative to the trusted Skill directory rather than the current working directory.
  3. Remove the instruction to discover and execute same-named scripts from arbitrary workspace locations.
  4. Fail safely and report the missing dependency when the bundled converter is unavailable.
  5. Verify the converter against a pinned cryptographic digest before execution.
  6. Reject symbolic links and ensure the resolved path remains inside the trusted Skill directory.
  7. Run conversion in a restricted environment with minimal filesystem permissions, no unnecessary credentials, and disabled network access.
  8. Prefer an audited in-process Markdown conversion library or a non-executable fallback over dynamically locating Python scripts.
  9. If a temporary file is unavoidable, create it securely with restrictive permissions; however, secure temporary-file handling must not replace provenance and integrity validation.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest description lists example triggers such as "帮我调研一下XX专业", "XX专业就业怎么样", and "写份XX的调研报告" as口语化请求. While the file later excludes some non-vocational cases, these examples are still broad natural-language requests that may overlap with ordinary conversation and there is no explicit bounded trigger list or negative examples for borderline cases within vocational contexts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs creating output files and running shell/Python commands without clearly warning the user that the workspace will be modified and code will be executed. In agent environments, silent file writes and command execution can violate user expectations, overwrite existing files, or combine with other weaknesses to escalate risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill explicitly instructs execution of a local Python script as part of normal operation, which expands a content-generation skill into code execution on the host workspace. Even if the script is intended for formatting, executing local code can trigger unintended side effects, depend on compromised local files, or be abused if the script has been altered.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The fallback behavior tells the agent to search the workspace for any file named similarly to the expected converter and then execute it. This creates a path-hijacking opportunity: an attacker who can place a malicious md_to_html.py somewhere in the workspace could cause arbitrary code execution under the agent's privileges.

Content

No source excerpt is available for this finding.