Back to skill

Security audit

beauty-prompt

Security checks for vulnerabilities and agentic risk

Overview

This skill appears aimed at interior-design image generation, but it uses under-disclosed external sharing and an unsafe shell-based image-generation command that deserves review before installation.

Review this skill before installing. It may be useful for Chinese interior-design image generation, but only use it in an environment where web searches, Feishu sharing, local image-generation commands, and optional forwarding to another agent are acceptable. Avoid sensitive floor plans, addresses, proprietary store layouts, or private business details unless the workflow is revised to ask before external transmission and to pass prompts to the image generator without shell interpolation.

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:93
Finding
Shell Command Injection Through a User-Derived Image Prompt## Vulnerability Details **File Location**: `SKILL.md`, lines 93-97 **Vulnerability Type**: Shell command injection **Risk Level**: High ```bash python "{baseDir}/../nano-banana2-apiyi/scripts/generate_image.py" \ --prompt "高质量英文提示词" \ --filename "{workspace}\output\beauty-$(date +%Y-%m-%d-%H-%M-%S).png" \ --aspect-ratio "16:9" \ --size "2K" ``` The non-English string in the source snippet is the original placeholder for the user-derived English prompt. ### Technical Analysis The documented execution flow places an English image prompt derived from user input directly inside a double-quoted shell argument. The skill does not require a structured process API, shell escaping, validation, or rejection of shell metacharacters. Double quotes do not neutralize every shell construct. In common shells, command substitutions such as `$()` and backticks are evaluated inside double quotes. A quotation mark in the generated prompt could also terminate the argument early and expose subsequent metacharacters to the shell. Therefore, an attacker may craft an interior-design request that causes shell syntax to survive prompt transformation and reach the command invocation. The vulnerability is in the documented invocation pattern. The referenced sibling image-generation script is not part of the audited artifact, so its own security properties could not be evaluated. ### Attack Path 1. An attacker submits an image-generation request containing shell syntax disguised as prompt content. 2. The skill converts the request into an English image prompt while preserving the malicious syntax. 3. After the user confirms generation, the prompt is interpolated into the documented `--prompt "..."` shell command. 4. The shell evaluates command substitution or syntax exposed by a terminating quotation mark. 5. The injected operating-system command runs with the privileges and environment of the agent process. For example, a prompt ...[truncated 764 chars]
Remediation
## Remediation Suggestions - Do not construct a shell command by interpolating prompt text. - Invoke the Python interpreter through a structured process API with an argument array and shell processing disabled. Pass the prompt as one literal argument. - If the host framework only exposes a shell interface, use a platform-specific, well-tested argument-escaping routine rather than manual quotation. - Validate prompt input and reject control characters and unexpected shell syntax as defense in depth. Validation must not replace shell-free execution. - Prefer passing large or complex prompts through standard input or a securely created data file, then provide only a controlled file path to the generation script. - Construct output paths through filesystem path APIs. Generate filenames in application code rather than using shell command substitution. - Run image generation in a sandbox with minimal filesystem permissions, no unnecessary credentials, restricted network access, and resource limits. - Add regression tests covering quotation marks, `$()`, backticks, semicolons, pipes, redirections, newlines, and platform-specific metacharacters.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The metadata description defines very broad trigger scenarios such as generating any '[XXX] image' or general visual-content needs, which can cause this skill to activate for ordinary requests outside home-design scope. Overbroad activation increases the chance of unintended tool use, data handling, or workflow execution when the user did not intend to invoke this specific skill.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The invocation logic again relies on vague keyword and intent matching, including broad phrases like '帮我生成[XXX]' and general design-related visual needs. In context, this is risky because the skill is authorized to perform web searches, image generation, file output, and later sharing/forwarding, so accidental activation can lead to unnecessary external actions and exposure.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill instructs sending generated images over Feishu without informing the user that their generated content will be transmitted to an external messaging platform. This creates a privacy and data-governance risk, especially if images contain sensitive layout, home, business, or proprietary design information.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The skill expands from image-generation assistance into cross-agent action by automatically forwarding a message to another agent to generate video from a local file path. That creates an unnecessary privilege boundary crossing: a user who only asked for an image can be induced into triggering additional downstream actions, and the forwarded path/message may expose local workspace details or cause unintended processing in another agent.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill mandates web searches based on user-provided design needs and terms without warning that those details may be sent to external search services. User requests about homes, layouts, materials, or commercial displays may contain sensitive personal or business context, which could be unnecessarily disclosed through online queries.

Description-Behavior Mismatch

Medium
Confidence
89% confidence
Finding
The manifest description in _meta.json limits the skill to producing three text方案 in a fixed line format across 商业/氛围/经济 dimensions. However, the provided skill context describes a substantially broader capability: requirement elicitation, bilingual prompt transformation, and calling an external image-generation API to create visual outputs. That is a semantic mismatch between the declared behavior and the stated skill purpose.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The manifest sets the skill language to "zh-CN", and the description is also written entirely in Chinese, indicating the skill is designed to operate in a fixed language/locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly justified, which is not present here.

Description-Behavior Mismatch

Low
Confidence
81% confidence
Finding
The tags in the manifest emphasize "copywriting", "feishu", "prompt", and "formatting", which fits a text-formatting helper more than a visual design/image generation skill. Given the stated purpose is converting装修/空间设计需求 into high-quality visual images, this metadata understates and mischaracterizes the skill's real operational intent.

Static analysis

No suspicious patterns detected.