T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Bearer API Credential Can Be Transmitted to an Attacker-Controlled Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a disclosed AI-HIVE makeup-preview workflow, but it handles API keys and billable media calls with an unsafe base-URL override that could expose credentials.
Install only if you are comfortable giving this skill an AI-HIVE API key and letting it upload selected media to AI-HIVE. Do not use an untrusted --base-url, AI_HIVE_BASE_URL, or ~/.ai-hive/config.json base_url value, and prefer a dedicated low-limit API key because generation may consume credits. Review media authorization and AI-preview labeling before submitting portrait or brand assets.
scripts/imagegen.py:91Bearer API Credential Can Be Transmitted to an Attacker-Controlled Endpoint
scripts/imagegen.py:7Unpinned Third-Party Runtime Dependency
A second description-behavior mismatch indicates the skill claims specialized makeup-preview processing but reportedly exposes additional generic or account-adjacent capabilities while failing to implement key domain safeguards. In context, this is more dangerous because the skill handles portraits, brand assets, and potentially billable media-generation operations, so undeclared behaviors can lead to privacy issues, unauthorized spending, or misuse of user trust around what the skill is actually doing.
A second description-behavior mismatch indicates the skill claims specialized makeup-preview processing but reportedly exposes additional generic or account-adjacent capabilities while failing to implement key domain safeguards. In context, this is more dangerous because the skill handles portraits, brand assets, and potentially billable media-generation operations, so undeclared behaviors can lead to privacy issues, unauthorized spending, or misuse of user trust around what the skill is actually doing.
The skill advertises executable workflows and includes shell commands, environment-variable handling, filesystem paths, and network API usage, but it does not declare an explicit tool scope such as permissions or allowed-tools. This creates an overbroad execution surface where a hosting agent may grant more capabilities than the skill actually needs, increasing the risk of unintended command execution, file access, or external data exfiltration if the skill is invoked in a permissive runtime.
The prompt explicitly instructs the skill to produce a "production-ready Chinese workflow," which imposes a specific language choice on users. This is a natural-language policy concern because the file does not offer a language choice or document a justified region-specific restriction.
The skill enables implicit invocation without defining tight trigger constraints, exclusions, or user-confirmation boundaries. In a workflow that handles authorized portraits, product materials, uploads, pricing, routing, polling, and downloads, this increases the chance the agent invokes the skill in situations the user did not clearly intend, causing unintended data handling or external API actions.
The file is presented as a beauty/makeup image-preview skill, but the module is a broad generic AI client exposing chat, image, video, upload, model listing, and task APIs. This capability mismatch increases attack surface and makes it easier for downstream callers to use the skill for unintended operations outside its declared scope, undermining least-privilege and policy-based control.
The module docstring and subsequent user-facing messages are written exclusively in Chinese, and the skill does not indicate that language is configurable or limited to a China-specific deployment context. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.
A text-chat endpoint is exposed even though the skill is supposed to perform makeup-preview image generation. Unnecessary text capability broadens what an agent can do with the user's API key and can be abused for unrelated prompt processing or policy-evasive workflows not expected by the skill's trust boundary.
Video generation is outside the stated purpose of a makeup-preview image skill and introduces additional high-cost, high-capability operations. This mismatch can let callers create richer media than intended, increasing abuse potential, spend exposure, and policy circumvention opportunities using a skill that appears narrowly scoped.
The docstring and CLI description hard-code a Chinese-language skill identity ('AI美妆试妆效果图|AI-HIVE') with no indication that users can choose another language or locale. This can violate language/locale policy when a skill imposes a fixed language experience without user opt-in.
The skill-specific parser advertises image upload, but it dispatches to a generic uploader that accepts arbitrary MIME types based on extension, including video and audio. In a narrowly scoped beauty image skill, this weakens user expectations and input controls, enabling unintended media handling and expanding misuse paths.