Back to skill

Security audit

Review Diagnostics

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a disclosed Chinese manuscript-review helper, but its checklist script can write outside the intended review folder if given an unsafe article name.

Install only if you are comfortable with a Chinese-language manuscript review workflow that reads and writes local review files. When using the initializer, pass only a simple article slug such as letters, numbers, underscores, or hyphens, and avoid values containing slashes, dots, or absolute paths until the script enforces containment under docs/reviews.

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

Warning
Location
scripts/init_checklist.py:129
Finding

Unrestricted Path Traversal Allows Arbitrary checklist.json Overwrite

Content
View full analysis

Vulnerability Details

File Location: scripts/init_checklist.py, lines 129–140
Vulnerability Type: Path traversal and unrestricted file overwrite
Risk Level: Medium

Vulnerable Code

python
article = sys.argv[1]
version = sys.argv[2] if len(sys.argv) > 2 else "v1"
reviewer = sys.argv[3] if len(sys.argv) > 3 else "笔探"

review_dir = os.path.join("docs", "reviews", article)
os.makedirs(review_dir, exist_ok=True)

checklist = make_checklist(article, version, reviewer)
output_path = os.path.join(review_dir, "checklist.json")

with open(output_path, "w", encoding="utf-8") as f:
    json.dump(checklist, f, ensure_ascii=False, indent=2)

Technical Analysis

The command-line article argument is incorporated directly into a filesystem path without validation or containment enforcement. Python's os.path.join() does not prevent traversal:

  • An argument containing ../ can escape the intended docs/reviews directory.
  • An absolute argument causes preceding path components to be discarded.
  • os.makedirs() creates the attacker-selected directory tree.
  • Opening the resulting checklist.json with mode "w" creates the file or truncates an existing file.

The output filename is fixed as checklist.json, so this is not a fully arbitrary-filename write. It nevertheless permits creation or replacement of any writable file with that name at a caller-selected directory. Existing symlinks may further affect where the write resolves because the script performs no symlink checks.

Attack Path

Prerequisite: The attacker can invoke the script directly or control the article-name argument passed by another workflow. The process must have write permission at the target location.

Example traversal:

bash
cd /path/to/project
python3 scripts/init_checklist.py ../../attacker-controlled

The path is constructed as:

text
docs/reviews/../../attacker-controlled/checklist.json

This resolves outside the intended docs/reviews tree. ...[truncated 1095 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict article names to a safe slug format:
python
import re

if not re.fullmatch(r"[A-Za-z0-9_-]+", article):
    raise ValueError(
        "Article name may contain only letters, digits, underscores, and hyphens"
    )
  1. Resolve and enforce destination containment as a defense-in-depth measure:
python
from pathlib import Path

root = (Path.cwd() / "docs" / "reviews").resolve()
review_dir = (root / article).resolve()

if review_dir.parent != root:
    raise ValueError("Article path escapes the review directory")

review_dir.mkdir(parents=True, exist_ok=True)
output_path = review_dir / "checklist.json"
  1. Refuse silent replacement unless overwrite behavior is explicitly requested:
python
with output_path.open("x", encoding="utf-8") as f:
    json.dump(checklist, f, ensure_ascii=False, indent=2)
  1. If replacement is required, use a dedicated --force option and perform an atomic write through a securely created temporary file in the validated destination directory.

  2. Reject symlinked destination directories and output files where the deployment threat model includes untrusted local users. Revalidate containment immediately before the final write to reduce time-of-check/time-of-use risk.

  3. Add tests covering ../, absolute paths, nested separators, symlink destinations, existing output files, and valid slug names.

Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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 (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill instructs the agent to run local Python scripts and update review artifacts, which implies file read/write capability, but it does not declare any tool scope or permissions boundary. That mismatch can cause an agent or operator to grant broader filesystem access than intended, increasing the chance of unintended file access or modification if the skill is invoked in the wrong workspace.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description and core instructions are written entirely in Chinese and present the skill as a Chinese-language review workflow, with no indication that users may choose another language or locale. This is a natural-language policy concern because it effectively imposes a specific language without explicit opt-in or a documented region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill file is written exclusively in Chinese and provides no indication that users may choose another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown skill file presents all instructions exclusively in Chinese and does not indicate that the user can opt into another language or that the skill is intentionally limited to a Chinese-language audience. Under the language/locale policy, forcing a specific language without user choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file is entirely written in Chinese and presents its review instructions only in that language, with no indication that language selection is optional or that the skill is intended solely for a Chinese-language context. Under the policy rule for natural-language violations, this can constitute a locale/language constraint imposed without explicit user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file is entirely written as Chinese-specific guidance and includes explicit language-specific rules such as '中文段落节奏', '中文信息密度检查', and the '的' character density heuristic. For a general-purpose skill reference, this constitutes a locale/language constraint without any opt-in or justification, which matches the policy category for natural-language locale violations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains natural-language instructions, usage text, and status output entirely in Chinese. Because the skill does not offer user opt-in for language selection and does not state that it is intentionally limited to a Chinese-speaking context, it violates the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

技能清单将该技能描述为用于事实核查、读者模拟、结构分析、传播力评估和反AI味检测等审稿技法,强调的是分析与诊断用途,而该脚本的核心行为是初始化审稿工作流文件并写入 docs/reviews/

/checklist.json。生成和持久化项目文件不是描述中直接声明的能力,因此存在用途描述与实际代码行为的不一致。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring, usage guidance, and all user-facing status messages are written exclusively in Chinese, which imposes a specific language on users without offering an opt-in or alternative locale. Under the policy, language constraints should either provide user choice or be clearly documented as justified for a region-specific tool.

Content

No source excerpt is available for this finding.