T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Bearer API Key Can Be Sent to an Attacker-Controlled Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches an AI-HIVE virtual try-on workflow, but it handles API credentials in a way that can send them to an arbitrary configured API endpoint.
Review before installing. Use only the default AI-HIVE endpoint, do not set AI_HIVE_BASE_URL or --base-url to an untrusted host, and check ~/.ai-hive/config.json before running. Treat uploaded person or garment images as sensitive, confirm authorization and cost before generation, and rotate the AI-HIVE key if it was ever used with an untrusted endpoint.
scripts/imagegen.py:91Bearer API Key Can Be Sent to an Attacker-Controlled Endpoint
The skill claims a concrete AI-HIVE/OpenAPI workflow including configuration lookup, reference upload, pricing snapshots, routing modes, async polling, and result download, but the described behavior is not actually implemented and appears to stop at planning output. This mismatch is dangerous because users or calling agents may rely on nonexistent safeguards, cost checks, authorization handling, or auditability controls, leading to unsafe execution assumptions, unexpected billing, or misuse of unauthorized media workflows.
The skill advertises runnable scripts and API-driven generation workflows but does not declare any explicit tool/permission boundaries, even though it implies use of environment variables, filesystem access, network calls, and shell execution. In an agent environment, missing scope declarations can cause over-privileged execution or ambiguous trust boundaries, increasing the chance that the agent uses sensitive capabilities without informed approval or proper sandboxing.
The default prompt hard-codes Chinese output ('production-ready Chinese workflow'), which overrides normal user language expectations without explicit opt-in. This is primarily a prompt-safety and UX-control issue: it can cause unintended behavior, reduce transparency, and make downstream review harder for users who do not read Chinese, especially in a workflow that generates runnable commands and deliverables.
Implicit invocation is enabled, but the file does not define narrow trigger constraints at the interface level; this increases the chance the skill will auto-activate in situations where the user did not clearly request it. Because this skill can generate executable AI-HIVE commands and production workflows for image-generation tasks, accidental invocation could lead to unintended processing, confusing outputs, or unauthorized use of sensitive photos/workflows.
The file’s user-facing title and CLI description are entirely in Chinese, which implies a fixed language experience without any opt-in or alternate locale support. The policy specifically calls for flagging language or locale constraints when the skill does not offer a language choice or clearly justify the restriction.
The file implements a broad, reusable AI client for chat, image, video, upload, and task polling rather than a narrowly scoped try-on-only skill. In agent environments, this scope mismatch increases the attack surface and can enable unintended capabilities to be invoked outside the declared apparel-preview purpose, weakening policy boundaries and review assumptions.
The module advertises itself as a generic AI capability tool, contradicting the specialized try-on skill metadata. This kind of deceptive or overly broad packaging makes it easier to smuggle unrelated capabilities through review and causes downstream systems to trust a narrower purpose than the code actually provides.
This code file contains natural-language descriptions, help text, and operational instructions entirely in Chinese, starting in the module docstring and continuing throughout the CLI. Under the policy rule, forcing a specific language without offering the user a locale choice is a natural-language policy violation.
Exposing text-chat capability is inconsistent with the declared virtual try-on image preview purpose and creates a hidden general-purpose model interface. If an agent or wrapper can reach this path, users may leverage the skill for arbitrary prompt processing or policy evasion under the guise of a specialized image tool.
Video generation materially expands capability beyond the stated try-on preview image workflow. This broadening can be abused to create unauthorized or misleading synthetic media and defeats the expectation that the skill is limited to static apparel preview generation.
Querying user account information and wallet balance is unrelated to generating try-on previews and introduces unnecessary access to potentially sensitive account data. Even if limited, this violates least privilege and expands what a compromised or misused skill can reveal.