Back to skill

Security audit

ai-photo-pro

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill mostly does what it says, but it should be reviewed because it stores API keys in plaintext and downloads provider-returned image URLs without validation.

Review before installing. Use provider keys with limited quota, avoid committing or sharing scripts/config.json, consider environment variables or a secure secret store instead, and be aware that prompts are sent to NVIDIA or SiliconFlow and generated files remain on disk. The SiliconFlow downloader should ideally validate HTTPS image hosts, set timeouts and size limits, and verify downloaded content before saving.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config_json.py:17
Finding

API Credentials Stored in a Plaintext Configuration File

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/siliconflow_main.py:69
Finding

Unvalidated Image URL Retrieved from an External API Response

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose centers on AI image generation through specific external APIs, but the actual code only performs local setup by requesting and storing API keys. This is a materially different primary purpose from the declared image-generation functionality. While configuration may support such a tool, this code chunk itself does not implement the described behavior at all.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The core purpose mostly aligns: the code does generate an image from a text prompt using the NVIDIA API and returns a local image path. However, the description materially overstates supported backends and models. This chunk implements only NVIDIA access, not SiliconFlow, and the main entrypoint uses only flux.2-klein-4b rather than demonstrating the broader model support claimed. The phrase-based invocation trigger is also absent here, though that may belong to a higher-level dispatcher. There is no evidence of unrelated or dangerous hidden behavior beyond saving debug output locally. Overall this is a partial mismatch due to overstated supported APIs/models versus actual implemented behavior in the supplied code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

代码的核心功能与声明的大方向一致,都是根据提示词调用图像生成服务并返回本地图片路径。但声明描述了同时支持 NVIDIA NIM API 和 SiliconFlow API,而该代码块只实现了 SiliconFlow 的 /v1/images/generations 调用,没有任何 NVIDIA NIM 相关逻辑。此外,声明列出 flux.2-klein-4b 等模型支持,但代码中只明确提到和默认支持 Kwai-Kolors/Kolors 与 Qwen/Qwen-Image,没有看到对 flux.2-klein-4b 的专门支持说明。未发现与图像生成无关的额外高风险能力;不匹配主要在于声明的支持范围大于实际实现。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
78% confidence
Finding

The skill documentation describes network access, local file writes, and configuration file handling, but the manifest shown in SKILL.md does not declare any explicit tool scope or permissions boundary. In an agent environment, missing scope declarations can cause overbroad execution or make reviewers unaware that the skill will access the filesystem and external APIs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger language includes broad catch-all phrasing like similar expressions, which can cause the skill to activate on vague user requests and send prompts to external image APIs unexpectedly. In an agent setting, overbroad invocation increases the chance of unintended network use, cost incurrence, and local file creation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The parameter descriptions specify base_str as a Chinese prompt for both backends, which imposes a language requirement in the skill documentation. This is a natural-language policy concern because it forces a specific language without user opt-in or a documented, justified locale limitation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The README states that generated images are written to a local path but does not warn users that invoking the skill creates persistent files on disk. In shared or sensitive environments, silent file creation can leak prompts, consume storage, or leave artifacts that users did not expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation instructs users to store API keys in a local config.json file without any warning about credential exposure, file permissions, or safer alternatives. Plain local secret storage is risky because keys may be read by other processes, accidentally committed, or exfiltrated through unrelated file access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script collects API keys and stores them directly in a local config.json file in plaintext, without warning the user about sensitivity or applying any access controls. If the file is read by other local users, accidentally committed to source control, or exposed through backups/logging, the credentials can be reused to access paid external image-generation APIs.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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/nvid_main.py (reported line 44)May include surrounding context.

python
"steps": 4
    }
    try:
        response = requests.post(invoke_url, headers=headers, json=payload)
        response.raise_for_status()
    except requests.exceptions.HTTPError as e:
        print(f"进行尝试重启中...HTTP错误: {e}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code sends the user-provided prompt to an external NVIDIA API using an Authorization bearer token, which is a network operation involving user data and credentials. While the script prints status messages after failures and file saves, it does not provide any prior user-facing warning, confirmation, or explanatory comment/docstring about transmitting prompts to a third-party service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s user-facing errors, docstrings, status messages, and command-line usage are written only in Chinese, such as the configuration errors and usage/help text. This imposes a specific language on users and calling agents without any opt-in or documented locale constraint, which matches the language/locale policy violation criteria.

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/siliconflow_main.py (reported line 24)May include surrounding context.

python
raise ValueError("配置文件 config.json 至少应该存在SiliconFlow API Key配置,请运行 config_json.py 创建配置文件")

def post_gui(payload,key):
    url = "https://api.siliconflow.cn/v1/images/generations"
    try:
        headers = {
            "Authorization": key,

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The natural-language comments, prompts, and status messages are all fixed to Chinese, which imposes a specific language on users without opt-in. Under the policy, locale or language constraints should be optional or clearly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script reads an API key from config.json and uses it for authenticated external requests. Although this is functionally necessary, there is no visible warning or explanatory comment/docstring informing users that the skill accesses stored credentials.

Content

No source excerpt is available for this finding.