T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
API Credentials Can Be Transmitted to an Arbitrary Server
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is not clearly malicious, but it combines repair guidance with billable AI generation, credential storage, uploads, downloads, and unvalidated API endpoints that need review before use.
Review this skill before installing. Use it only with an AI-HIVE API key you are willing to expose to this tool, avoid custom base URLs unless you fully control them, do not let agents run generation commands implicitly, confirm costs manually before image/video submissions, and only upload files you intend to send to AI-HIVE.
scripts/imagegen.py:91API Credentials Can Be Transmitted to an Arbitrary Server
scripts/imagegen.py:275Unvalidated Server-Supplied URLs Permit Arbitrary Upload and Download Requests
scripts/imagegen.py:18Unpinned Runtime Dependency Installation Creates Supply-Chain Risk
scripts/imagegen.py:470Paid Generation Tasks Are Submitted Without Enforced Cost Confirmation
Instead of focusing on diagnosing failed tasks and planning safe retries, the skill documentation emphasizes submitting new generation jobs, querying account state, storing credentials, and downloading outputs. In a repair context this is especially dangerous because retries and fresh submissions can cause duplicate billing, mishandled secrets, or data leakage if users believe the skill is only analyzing prior failures.
Instead of focusing on diagnosing failed tasks and planning safe retries, the skill documentation emphasizes submitting new generation jobs, querying account state, storing credentials, and downloading outputs. In a repair context this is especially dangerous because retries and fresh submissions can cause duplicate billing, mishandled secrets, or data leakage if users believe the skill is only analyzing prior failures.
Instead of focusing on diagnosing failed tasks and planning safe retries, the skill documentation emphasizes submitting new generation jobs, querying account state, storing credentials, and downloading outputs. In a repair context this is especially dangerous because retries and fresh submissions can cause duplicate billing, mishandled secrets, or data leakage if users believe the skill is only analyzing prior failures.
Instead of focusing on diagnosing failed tasks and planning safe retries, the skill documentation emphasizes submitting new generation jobs, querying account state, storing credentials, and downloading outputs. In a repair context this is especially dangerous because retries and fresh submissions can cause duplicate billing, mishandled secrets, or data leakage if users believe the skill is only analyzing prior failures.
The file implements local video editing operations that materially diverge from the declared AI task-repair purpose. Capability mismatch is dangerous because it expands the skill's attack surface and can enable unauthorized media manipulation or hidden processing behavior outside expected repair workflows.
The file is implemented as a broad AI-Hive client for chat, model enumeration, media upload, image generation, video generation, task polling, and account utilities, which materially exceeds the declared skill purpose of task-failure repair. In an agent environment, this capability expansion increases the attack surface and enables unintended content generation or account actions under the guise of a narrowly scoped repair skill.
The skill advertises executable workflows that use environment variables, local files, network access, and shell commands, but it declares no explicit tool scope or permissions. That creates an authority ambiguity where the runtime may expose broader capabilities than reviewers or users expect, increasing the chance of unintended file access, network exfiltration, or command execution.
The skill name and all user-facing instructions are presented only in Chinese, with no indication that the user may choose another language or locale. This can constitute a language/locale policy issue when the skill appears to assume Chinese as the required interaction language without explicit opt-in or justification.
The activation list includes generic phrases such as '任务修复' and a broad condition about wanting to turn a reference case into original content with scripts, prompts, code, or a task list. These phrases can overlap with many ordinary requests outside this skill's intended AI-HIVE task-repair scope, increasing the chance of unintended invocation.
The usage guidance expands from fixing failed tasks into transforming reference cases into original marketing content, which is a materially different function. That scope drift makes the skill harder to review and can be abused to funnel users from troubleshooting into content generation workflows involving copyright, brand, and billing risks.
A skill framed as task-failure repair also instructs users to create new commercial images and videos, broadening it from remediation into production content generation. This increases the chance of accidental billable actions, policy bypass through misleading categorization, and misuse of provided assets beyond the user's original troubleshooting intent.
The manifest text says the skill will turn requests into a "production-ready Chinese workflow," which imposes a specific language choice by default. This is a natural-language policy concern because the file does not indicate any user opt-in or language selection mechanism.
The manifest describes a skill for diagnosing failed AI model tasks, deciding retries, performing model fallback, and handling AI-HIVE API workflows such as polling and downloads. This file instead only collects project metadata and writes a local JSON 'production brief' blueprint, with no failure analysis, retry logic, API interaction, or task-state recovery behavior.
The script hard-codes Chinese-language skill naming and defaults, such as the docstring and argparse description using Chinese text, without indicating that users may choose another language or locale. This can violate language/locale policy when a skill implicitly enforces one language without explicit opt-in or justification.
The code introduces subprocess-driven ffmpeg media processing unrelated to the stated task-repair function, increasing operational and security risk. Even without shell injection, invoking powerful local binaries on user-controlled files can expose the environment to malformed-media parser bugs, resource exhaustion, and unreviewed file-processing behavior.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run(args: list[str]) -> None:
print(" ".join(args))
subprocess.run(args, check=True)
def main() -> None:
The manifest frames this skill as a repair/remediation tool for failed AI-HIVE tasks: diagnosing auth/parameter/material/model/async-state issues and proposing retry or recovery actions. However, the code is a general-purpose AI Hive client that directly invokes text chat, image generation, video generation, media upload, polling, and download workflows, which goes well beyond failure-repair behavior and turns the skill into a content-generation tool.
The top-level docstring says this file is a '通用 AI 能力调用工具' and lists text chat, image generation, video generation, model query, media upload, and task polling. Later fixed skill metadata identifies the skill specifically as 'AI模型任务失败修复', so the inline documentation presents a materially different intent than the packaged skill's declared purpose.
This codebase presents its primary natural-language interface entirely in Chinese, including the module docstring and all user-facing CLI guidance, without offering a language choice or documenting that the skill is Chinese-only. That can violate language/locale policy where user-facing skills must not force a specific language without opt-in.
The module docstring and CLI framing present the code as a general-purpose AI capability tool rather than a repair-specific utility, creating a mismatch between declared intent and actual behavior. This kind of misrepresentation can cause an orchestrating agent or reviewer to grant broader trust than warranted, leading to unsafe invocation paths and policy bypass through scope confusion.
This code file contains natural-language descriptions and CLI guidance entirely in Chinese, including the module docstring and later user prompts/help text. Under the stated policy, forcing a specific language or locale without offering a choice is a natural-language policy violation unless clearly justified as region-specific.
The script's visible user interface strings, including dependency errors, API-key setup instructions, upload/download notices, task polling updates, and argparse help text, are consistently presented only in Chinese. This effectively enforces a locale on all users without opt-in or documented justification.
The docstring says the script will create a deterministic production brief for 'AI模型任务失败修复|AI-HIVE', implying output directly related to repair workflows. In practice, the generated JSON contains marketing/project planning fields like audience, goal, platform, format, and required facts, not repair plans, failure classifications, retry decisions, or recovery actions.
This code creates parent directories and writes a JSON file to the path provided by --output, but there is no confirmation prompt, warning comment, or user-facing disclosure before performing the write. Because file modification is a safety-relevant operation in code files, it should be clearly disclosed unless already made explicit to the user.
The manifest focuses on receiving failed responses, model configuration, routing strategy, retry history, and generating recovery plans or retry actions. The code also exposes a user-info endpoint and CLI command advertised as querying user information and wallet balance, which is not part of task failure repair semantics.