T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:92- Finding
Bearer API Key Disclosure Through Unrestricted Base URL Configuration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is mostly an AI-HIVE media-generation helper, but it handles API keys and downloaded files in ways that could expose credentials or write outside the intended output folder if endpoints or responses are manipulated.
Review this before installing if you will use a real AI-HIVE API key or proprietary media. Only run it with the official AI-HIVE endpoint, avoid untrusted AI_HIVE_BASE_URL or config changes, use a low-privilege API key, choose a non-sensitive output folder, and verify generated commands before any paid batch generation.
scripts/imagegen.py:92Bearer API Key Disclosure Through Unrestricted Base URL Configuration
scripts/imagegen.py:276Unvalidated Server-Supplied Upload and Download URLs Enable Unintended Network Access and Data Transfer
scripts/imagegen.py:394Remote Task Metadata Can Escape the Output Directory Through Path Traversal
Claiming support for scripts, episode planning, capacity/budget handling, delivery manifests, and OpenAPI-backed generation workflows without implementing them creates an integrity and governance risk. In a production media pipeline, that can result in operators trusting nonexistent authorization, provenance, pricing, or retry controls and exposing licensed assets or branded content to the wrong process.
Claiming support for scripts, episode planning, capacity/budget handling, delivery manifests, and OpenAPI-backed generation workflows without implementing them creates an integrity and governance risk. In a production media pipeline, that can result in operators trusting nonexistent authorization, provenance, pricing, or retry controls and exposing licensed assets or branded content to the wrong process.
Claiming support for scripts, episode planning, capacity/budget handling, delivery manifests, and OpenAPI-backed generation workflows without implementing them creates an integrity and governance risk. In a production media pipeline, that can result in operators trusting nonexistent authorization, provenance, pricing, or retry controls and exposing licensed assets or branded content to the wrong process.
Claiming support for scripts, episode planning, capacity/budget handling, delivery manifests, and OpenAPI-backed generation workflows without implementing them creates an integrity and governance risk. In a production media pipeline, that can result in operators trusting nonexistent authorization, provenance, pricing, or retry controls and exposing licensed assets or branded content to the wrong process.
Referenced artifact was not completely inspected
python3 scripts/imagegen.py init --skill-name short-drama-batch-production-ai-hive
Referenced artifact was not completely inspected
python3 scripts/imagegen.py init --skill-name short-drama-batch-production-ai-hive
The skill advertises runnable scripts that use environment variables, filesystem access, network calls, and shell-adjacent local tooling, but it does not declare any explicit tool scope or allowed-tools boundary. That omission weakens least-privilege controls and can cause the host agent to expose broader capabilities than intended, increasing risk of unintended file access, secret handling, or outbound requests if the skill is invoked automatically.
The description and invocation guidance are entirely framed in Chinese trigger phrases and Chinese-language usage, but the file does not state that the skill is intentionally limited to Chinese-speaking users or provide an opt-in language choice. This can violate language/locale policy when a skill implicitly forces a specific language without user choice.
Broad trigger phrases like '多集视频' and '内容工厂' can cause the skill to activate in overly general contexts, routing unrelated user requests into a capability that includes external generation workflows and scriptable examples. Misrouting is a security concern because it increases the chance of unnecessary tool exposure, accidental data sharing, or use of the wrong compliance guardrails.
The default prompt explicitly instructs the skill to produce a 'production-ready Chinese workflow,' which imposes a specific language choice regardless of the user's preference. This is a natural-language policy concern because it forces a locale/language without offering the user a choice or documenting a justified region-specific constraint.
The skill enables implicit invocation without any scoped trigger constraints, exclusions, or authorization gating. In this context, the skill can generate production workflows and runnable AI-HIVE commands for bulk media generation, so accidental or overly broad activation could cause unintended execution paths, budget-consuming API use, or unsafe assistance in sensitive marketing/content-production scenarios.
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 branded and wrapped as a specialized short-drama batch-production image skill, but it embeds a broader generic AI client supporting chat, video, model enumeration, account lookup, and media upload. This capability mismatch violates least privilege and increases the chance that downstream tooling, reviewers, or users invoke functionality that was not disclosed or expected from the skill.
The module docstring and user-facing instructions are written entirely in Chinese, and the CLI later emits only Chinese prompts/messages. For a general-purpose skill, this imposes a specific language/locale on users without opt-in or an alternative language path, which matches the language/locale policy violation criteria.
Exposing user-info and wallet-balance queries is unnecessary for the stated content-production purpose and grants access to account metadata beyond what the skill needs to perform image generation. In a skill ecosystem, this kind of overbroad read capability can leak sensitive operational or billing information to callers or logs and signals excessive privilege.
The unrestricted text-chat endpoint materially expands the skill from a narrow batch-production media tool into a general-purpose LLM interface. That makes policy bypass, unreviewed prompt handling, and unintended data flow more likely because consumers may use the skill for arbitrary conversations outside the declared and reviewed use case.
The code exposes general video-generation operations even though the concrete skill wrapper is configured as an image-generation skill. This hidden capability broadens the operational surface, can incur unexpected cost or content risk, and undermines trust in the declared behavior of the skill package.
The file is presented as a specialized short-drama batch-production skill, but the implementation exposes a broad generic AI client with chat, image generation, model enumeration, uploads, and account inspection. This violates least-privilege and creates capability mismatch: a caller or wrapper expecting narrowly scoped video-production behavior may inadvertently grant access to unrelated functions and data flows.
The module docstring explicitly markets the file as a generic AI capability tool, contradicting the declared identity of a specialized short-drama production skill. This kind of misrepresentation is dangerous in agent ecosystems because routing, trust, and permission decisions may rely on the skill description, while the actual code exposes materially broader functionality.
The module docstring is entirely in Chinese and presents the tool as a general-purpose skill, while later CLI help and prompts are also predominantly Chinese. For a broadly scoped skill, this imposes a specific language/locale by default rather than offering a user choice or documenting a justified locale restriction.
The generic text chat function is outside the skill's stated narrow purpose and can be repurposed for arbitrary model interactions. In an agent environment, this broadens the skill from a bounded video pipeline into a general LLM access path, undermining policy scoping, auditability, and least-privilege assumptions.
The image generation endpoint similarly exceeds the declared short-drama batch video scope and provides an unnecessary extra content-generation primitive. This increases the attack surface and allows consumers to use the skill for unadvertised workflows, including generating assets or content outside intended governance controls.
The file embeds Chinese-only natural-language identifiers in the module docstring, CLI description, and generated skill metadata. This imposes a specific language/locale presentation without offering user opt-in, fallback, or documenting that the skill is intentionally region-specific.
The module-level documentation advertises a generic multi-capability AI tool while the packaged skill presents itself as a specialized short-drama image skill. This inconsistency is a security-relevant transparency problem because it can mislead reviewers and operators about what the code is capable of doing, reducing effective oversight.
The user-info capability lets the skill retrieve account metadata and wallet/balance information that is not necessary for short-drama batch video generation. Even if not directly destructive, it expands data exposure and can leak sensitive operational or billing information to users or higher-level agents that should not access it.
No suspicious patterns detected.