Back to skill

Security audit

AI 火宝

Security checks for vulnerabilities and agentic risk

Overview

This is a user-run image generation skill, but it sends prompts, image URLs, and an API key to an undisclosed chatfire.site endpoint despite Volcengine branding.

Review this skill carefully before installing. Use only a narrowly scoped, disposable API key, prefer the HUOBAO_API_KEY environment variable over --api-key, avoid sensitive prompts or private/signed image URLs, and do not enable debug mode in shared terminals, CI, or logged environments. The publisher should clearly disclose why chatfire.site receives credentials and user content.

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

Error
Location
scripts/t2i.py:15
Finding
API Credentials and User Content Transmitted to an Undisclosed Third-Party Endpoint<![CDATA[ ## Vulnerability Details **File Location**: `scripts/t2i.py:15, 31-39, 76-86`; `scripts/i2i.py:15, 31-38, 83-93` **Vulnerability Type**: Sensitive credential and user-data disclosure **Risk Level**: Critical ### Vulnerable Code `scripts/t2i.py:15` ```python API_URL = "https://api.chatfire.site/v1/images/generations" ``` `scripts/t2i.py:31-39` ```python def get_api_key(): """获取 API Key""" api_key = os.environ.get("HUOBAO_API_KEY") if not api_key: # 尝试从参数获取 for i, arg in enumerate(sys.argv): if arg == "--api-key" and i + 1 < len(sys.argv): return sys.argv[i + 1] print("Error: 请设置环境变量 HUOBAO_API_KEY 或使用 --api-key 参数", file=sys.stderr) sys.exit(1) return api_key ``` `scripts/t2i.py:76-86` ```python req = urllib.request.Request( API_URL, data=json.dumps(body).encode("utf-8"), headers={ "Content-Type": "application/json", "Authorization": f"Bearer {api_key}" }, method="POST" ) try: with urllib.request.urlopen(req, timeout=120) as response: ``` `scripts/i2i.py:15` ```python API_URL = "https://api.chatfire.site/v1/images/generations" ``` `scripts/i2i.py:31-38` ```python def get_api_key(): """获取 API Key""" api_key = os.environ.get("HUOBAO_API_KEY") if not api_key: for i, arg in enumerate(sys.argv): if arg == "--api-key" and i + 1 < len(sys.argv): return sys.argv[i + 1] print("Error: 请设置环境变量 HUOBAO_API_KEY 或使用 --api-key 参数", file=sys.stderr) sys.exit(1) return api_key ``` `scripts/i2i.py:83-93` ```python req = urllib.request.Request( API_URL, data=json.dumps(body).encode("utf-8"), headers={ "Content-Type": "application/json", "Authorization": f"Bearer {api_key}" }, method="POST" ) try: with urllib.request.urlopen(req, timeout=120) as response: ``` ### Technical Analysis Both scripts obtain the user's `HUOBAO_API_KEY` and pla ...[truncated 2271 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace `api.chatfire.site` with the documented official provider endpoint, unless the third-party service is explicitly intended and trusted. 2. Clearly disclose every domain that receives credentials, prompts, image URLs, and request metadata before execution. 3. Require credentials issued specifically for the actual destination service rather than forwarding credentials represented as belonging to another provider. 4. Use narrowly scoped, short-lived tokens restricted to image-generation operations and appropriate spending limits. 5. Implement a hardcoded or securely configured endpoint allowlist. Reject unapproved schemes, hosts, redirects, and endpoint overrides. 6. Disable automatic cross-origin redirects for authenticated requests, or ensure authorization headers are never forwarded to a different host. 7. Provide explicit user confirmation before transmitting sensitive prompts or image references to a third party. 8. Document credential revocation procedures and advise existing users to rotate any key already supplied to these scripts. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/t2i.py:31
Finding
API Secret Accepted Through Process Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/t2i.py:31-39, 123-124`; `scripts/i2i.py:31-38, 132-133`; `SKILL.md:58-69` **Vulnerability Type**: Command-line secret exposure **Risk Level**: Medium ### Vulnerable Code `scripts/t2i.py:31-39` ```python def get_api_key(): """获取 API Key""" api_key = os.environ.get("HUOBAO_API_KEY") if not api_key: # 尝试从参数获取 for i, arg in enumerate(sys.argv): if arg == "--api-key" and i + 1 < len(sys.argv): return sys.argv[i + 1] print("Error: 请设置环境变量 HUOBAO_API_KEY 或使用 --api-key 参数", file=sys.stderr) sys.exit(1) return api_key ``` `scripts/t2i.py:123-124` ```python parser.add_argument("--watermark", "-w", type=bool, default=True, help="是否添加水印 (默认: True)") parser.add_argument("--api-key", "-k", help="API Key") ``` `scripts/i2i.py:31-38` ```python def get_api_key(): """获取 API Key""" api_key = os.environ.get("HUOBAO_API_KEY") if not api_key: for i, arg in enumerate(sys.argv): if arg == "--api-key" and i + 1 < len(sys.argv): return sys.argv[i + 1] print("Error: 请设置环境变量 HUOBAO_API_KEY 或使用 --api-key 参数", file=sys.stderr) sys.exit(1) return api_key ``` `scripts/i2i.py:132-133` ```python parser.add_argument("--watermark", "-w", type=bool, default=True, help="是否添加水印 (默认: True)") parser.add_argument("--api-key", "-k", help="API Key") ``` `SKILL.md:62-69` ```bash # 文生图 - Nano Banana Pro python3 scripts/t2i.py "一只可爱的猫咪" --model nano-banana-pro --size 1x1 --api-key "sk-xxx" # 文生图 - Gemini 2.5 Flash python3 scripts/t2i.py "风景画" --model gemini-2.5-flash-image --size 16x9 --api-key "sk-xxx" # 图生图 python3 scripts/i2i.py --image "https://example.com/img.jpg" --prompt "动漫风格" --model nano-banana-pro --api-key "sk-xxx" ``` ### Technical Analysis Both scripts allow an API credential to be supplied directly through `--api-key`. The documentation actively demonstrates this method. Com ...[truncated 1731 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `--api-key` and `-k` command-line options from both scripts. 2. Remove all documentation examples that place secrets directly in commands. 3. Prefer a platform-managed secret store or secret injection facility. 4. If environment variables must be used, inject them only for the target process and avoid logging the environment. 5. Alternatively, accept a path to a credential file with restrictive permissions rather than accepting the secret value itself. 6. Add startup checks that reject command-line credential values and direct users toward the approved secret mechanism. 7. Ensure debug output, errors, telemetry, and request logs never include authorization headers or credentials. 8. Advise users who previously used `--api-key` to remove affected shell-history entries, review automation logs, and rotate exposed credentials. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Tainted flow: 'req' from os.environ.get (line 81, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
)
    
    try:
        with urllib.request.urlopen(req, timeout=120) as response:
            result = json.loads(response.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        error_body = e.read().decode("utf-8")
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tainted flow: 'req' from os.environ.get (line 75, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
)
    
    try:
        with urllib.request.urlopen(req, timeout=120) as response:
            result = json.loads(response.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        error_body = e.read().decode("utf-8")
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill documents sending prompts and image URLs to external scripts/API endpoints and requires an API key, but it does not warn users that their inputs, referenced images, and credentials are transmitted off-system. This can lead to unintentional disclosure of sensitive prompts, private image URLs, or unsafe handling of API keys, especially when users copy examples directly with secrets on the command line.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
Debug mode prints the input image URL, prompt, model, size, and full JSON request body to stderr, which can leak sensitive prompts, private asset URLs, or business data into terminal histories, CI logs, and centralized log systems. Although the API key is not printed, the logged content itself may be confidential and is emitted without any warning or redaction.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script sends the user-provided image URL and prompt to an external service, which may disclose sensitive image content, private URLs, or confidential prompt text to a third party. While this is core functionality, the absence of an explicit privacy/data-sharing warning increases the risk that users unknowingly transmit sensitive data outside their environment.

External Transmission

Medium
Category
Data Exfiltration
Content
import urllib.error


API_URL = "https://api.chatfire.site/v1/images/generations"

# 支持的模型
MODELS = [
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
import urllib.error


API_URL = "https://api.chatfire.site/v1/images/generations"

# 支持的模型
MODELS = [
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The script sends both user-provided prompts and an API credential to a third-party remote service, but it does not clearly warn the user at runtime or in structured output that their input leaves the local environment. In an agent-skill context, this can cause unintended disclosure of sensitive prompts, internal data, or secrets embedded in prompts if users assume the tool is local-only.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
The description string is written entirely in Chinese and gives no indication that the skill supports user language selection or is intentionally limited to a Chinese-speaking audience. Under the policy rule, forcing a specific language without opt-in or documented locale justification is a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The user-facing description, errors, warnings, and CLI help are written exclusively in Chinese, which effectively imposes a single language for interacting with the skill. There is no indication that this locale restriction is optional or required for a region-specific compliance reason.

Static analysis

No suspicious patterns detected.