Back to skill

Security audit

Moyu Make Xhs Pics

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently turns a user-selected Markdown article into Xiaohongshu-style images using declared third-party image APIs, with ordinary privacy and dependency cautions.

Install only if you are comfortable sending article-derived prompts to MiniMax or DashScope. Avoid using confidential, personal, or proprietary Markdown unless you have reviewed the provider terms. Run it in a normal least-privilege environment and consider pinning dependencies before production use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
src/image_generator.py:221
Finding

Unvalidated Remote Image Download with Unsafe Temporary-File Creation

Content
View full analysis
Optional[str]: """下载图片到本地""" try: response = requests.get(url, timeout=60) if response.status_code == 200: filename = f"moyu_{abs(hash(prompt)) % 100000}.png" filepath = f"/tmp/{filename}" with open(filepath, 'wb') as f: f.write(response.content) return filepath except Exception as e: print(f"下载失败: {e}") return None ``` ### Technical Analysis The image URL returned by MiniMax or DashScope is passed directly to `requests.get()` without validating: - The URL scheme - The destination hostname - Redirect destinations - The response `Content-Type` - The downloaded file signature - The maximum response size The use of `response.content` buffers the entire response in memory before writing it to disk. A provider-side compromise, malicious API response, or compromised image CDN could therefore direct the Skill to an unintended destination or return an excessively large response. The resulting file is written to a predictable shared `/tmp` namespace using ordinary `open(..., "wb")`. This operation is not an exclusive file creation and follows symbolic links. If a local attacker can predict or discover the generated path and create a symbolic link there before the write, the process may overwrite another file writable by the Skill's user. The downloaded file is later opened by Pillow during watermark processing, increasing exposure to malformed-image parser vulnerabilities. ### Attack Path 1. The user invokes image generation with MiniMax or DashScope. 2. The external provider returns an image URL controlled by a compromised provider account, ...[truncated 1561 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/image_gen.py:253
Finding

Duplicated Unvalidated Download Logic in Legacy Image Generation Script

Content
View full analysis
Optional[str]: """下载图片到本地""" try: response = requests.get(url, timeout=60) if response.status_code == 200: # 生成文件名 safe_name = "".join(c for c in prompt[:20] if c.isalnum()) filename = f"minimax_{hash(prompt) % 100000}.png" filepath = f"/tmp/{filename}" with open(filepath, 'wb') as f: f.write(response.content) return filepath except Exception as e: print(f"下载失败: {e}") return None ``` Equivalent DashScope download implementation: ```python def _download_image(self, url: str, prompt: str) -> Optional[str]: """下载图片到本地""" try: response = requests.get(url, timeout=60) if response.status_code == 200: safe_name = "".join(c for c in prompt[:20] if c.isalnum()) filename = f"dashscope_{hash(prompt) % 100000}.png" filepath = f"/tmp/{filename}" with open(filepath, 'wb') as f: f.write(response.content) return filepath except Exception as e: print(f"下载失败: {e}") return None ``` ### Technical Analysis Both provider implementations trust the image URL supplied by the remote API and download it without destination allowlisting, redirect validation, response-size limits, content-type validation, or image-signature verification. The complete response is materialized through `response.content`, which can consume substantial memory. It is then written to `/tmp` through a non-exclusive, symlink-following file operation. The filen ...[truncated 1701 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unpinned Third-Party Runtime Dependencies

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • 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
Findings (47)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The documented behavior does not align with the reported implementation: the skill claims article-to-image conversion with multiple styles/layouts, while analysis indicates missing features and undeclared local file write/download behavior. Security-relevant behavior mismatches are dangerous because users may provide sensitive content under false assumptions and may not expect local persistence or external transfer paths.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior does not align with the reported implementation: the skill claims article-to-image conversion with multiple styles/layouts, while analysis indicates missing features and undeclared local file write/download behavior. Security-relevant behavior mismatches are dangerous because users may provide sensitive content under false assumptions and may not expect local persistence or external transfer paths.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/image_gen.py (reported line 72)May include surrounding context.

python
# 插图:具体场景描绘,避免抽象
        prompt = f"具体场景:{content}。{keywords}风格,扁平化插图,清晰的单个场景画面,有明确的主体事物和简单背景,画面干净易懂,无文字,无抽象图形"
    
    return prompt


def add_watermark(image_path: str, position: str = "右下角") -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/image_gen.py (reported line 252)May include surrounding context.

python
# 插图:具体场景描绘,避免抽象
        prompt = f"具体场景:{content}。{keywords}风格,扁平化插图,清晰的单个场景画面,有明确的主体事物和简单背景,画面干净易懂,无文字,无抽象图形"
    
    return prompt


def add_watermark(image_path: str, position: str = "右下角") -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/image_gen.py (reported line 361)May include surrounding context.

python
# 插图:具体场景描绘,避免抽象
        prompt = f"具体场景:{content}。{keywords}风格,扁平化插图,清晰的单个场景画面,有明确的主体事物和简单背景,画面干净易懂,无文字,无抽象图形"
    
    return prompt


def add_watermark(image_path: str, position: str = "右下角") -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · src/image_generator.py (reported line 222)May include surrounding context.

python
# 插图:具体场景描绘,避免抽象
        prompt = f"具体场景:{content}。{keywords}风格,扁平化插图,清晰的单个场景画面,有明确的主体事物和简单背景,画面干净易懂,无文字,无抽象图形"
    
    return prompt


def add_watermark(image_path: str, position: str = "右下角") -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · src/prompt_engine.py (reported line 132)May include surrounding context.

