Back to skill

Security audit

餐饮创业选址与开店评估专家系统

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent local restaurant site-evaluation skill, with some usability and hardening issues but no evidence of hidden, deceptive, persistent, networked, or exfiltrating behavior.

Before installing, treat this as a Chinese-language advisory tool, verify the business logic manually, and avoid the documented fixed /tmp/eval_input.json workflow; use a private mktemp directory, stdin, or another user-controlled path with restrictive permissions instead.

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
SKILL.md:40
Finding
Predictable Shared Temporary File Allows Symlink-Based File Clobbering## Vulnerability Details **File Location**: `SKILL.md:40-60` **Vulnerability Type**: Unsafe temporary-file handling **Risk Level**: Medium ### Vulnerable Code ```bash # Save user input as a JSON file cat > /tmp/eval_input.json << 'EOF' { "location": { "property_clear": true, "license": true, "ventilation": true, "utilities": true, "fire_safety": true, "landlord": true, "demolition_risk": false, "daily_flow": 2500, "customer_match": "match", "rent_15_percent": true, "contract_3y": true, ... } } EOF # Run the evaluation python3 scripts/evaluate.py /tmp/eval_input.json ``` ### Technical Analysis The documented workflow stores user input at the fixed path `/tmp/eval_input.json`. Because `/tmp` is normally shared and writable by multiple local users, an attacker may create this pathname before the workflow runs. Shell output redirection opens the destination before executing `cat` and ordinarily follows symbolic links. If `/tmp/eval_input.json` is an attacker-created symbolic link, following the documented command can truncate and overwrite its target with the JSON content. The issue is a time-of-check/time-of-use and insecure temporary-file design flaw: the filename is predictable, it is not created atomically, ownership is not verified, and no private temporary directory is used. Even where operating-system symlink protections prevent the strongest exploit, simultaneous executions can overwrite one another's input, produce incorrect assessments, or expose input to other local users depending on the process umask and resulting permissions. ### Attack Path 1. The attacker has local access sufficient to create files or symbolic links in `/tmp`. 2. The attacker predicts the documented filename `/tmp/eval_input.json`. 3. Before the victim runs the workflow, the attacker creates a symbolic link: ```bash ln -s /path/to/victim-writable-target /tmp/eval_input.json ``` 4. The victim follows the Skill in ...[truncated 1362 chars]
Remediation
## Remediation Suggestions Use an atomically created, private temporary file or directory rather than a fixed pathname. Apply restrictive permissions and guarantee cleanup. A hardened shell workflow could use: ```bash tmpdir="$(mktemp -d)" || exit 1 chmod 700 "$tmpdir" trap 'rm -rf -- "$tmpdir"' EXIT input_file="$tmpdir/eval_input.json" umask 077 cat > "$input_file" << 'EOF' { "location": { "property_clear": true, "license": true } } EOF python3 scripts/evaluate.py "$input_file" ``` Additional hardening measures: 1. Prefer accepting JSON through standard input so no intermediate file is required: ```bash python3 scripts/evaluate.py - ``` Update the Python script to read from `sys.stdin` when the argument is `-`. 2. If a file must be used, create it atomically with `mktemp`; never construct a predictable `/tmp` filename manually. 3. Set `umask 077` before writing potentially sensitive business or financial input. 4. Quote every generated pathname and remove it through a cleanup trap. 5. Do not run the workflow with elevated privileges. 6. If the script itself later creates temporary files, use Python's `tempfile.NamedTemporaryFile` or `tempfile.TemporaryDirectory` APIs.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The code generally aligns with part of the description: it does evaluate restaurant site-selection quality, compute a score, and assign A/B/C/D ratings; it also provides a basic can-open/cannot-open suggestion. However, several prominently declared capabilities are absent. There is no function that calculates payback period from investment amount and estimated revenue. The startup assessment does not meaningfully score funding, product, operational capability, etc.; despite initializing category fields, it only uses three boolean inputs to make a decision. The advertised avoidance guide for five fatal business models and the recommendation engine for four winning store models are not present at all. There are no suspicious undeclared behaviors such as network access or data exfiltration; the mismatch is due to overclaiming features not implemented in the supplied code.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
The manifest description is entirely in Chinese and presents the skill as a Chinese-language experience, but it does not state that language is optional or limited to a specific justified region/compliance context. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The activation phrases include broad terms like “开店评估”, “回本计算”, and especially “餐饮创业”, which can plausibly appear in normal discussion rather than a deliberate skill invocation. The description does not provide exclusion conditions or narrower invocation context, so unintended activation risk is higher.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This is a code file, so natural-language strings in docstrings and user-facing output are in scope for policy review. The file presents its title, usage, and recommendations only in Chinese, which effectively forces a specific language on users without any opt-in or explanation that the tool is region-specific.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
The file's user-facing content is presented only in Chinese, and there is no indication that the skill offers language selection or that it is intentionally limited to a Chinese-speaking audience. Under the policy criteria, forcing a specific language without user opt-in can be a natural-language policy violation.

Static analysis

No suspicious patterns detected.