Back to skill

Security audit

FMT高清动态图生成器 v6.0

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent educational media-generation purpose, but its fallback instructions ask the agent to run local shell/Python commands with user-derived prompt and topic text, so it needs review before installation.

Install only if you are comfortable with the agent creating media files in /workspace and potentially running local fallback commands. Avoid untrusted page titles or prompts unless the skill is revised to sanitize filenames, avoid shell interpolation, use fixed scripts or structured APIs, and keep all outputs contained in a dedicated directory.

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
SKILL.md:216
Finding
Unsafe User-Controlled Value Interpolation in Shell and Inline Python Commands## Vulnerability Details **File Location**: `SKILL.md`, lines 216-243 **Vulnerability Type**: Command injection and inline Python code injection **Risk Level**: High ### Vulnerable Code ```text **Fallback 1: Static image generation failure** ``` Trigger condition: image_synthesize returns an error or produces an image with extremely poor quality Fallback action: switch to nano-banana-pro uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py \ --prompt "[Original prompt, simplified and without the resolution parameter]" \ --filename "/workspace/fmt_page_[N]_[Topic].png" \ --resolution 4K After recovery: continue the original workflow ``` **Fallback 2: Dynamic video generation failure** ``` Trigger condition: gen_videos returns an error or produces a corrupted output file Fallback action: switch to batch_image_to_video batch_image_to_video({ count: 1, image_file_list: ["/workspace/fmt_page_[N]_[Topic].png"], output_file_list: ["/workspace/fmt_page_[N]_[Topic]_HD.mp4"], prompt_list: ["[Simplified dynamic prompt without resolution instructions]"], duration_list: [6], resolution_list: ["768P"] }) After recovery: notify the user that the video is a 768P fallback version ``` ``` The original source uses Chinese placeholder names and explanatory text; the excerpt above is translated into English to satisfy the report language requirement while preserving the command structure. ### Technical Analysis The skill accepts user-provided page topics and prompt content, then instructs the agent to substitute those values into command-line arguments, quoted file paths, and API-call string literals. It does not define validation, escaping, canonicalization, or a safe argument-array execution mechanism. Double quotes do not make shell interpolation universally safe. If an attacker-controlled topic or prompt contains shell metacharacters or command-substit ...[truncated 2411 chars]
Remediation
## Remediation Suggestions 1. **Do not construct shell commands through textual interpolation.** Invoke programs with an argument-array API such as Python `subprocess.run([...], shell=False, check=True)` so user values are passed as data rather than parsed as shell syntax. 2. **Generate safe internal identifiers.** Do not place raw page topics in filesystem paths. Derive filenames from trusted page numbers, UUIDs, or strictly sanitized slugs. 3. **Apply allowlist validation.** Restrict page numbers to integers and topics used in filenames to an explicitly permitted character set and length. Reject path separators, control characters, quotes, shell metacharacters, and traversal components such as `..`. 4. **Keep display text separate from paths.** Store the original user-facing topic only in structured metadata. Use a generated identifier for files and directories. 5. **Eliminate `python3 -c` with interpolated content.** Place fallback logic in a fixed script and pass values through validated command-line arguments, standard input, or a JSON file. Parse those values as data. 6. **Use structured API parameters.** When calling image or video tools, construct native objects and serialize them with a trusted JSON encoder rather than assembling JavaScript-like snippets manually. 7. **Enforce path containment.** Resolve every output path and verify that it remains beneath the intended `/workspace/fmt_pages` root before creating or modifying files. 8. **Run with least privilege.** Execute media-generation fallbacks in a restricted environment with minimal filesystem access, no unnecessary credentials, and constrained network access. 9. **Add adversarial tests.** Test topics containing quotes, command-substitution characters, path separators, traversal sequences, newlines, and Unicode edge cases. Verify that they are rejected or treated solely as inert data.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (4)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Content
---
AIGC:
    ContentProducer: Minimax Agent AI
    ContentPropagator: Minimax Agent AI
    Label: AIGC
    ProduceID: "00000000000000000000000000000000"
    PropagateID: "00000000000000000000000000000000"
    ReservedCode1: 304502200161d7bac7e93fc3190e54dd47982935dc15aff76df0ffc4bd8b24e43ddc1379022100b1d9744c641dd89c2098ddc577b867b3b3902fea0d3c59cf7a7cb13810482dc7
    ReservedCode2: 3046022100c1c586e5f387eb7854675f21a38adc84b296333092490ab53a791773ee0ec771022100ef73b8676609201e5fd9d22bcb63465601097f6ce19e6f39364a08f151f5f33e42
description: FMT肠菌移植科普高清动态图生成器(插画版+4K静态图+1080P动态视频+批量模式+风格一致)。生成配套数字手绘插画静态PNG(4K超清),并转化为高清晰度1080P动态视频。风格活泼生动,适合科普教育。触发词:生�
Confidence
80% confidence
Finding
The manifest contains unusual opaque `ReservedCode` fields and metadata patterns that triggered a tool/metadata poisoning rule. While these values may be inert provenance artifacts, unexplained opaque metadata in a skill manifest increases supply-chain risk because downstream tooling may parse, trust, or special-case such fields, enabling hidden control signals or parser confusion if consumers are permissive.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The manifest description specifies Chinese trigger phrases and a Chinese-focused generator, and the rest of the skill repeatedly mandates Chinese text generation as part of normal operation. Because the skill enforces a specific language/locale behavior without stating that users may choose another language, it conflicts with the language-choice policy.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The quality checklist requires Chinese text correctness and readability as a mandatory validation step, indicating the skill is designed to always produce Chinese-language content. This is a natural-language policy issue because the file does not provide any opt-in, fallback, or alternative locale behavior.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The skill embeds a fallback that executes local Python via `python3 -c` and writes files in `/workspace`, which expands the skill from media generation into arbitrary code execution. Even though the bundled snippet is for PIL text overlay, allowing inline Python in a skill creates a powerful execution primitive that can be repurposed for file access, environment inspection, or follow-on payloads if the skill content or interpolated values are modified.

Static analysis

No suspicious patterns detected.