python
# 插图:具体场景描绘,避免抽象
        prompt = f"具体场景:{content}。{keywords}风格,扁平化插图,清晰的单个场景画面,有明确的主体事物和简单背景,画面干净易懂,无文字,无抽象图形"
    
    return prompt


def add_watermark(image_path: str, position: str = "右下角") -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · src/prompt_engine.py (reported line 172)May include surrounding context.

python
# 插图:具体场景描绘,避免抽象
        prompt = f"具体场景:{content}。{keywords}风格,扁平化插图,清晰的单个场景画面,有明确的主体事物和简单背景,画面干净易懂,无文字,无抽象图形"
    
    return prompt


def add_watermark(image_path: str, position: str = "右下角") -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · src/prompt_engine.py (reported line 207)May include surrounding context.

python
# 插图:具体场景描绘,避免抽象
        prompt = f"具体场景:{content}。{keywords}风格,扁平化插图,清晰的单个场景画面,有明确的主体事物和简单背景,画面干净易懂,无文字,无抽象图形"
    
    return prompt


def add_watermark(image_path: str, position: str = "右下角") -> str:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README instructs users to configure third-party provider API keys for MiniMax and DashScope but does not disclose that article contents may be sent to those external services for prompt/image generation. This can lead users to unintentionally transmit sensitive or proprietary Markdown content off-host, creating privacy, confidentiality, and compliance risks.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill declares use of environment variables, file access, and networked API providers, but does not define any explicit tool scope or permissions boundary. This is dangerous because consumers cannot easily assess or constrain what resources the skill may access, increasing the risk of overbroad data exposure or unintended file/network operations during execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes image generation via external providers but does not warn that article contents may be transmitted to third-party APIs. This is dangerous because users may unknowingly send sensitive, proprietary, or personal content off-platform, creating confidentiality and compliance risks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file's user-facing natural-language strings, including the module docstring and CLI description, are entirely in Chinese and do not indicate any option for alternate 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 clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module description, comments, prompts, and user-visible messages are written in Chinese, and the skill does not offer an alternate language or indicate that it is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

generate_prompt 的文档和对应注释明确写明封面图、插图都“不包含文字”,且提示词也要求“无文字”。但生成完成后,代码在 L203-L205 和 L318-L319 调用 add_watermark,并在图片上绘制固定中文文字“AI 生成”,这与文档宣称的最终输出特性直接矛盾。

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This outbound request sends generated prompt content and metadata to a third-party service over the network. In this skill context, external transmission is expected for cloud image generation, but it still crosses a trust boundary and can expose sensitive prompt contents if users are not informed or if secrets/private text are included.

Content

Scanner excerpt · scripts/image_gen.py (reported line 190)May include surrounding context.

python
}
        
        try:
            response = requests.post(self.base_url, json=payload, headers=headers, timeout=60)
            
            if response.status_code == 200:
                data = response.json()

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

User-provided prompt content is sent to an external image-generation API with no disclosure, consent flow, or data minimization visible in this file. If users include sensitive, proprietary, or personal information in prompts, that data is transmitted to a third party and may be logged or retained outside the local trust boundary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This sends user prompt content to DashScope, another external provider, again without any visible disclosure or consent mechanism. In a content-to-image workflow, prompts may contain sensitive article text or unpublished material, so silent third-party transmission creates a real privacy and data-governance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The function iterates over all generated image paths and calls add_watermark(path), which modifies output files in place. Although the docstring says the tool generates images, it does not clearly disclose that generated files will be post-processed with watermarks, and there is no confirmation prompt, logging, or user-facing warning here.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/image_gen.py (reported line 158)May include surrounding context.

python
self.api_key = os.getenv('MINIMAX_API_KEY')
            if not self.api_key:
                raise ValueError("MINIMAX_API_KEY 环境变量未设置")
            self.base_url = "https://api.minimaxi.com/v1/image_generation"
            
        elif self.provider == "dashscope":
            self.api_key = os.getenv('DASHSCOPE_API_KEY')

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · src/image_generator.py (reported line 31)May include surrounding context.

python
self.api_key = os.getenv('MINIMAX_API_KEY')
            if not self.api_key:
                raise ValueError("MINIMAX_API_KEY 环境变量未设置")
            self.base_url = "https://api.minimaxi.com/v1/image_generation"
            
        elif self.provider == "dashscope":
            self.api_key = os.getenv('DASHSCOPE_API_KEY')

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

This function sends the full prompt to an external third-party API, which can expose user-provided content to an outside service. In this skill's context, that behavior is core to image generation, but it still creates a real data-exposure risk if prompts contain secrets, personal data, or proprietary text.

Content

Scanner excerpt · src/image_generator.py (reported line 84)May include surrounding context.

python
}
        
        try:
            response = requests.post(
                self.base_url, 
                json=payload, 
                headers=headers,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code downloads remote content and writes it to /tmp as a PNG file, but there is no confirmation prompt or user-facing disclosure that a local file will be created. The nearby docstring only says 'download image to local' for developers and does not clearly warn end users about filesystem side effects.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstrings and user-facing descriptive text are entirely in Chinese, including the class and method documentation. This reflects a fixed language choice with no visible opt-in, alternative locale support, or justification that the skill is intended only for a Chinese-language environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The prompt templates hard-code output context to 'Xiaohongshu (Little Red Book)' and include Chinese-language style guidance throughout, which effectively constrains the skill to a specific language/locale experience. There is no visible user choice or documented opt-in for alternative languages or locales in these prompt-generating instructions.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.