Back to skill

Security audit

Skill Image Gen

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill mostly does what it says, but its setup guidance and code handle API keys and cloud credentials in unsafe ways that users should review before installing.

Install only if you are comfortable sending prompts to Gitee AI and, when enabled, uploading generated images to your Tencent COS bucket. Do not paste real API keys into an AI chat, do not print full keys in logs, and store any Gitee or Tencent credentials with restrictive file permissions or a secret manager. Use a narrowly scoped Tencent key if COS upload is needed, and avoid exposing the helper URL-download function to untrusted URLs without additional network and size limits.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:204
Finding

Credential files are created without enforced restrictive permissions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/GET_API_KEY.md:163
Finding

Setup documentation encourages disclosure of complete API keys

Content
View full analysis
python -c "from scripts.config import Config; c = Config(interactive=False); print(f'API Key: {c.get(\"gitee.api_key\")}')" ``` ### Technical Analysis The documentation directs users to place a secret directly into an Agent conversation and verify configuration by printing the full secret to terminal output. Agent conversations may be retained in chat history, telemetry, debugging traces, or execution logs. Terminal output can similarly be captured by shell transcripts, CI logs, support recordings, or orchestration systems. The credential-shaped example also normalizes unsafe secret sharing and could be mistaken for a usable token. A secure verification procedure should confirm only that a credential is present or display a small masked suffix. It should never reproduce the entire value. ### Attack Path 1. A user follows the documented setup procedure. 2. The user submits a real API key through an Agent conversation or runs the command that prints the full key. 3. The secret is retained in conversation history, execution logs, terminal capture, or support material. 4. A party with access to those records retrieves the key. 5. The exposed key is used for unauthorized Gitee AI requests until it is revoked. ### Impact Assessment The attacker can exercise the Gitee AI permissions associated with the exposed key, potentially consuming quotas, generating unauthorized content, or causing account-level service abuse. The issue does not grant local system privileges. Its scope is limited t ...[truncated 83 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/utils.py:74
Finding

Image download utility permits unrestricted URL fetching and unbounded response processing

Content
View full analysis
Tuple[str, str]: """ 从 URL 下载图片 Args: url: 图片 URL save_path: 保存目录 timeout: 超时时间 (秒) Returns: (文件名, 完整路径) """ response = requests.get(url, timeout=timeout) response.raise_for_status() # 转换为 base64 再保存 b64_str = base64.b64encode(response.content).decode('utf-8') # 生成文件名 filename = generate_timestamp_filename() full_path = os.path.join(save_path, filename) # 保存 base64_to_image(b64_str, full_path) return filename, full_path ``` ### Technical Analysis `download_image()` accepts an arbitrary URL and passes it directly to `requests.get()`. The implementation does not restrict URL schemes or hosts, reject loopback/private/link-local addresses, or validate redirect destinations. A caller that exposes this function to untrusted URL input could therefore be induced to contact services reachable from the host but inaccessible to an external attacker. The function also accesses `response.content`, buffering the complete response in memory. It then creates another full in-memory Base64 representation before decoding it again. No response-size or image-dimension limit is enforced. This can significantly amplify memory consumption. Finally, untrusted bytes are passed to Pillow. Although Pillow provides decompression-bomb warnings and limits in supported versions, the function does not enforce an application-specific pixel limit or convert such warnings into a controlled rejection. The current command-line entry point does not call this utility, which limits immediate exposure. The risk becomes exploitable when the function is imported by an Agent, web service, or other component with attacker-controlled ...[truncated 1109 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:4
Finding

Third-party dependencies are not reproducibly pinned

Content
View full analysis
=2.28.0 Pillow>=9.0.0 # 腾讯云 COS (可选,如需上传到 COS) cos-python-sdk-v5>=1.9.0 ``` ### Technical Analysis All runtime dependencies use lower-bound-only constraints. A new installation can therefore resolve to any future version accepted by the package index. The project provides neither a lock file nor package hashes to verify downloaded artifacts. No malicious or typosquatted package was identified in the reviewed dependency list. The risk arises from the lack of reproducibility and integrity controls: a compromised upstream account, package-index incident, or incompatible future release could alter installation or runtime behavior after this Skill has been reviewed. ### Attack Path 1. A user follows the documented instruction to run `pip install -r requirements.txt`. 2. The package resolver selects versions available at installation time rather than a reviewed dependency set. 3. A compromised, malicious, or unexpectedly incompatible release is downloaded from the configured index. 4. Package installation hooks or imported runtime code execute in the user's environment. 5. The resulting access is limited only by the privileges of the Python installation process and Skill runtime. ### Impact Assessment A malicious dependency can execute code with the privileges of the user installing or running the Skill. Depending on those privileges, it could read local files, access environment variables and stored credentials, modify user-owned data, or communicate over the network. This audit did not identify a currently malicious dependency; therefore, this is a supply-chain hardening issue rather than evidence of an embedded malicious package. ]]>
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (33)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A description-behavior mismatch is a serious trust and review problem: the skill claims image generation and COS upload, while analysis indicates undeclared arbitrary network download behavior and missing declared core functionality. If true, this could let the skill fetch remote content or process files in ways users and reviewers did not authorize, creating opportunities for data exfiltration, malicious content retrieval, or misleading execution paths.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Telling users to provide the API key directly in chat to the AI agent exposes a sensitive credential through a natural-language interface that may be retained, inspected, or forwarded outside the user's local environment. In the context of an image-generation skill, this capability is unnecessary because the key can be configured locally without involving the model.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation creates a direct social-engineering path for users to disclose bearer credentials to an AI system. Because AI platforms commonly store prompts, responses, and diagnostics, this can lead to persistent secret exposure and downstream abuse of the Gitee AI account.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The README explicitly instructs users or agents to collect a Gitee API key, persist it to local configuration, and optionally upload generated images to Tencent COS, but it does not warn that these actions involve sensitive credentials and transmission of user data to third-party services. In an agent context, this omission increases the risk that secrets are solicited or stored insecurely and that users are not meaningfully informed before content is sent to external providers.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documentation describes capabilities that use environment variables, local file reads/writes, and network access, but it does not declare any tool scope or permission boundaries. In an agent setting, missing explicit permissions increases the chance that the skill is granted broader access than users expect, enabling unintended secret access, file modification, or outbound requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill advertises cloud upload and local saving but does not clearly warn that prompts, generated images, and related metadata may be transmitted to external providers and stored remotely. Users may unknowingly send sensitive prompts or content to third parties, creating privacy, compliance, and data retention risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The configuration guidance instructs users to place API keys and cloud credentials in files and environment variables without explicit secret-handling safeguards. This increases the risk of credential leakage through checked-in config files, permissive file permissions, logs, screenshots, or agent misuse of environment access.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document warns users not to disclose API keys, then immediately shows a realistic full-length example key and later encourages sharing a key with an AI agent. Even if the example key is not live, this normalizes unsafe handling of secrets and weakens the document's security posture by teaching users that plaintext exposure is acceptable.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/GET_API_KEY.md (reported line 103)May include surrounding context.

