T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:91- Finding
Bearer API Key Can Be Sent to an Untrusted or Plaintext Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches a short-drama AI-HIVE workflow, but it can submit billable generation jobs and send credentials/media without enforcing the confirmation and endpoint controls it describes.
Review every generated command before running it. Do not use a custom AI_HIVE_BASE_URL or --base-url unless you fully trust the endpoint, keep the API key scoped and private, and treat generate/upload commands as actions that may upload your media and consume AI-HIVE quota or funds.
scripts/imagegen.py:91Bearer API Key Can Be Sent to an Untrusted or Plaintext Endpoint
scripts/imagegen.py:467Billable Media Generation Is Submitted Without Enforced User Confirmation
A second description-behavior mismatch indicates the promised screenplay/planning workflow is absent while unrelated or broader capabilities are present. This kind of capability drift undermines trust and safety review, and can be exploited to trigger unintended actions, including use of paid APIs, access to user account information, or generation workflows outside the declared scope.
A second description-behavior mismatch indicates the promised screenplay/planning workflow is absent while unrelated or broader capabilities are present. This kind of capability drift undermines trust and safety review, and can be exploited to trigger unintended actions, including use of paid APIs, access to user account information, or generation workflows outside the declared scope.
Referenced artifact was not completely inspected
python3 scripts/imagegen.py init --skill-name hongguo-short-drama-studio-ai-hive
Referenced artifact was not completely inspected
python3 scripts/imagegen.py init --skill-name hongguo-short-drama-studio-ai-hive
Referenced artifact was not completely inspected
python3 scripts/videogen.py init --skill-name hongguo-short-drama-studio-ai-hive
Referenced artifact was not completely inspected
python3 scripts/videogen.py init --skill-name hongguo-short-drama-studio-ai-hive
The skill advertises executable examples and implies access to environment variables, filesystem, network, and shell capabilities, but it does not declare any explicit tool scope or permissions boundary. That creates an overbroad and opaque execution surface: a host agent may grant more capability than users or reviewers expect, increasing the risk of unauthorized file access, network exfiltration, or shell command execution if the skill or adjacent scripts are invoked.
The invocation conditions include broad business-oriented triggers such as marketing, e-commerce, and content delivery without precise boundaries. Overbroad routing can cause the skill to activate in loosely related contexts and push users into workflows involving uploads, generation, or external APIs when a narrower or safer skill should have handled the request.
Forcing Chinese output in the default prompt removes user choice and can reduce transparency if the user operates in another language, making it easier for important safety guidance or limitations to be misunderstood. In a skill that generates runnable workflows and operational instructions, language coercion can contribute to misuse or user error rather than being a direct exploit primitive.
Enabling implicit invocation without activation constraints can cause the skill to trigger in contexts the user did not clearly intend, especially because this skill produces executable workflows and AI-HIVE commands. That increases the risk of unintended tool use, prompt injection reach, or accidental assistance for disallowed marketing or content-generation 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 packaged as a narrow Hongguo short-drama image skill, but the implementation is a broad AI-Hive utility exposing unrelated capabilities. This scope mismatch is dangerous because users and higher-level agents may grant trust or permissions based on the advertised purpose while the code can perform additional actions outside that expected boundary.
The file’s user-facing description, prompts, help text, and status messages are written in Chinese throughout, establishing a de facto language requirement for interacting with the skill. There is no indication that users may choose another language or locale, and no justification that this is a region-specific tool, which makes this a natural-language policy concern.
The code exposes a user-info endpoint that retrieves account information and wallet balance, which is not required for the advertised content-generation workflow. In a skill ecosystem, unnecessary access to account metadata increases privacy and reconnaissance risk and violates least-privilege expectations.
The file includes generic text-chat and video-generation API methods beyond the stated image-focused short-drama studio purpose. This broadens the operational scope of the skill, creating hidden capability expansion that could be abused by an agent or user who assumes the tool is constrained to image generation.
The module docstring and the code expose generic chat, image generation, user-info, model listing, arbitrary media upload, and general task querying capabilities, not just the red-fruit short-drama video generation workflow described in the manifest. While AI-HIVE integration is expected, bundling a general-purpose OpenAPI tool materially exceeds the narrowly described studio workflow and creates a description-to-behavior mismatch.
The file-level description is entirely in Chinese and presents the tool as a general-purpose skill, which implicitly fixes the interaction language/locale rather than offering a choice. For a general AI skill, this is a natural-language policy concern because users are not given an opt-in or alternative locale.
The manifest focuses on a specialized studio workflow for vertical short-drama generation and AI-HIVE-backed media generation operations. The code also exposes an unrestricted text chat endpoint, which enables general conversational AI use unrelated to the stated niche production purpose.
The file’s natural-language description and argument parser description are entirely branded in Chinese, which can impose a specific language/locale on users without any opt-in or alternative. The policy allows locale constraints when clearly justified or optional, but this file does not present a language choice or explain that the skill is intentionally region-specific.
The top-level documentation describes a '通用 AI 能力调用工具' covering chat, image, video, model querying, upload, and polling. But the shipped skill configuration and entrypoint reframe the file as a dedicated Hongguo short-drama image skill, so the documentation and the effective skill intent are materially inconsistent.
The manifest describes a content-production skill for receiving scripts and producing short-drama assets through AI-HIVE generation workflows. Querying user profile and wallet balance via the user-info command is an account-management capability that is not necessary to generate scripts, prompts, videos, or QC outputs for this purpose.