T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
API Credential Disclosure Through an Unrestricted Base URL in the Image Generation Client
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a disclosed AI-HIVE media-generation workflow, but its API clients can send saved bearer credentials to an arbitrary configured API base URL.
Review this skill before installing if you will use a real AI-HIVE API key. Use only the official AI-HIVE endpoint, avoid setting AI_HIVE_BASE_URL or --base-url from untrusted instructions, keep ~/.ai-hive/config.json private, and confirm prompts, uploads, batch size, routing, and cost before running generation commands.
scripts/imagegen.py:91API Credential Disclosure Through an Unrestricted Base URL in the Image Generation Client
scripts/videogen.py:91API Credential Disclosure Through an Unrestricted Base URL in the Video Generation Client
scripts/imagegen.py:312Unbounded Download of Server-Supplied Result URLs in the Image Generation Client
scripts/videogen.py:312Unbounded Download of Server-Supplied Result URLs in the Video Generation Client
This mismatch includes undeclared user-info and wallet-balance queries, local config storage, direct upload/download, and broad AI generation functionality unrelated to the stated co-creation workflow. In context, that is more dangerous than a simple documentation bug because the skill also handles API keys and billable third-party operations, so users could unknowingly expose account metadata, store credentials insecurely, or trigger costly actions.
This mismatch includes undeclared user-info and wallet-balance queries, local config storage, direct upload/download, and broad AI generation functionality unrelated to the stated co-creation workflow. In context, that is more dangerous than a simple documentation bug because the skill also handles API keys and billable third-party operations, so users could unknowingly expose account metadata, store credentials insecurely, or trigger costly actions.
This mismatch includes undeclared user-info and wallet-balance queries, local config storage, direct upload/download, and broad AI generation functionality unrelated to the stated co-creation workflow. In context, that is more dangerous than a simple documentation bug because the skill also handles API keys and billable third-party operations, so users could unknowingly expose account metadata, store credentials insecurely, or trigger costly actions.
This mismatch includes undeclared user-info and wallet-balance queries, local config storage, direct upload/download, and broad AI generation functionality unrelated to the stated co-creation workflow. In context, that is more dangerous than a simple documentation bug because the skill also handles API keys and billable third-party operations, so users could unknowingly expose account metadata, store credentials insecurely, or trigger costly actions.
Referenced artifact was not completely inspected
python3 scripts/imagegen.py init --skill-name fan-vote-story-co-creation-ai-hive
Referenced artifact was not completely inspected
python3 scripts/imagegen.py init --skill-name fan-vote-story-co-creation-ai-hive
The skill advertises and demonstrates capabilities that involve environment variables, local file access, shell execution, and network/API usage, but it does not declare any explicit tool scope or permission boundaries. This creates an over-privileged integration risk: a host agent may grant broader capabilities than intended, making accidental file access, command execution, or outbound data transfer easier if the skill is invoked in sensitive contexts.
The manifest description and title are entirely framed around Chinese trigger phrases and Chinese-language use, and the examples throughout the document assume Chinese prompts and outputs. There is no explicit opt-in, multilingual option, or statement that the skill is intentionally limited to a Chinese-only regional compliance context.
The default prompt hardcodes Chinese output ('production-ready Chinese workflow') without checking user preference. While not directly enabling code execution, this can override user intent, reduce transparency, and make safety-relevant instructions less understandable to some users or downstream reviewers, which is more concerning in a skill that emits runnable commands and operational deliverables.
The manifest sets allow_implicit_invocation: true, which permits the skill to be invoked automatically without a tightly scoped trigger boundary in the file itself. Because this skill can generate production-ready workflows and runnable AI-HIVE commands, overly broad implicit activation increases the chance of unintended invocation on adjacent user requests, causing unreviewed content generation or API-oriented actions in a higher-risk marketing/content-production context.
This code embeds Chinese-only natural-language strings in the module docstring, argument parser description, skill name, and search aliases, with no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking context. That creates a locale policy concern because the skill appears to mandate a specific language by default rather than offering user choice.
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 file is packaged as a narrowly scoped fan-vote story image skill, but it actually embeds a generic AI-Hive client with broader capabilities. This scope mismatch increases the attack surface and can enable unintended operations through a skill that users and reviewers may reasonably trust as single-purpose.
This code file contains natural-language descriptions and user-facing CLI messages that assume Chinese as the only language of interaction. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.
Exposing a user-info and wallet-balance command gives the skill access to account metadata unrelated to image generation. In a delegated-agent setting, this can leak sensitive account information or enable reconnaissance about available funds without a clear business need.
The embedded text-chat capability is outside the declared image-focused fan-vote workflow and materially expands what the skill can do. In practice, this can be abused to relay arbitrary prompts and data to external models, bypassing the narrower controls and expectations attached to the packaged skill.
The file presents itself as a fan-vote story co-creation video skill, but it also includes broad OpenAPI functionality for chat, image generation, model enumeration, user-info, uploads, and generic task handling. This scope expansion violates least privilege and increases the chance that callers can use the skill for unrelated actions, data exposure, or policy bypass beyond the declared purpose.
The skill exposes a user-info endpoint that can reveal account metadata and wallet balance, which is unrelated to fan-vote video generation. Unnecessary access to account information expands the blast radius if the skill is misused or invoked in an unintended context.
The generic text chat command is outside the declared specialized video co-creation purpose and enables arbitrary model interactions through the same trusted skill package. That broader capability can be abused to send unrelated prompts or process uploaded media in ways users and reviewers would not expect from this skill.
The image-generation pathway is broader than the skill's declared fan-vote story video function and allows creation of standalone image outputs through the same package. This creates an unnecessary capability surface that may be used for unrelated content generation, complicating review and weakening trust in the skill boundary.
The skill uploads local media files to remote storage and API services, but the interface does not give an explicit warning at the point of use that selected files will leave the local machine. In a creative workflow, users may upload sensitive or proprietary assets, so lack of clear disclosure can cause unintended data exfiltration to third-party infrastructure.
The top-level docstring says this file is a '通用 AI 能力调用工具' that wraps text chat, image generation, video generation, model querying, media upload, and task polling. However, the generated skill configuration at the bottom packages the file as the specific fan-vote-story-co-creation-ai-hive image skill, so the documentation actively describes a broader intent than the delivered skill claims.
The top-level natural-language description and many user-facing strings are Chinese-only, which effectively imposes a locale/language requirement without offering user opt-in or alternatives. Under the stated policy, forcing a specific language without choice is a natural-language policy concern unless clearly justified as region-specific.
The script writes downloaded outputs to user directories and also creates the output directory if needed. While runtime progress messages show the filename, there is no broader disclosure in the skill description or command help that running generation will create or overwrite local files under the configured output directory.