T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:90- Finding
Bearer Credential Disclosure Through an Unrestricted API Base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches an AI-HIVE image-generation workflow, but it handles API keys and media uploads with overly broad endpoint control that users should review before installing.
Review this skill before installing. Use it only with the official AI-HIVE endpoint, avoid setting --base-url or AI_HIVE_BASE_URL unless you fully trust the endpoint, and do not upload sensitive local files. Expect API-key storage under ~/.ai-hive/config.json, paid AI-HIVE task submission, reference-media uploads, polling, and result downloads to ~/Downloads/AiHive by default.
scripts/imagegen.py:90Bearer Credential Disclosure Through an Unrestricted API Base URL
scripts/imagegen.py:276Unvalidated Server-Directed Upload and Download Destinations
The implementation supports video generation with image, video, audio, and frame uploads despite the skill being scoped to image generation/editing. In this context, undeclared multimodal/video capability materially increases risk because it broadens what content can be uploaded, processed, and exfiltrated, and may circumvent safety, billing, or approval controls intended only for image workflows.
The CLI exposes chat and video subcommands directly, making the out-of-scope capabilities readily accessible rather than merely dormant code. Because this is an agent skill, exposed commands outside the declared purpose are more dangerous: orchestrators or users may call them assuming the skill is limited to image editing, undermining least privilege and any review based on the manifest.
The skill advertises and operationalizes code paths that can read environment data, write local files, access the network, and invoke shell commands, yet it declares no explicit tool scope or permission boundaries. In an agent setting, this creates an authority mismatch: the skill can trigger sensitive side effects without transparent least-privilege constraints, increasing the chance of secret exposure, unintended filesystem modification, or arbitrary external requests if the skill is invoked unexpectedly.
The description uses very broad trigger language spanning generic AI models, AIGC, ecommerce, advertising, image/video production, and workflow tasks, which can cause the agent to invoke this skill for loosely related requests. Over-broad routing is dangerous because this skill performs networked uploads, task submission, polling, downloads, and local config writes, so accidental invocation can lead to unintended data transfer or paid API actions.
The search-intent section is intentionally expansive, listing many platforms, model brands, tools, and adjacent content-generation scenarios without tight activation criteria. This increases the likelihood that the skill is selected for comparison-shopping or generic creative requests and then gains access to local media, credentials, network operations, or billing-backed task execution in contexts the user did not intend.
The module docstring advertises a broader general-purpose AI tool, including chat, video generation, model querying, upload, and polling, while the declared skill is specifically for Amazon e-commerce image generation/editing. This capability/scope mismatch is dangerous because it can mislead integrators, bypass policy gating tied to the manifest, and expose users to features that were not reviewed for this skill context.
This code file's docstrings, prompts, help text, and status messages are written exclusively in Chinese, which imposes a specific language/locale on all users. The file does not offer any language selection, fallback, or documented justification for the locale restriction.
The code includes a text-chat API path and command handler even though the skill is presented as an image-generation/editing tool. Hidden or undeclared capabilities are risky because they can be invoked outside expected review boundaries, creating policy-evasion opportunities and expanding data exposure beyond what users and operators expect.
The metadata sets language: zh-CN, which indicates a fixed language/locale preference. The file does not offer a user language choice or document a region-specific necessity that would justify enforcing this locale.
The sample API key value includes Chinese text ('请替换为你的APIKey'), which imposes a specific language in user-facing configuration content. This can violate language/locale policy when the file does not offer a language choice or explain a locale-specific requirement.