bash
# Linux/macOS
mkdir -p ~/.openclaw/skills/free-image-gen

# Windows (PowerShell)
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.openclaw\skills\free-image-gen"

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/GET_API_KEY.md (reported line 103)May include surrounding context.

bash
# Linux/macOS
mkdir -p ~/.openclaw/skills/free-image-gen

# Windows (PowerShell)
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.openclaw\skills\free-image-gen"

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document explicitly instructs users to send their Gitee API key to an AI agent in natural language. That creates an unnecessary credential disclosure path through chat logs, model providers, telemetry, or prompt-history storage, which is especially risky because an API key is a bearer secret that can be reused by whoever obtains it.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/README.md (reported line 57)May include surrounding context.

bash
# 创建配置目录
mkdir -p ~/.openclaw/skills/free-image-gen

# 创建配置文件
cat > ~/.openclaw/skills/free-image-gen/config.json << 'EOF'

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module documentation and all user-facing interactive text are written exclusively in Chinese, and the skill provides no indication that users may choose another language or locale. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code interactively collects API keys and optional COS secrets, then writes them in plaintext JSON to a predictable path under the user's home directory without warning the user about local secret storage, file permissions, or the sensitivity of those credentials. In an agent/tooling context, this increases the chance that other local users, processes, backups, or accidental file disclosure expose long-lived credentials that can be abused for API usage or cloud storage access.

Content

No source excerpt is available for this finding.

Cloud Storage Exfiltration

Medium
Category
Data Exfiltration
Confidence
55% confidence
Finding

Data is uploaded to cloud storage (S3 / GCS / Azure Blob). This may be a legitimate backup or exfiltration to an external bucket. Manual review is recommended.

Content

Scanner excerpt · scripts/cos_uploader.py (reported line 65)May include surrounding context.

python
if key is None:
            key = local_path.split('/')[-1].split('\\')[-1]
        
        response = self.client.upload_file(
            Bucket=self.bucket,
            LocalFilePath=local_path,
            Key=key,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code performs a network upload of a local file to a remote cloud storage service, which can transmit user or system data off the machine. Although the function name and docstring describe uploading, there is no confirmation prompt, user-facing log/print, or explicit warning about this data transfer in the code shown.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes a tool for generating images and supporting local save or Tencent COS upload. This module also exposes a delete capability that removes objects from remote cloud storage, which is not mentioned or obviously required by that stated purpose. Deleting remote content is a materially different capability from generating or uploading images.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The delete method performs a destructive remote operation by deleting an object from COS, but it provides no confirmation prompt or advance user disclosure before doing so. A failure message is printed only after the operation errors, which does not warn the user about the irreversible action beforehand.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

When upload_to_cos is enabled, the skill uploads the generated local file to Tencent COS, transmitting user-derived content to a cloud service. The parameter name suggests upload behavior, but this file does not include a clear warning, confirmation, or user-facing disclosure about external cloud transfer.

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

python
"Authorization": f"Bearer {self.api_key}"
        }
        
        response = requests.post(url, json=payload, headers=headers, timeout=60)
        
        if response.status_code != 200:
            raise Exception(f"API 调用失败 ({response.status_code}): {response.text}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This Python file performs a network request to Gitee AI using the user-provided prompt, which may contain sensitive user data. Although the docstrings describe image generation, there is no confirmation prompt, print/log disclosure, or explicit warning in this file that prompt content will be sent to an external service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

User-facing natural-language strings, including the module description, CLI description, and argument help text, are entirely in Chinese. This imposes a specific language/locale on users without offering any language choice or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

All user-facing instructions are provided only in Chinese, and the document does not indicate that this is an optional locale or a region-specific requirement. Under the stated policy, forcing a single language without user opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire skill documentation is written in Chinese and does not indicate that other languages are supported or that the language choice is optional. Under the stated policy, forcing a specific language without user opt-in is a natural-language locale violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This requirements file includes natural-language comments entirely in Chinese, such as the header and dependency section labels. Because the file provides no indication that language choice is optional or justified for a region-specific skill, it may violate a language/locale policy requiring user opt-in or neutrality.

Content

No source excerpt is available for this finding.