T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:90- Finding
Bearer credential can be transmitted to an attacker-controlled API endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a real AI-HIVE video workflow skill, but it needs review because it stores API keys locally and can send them to a configurable API endpoint without validating the destination.
Install only if you are comfortable with a Chinese AI-HIVE video workflow that reads local media you choose, uploads it to AI-HIVE, may create paid generation tasks, and stores an API key locally. Prefer using AI_HIVE_API_KEY for a session instead of init, do not use custom base URLs unless you trust them, and rotate the API key if it may have been used with an untrusted endpoint.
scripts/videogen.py:90Bearer credential can be transmitted to an attacker-controlled API endpoint
scripts/videogen.py:7Runtime dependency installation is unpinned and lacks integrity verification
The declared description presents a full-featured video production toolbox with unified mode selection and external API-driven generation operations. The supplied code does not implement those behaviors. It only parses command-line inputs and saves a static JSON blueprint skeleton. While the output fields loosely align with the domain and naming in the description, the actual implemented capability is materially narrower and lacks the key operational features described, so this is a clear description-behavior mismatch.
The declared description presents a high-level generative video toolbox centered on MiniMax/Hailuo H3 and AI-HIVE OpenAPI interactions for creating and managing video generation jobs. The supplied code does none of that. Instead, it is a straightforward local CLI wrapper around ffmpeg/ffprobe for basic editing operations on existing video files. This is a materially different primary purpose and omits the declared API/networked generation behavior entirely. Therefore the description does not accurately represent the code chunk.
The skill advertises and demonstrates capabilities that imply network access, shell execution, file access, and environment-variable use, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, this can lead to overbroad tool availability, making it easier for prompt-driven workflows to access local files, invoke shell commands, or use secrets such as API keys without clear least-privilege controls.
The skill enables implicit invocation without clear trigger constraints, which can cause the agent to activate this capability in response to loosely related user requests. Because the skill can produce runnable workflows and AI-HIVE commands tied to external content generation, unintended activation may lead to unnecessary API actions, cost-incurring operations, or execution of a workflow the user did not explicitly request.
The script description, skill name, default platform value, and several embedded content fields are all fixed in Chinese, with no option for the user to choose language or locale. This creates a natural-language policy concern because the file imposes a specific language context rather than offering an explicit opt-in or choice.
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 top-level docstring says this file is a '通用 AI 能力调用工具' that supports text chat, image generation, video generation, model queries, media upload, and task polling. However, the manifest for this skill claims a much narrower purpose centered on MiniMax H3 video-toolkit workflows; bundling broad chat/image/model/account functionality creates a semantic mismatch between the skill's claimed scope and the code it actually contains.
The manifest focuses on receiving creative/video inputs and producing MiniMax H3 video generation suggestions, tasks, pricing snapshots, uploads, polling, and downloads. The code also implements a user-info endpoint and CLI command that retrieves account information and wallet balance, which is not justified by the described creator-toolkit workflow.
The manifest is narrowly framed around MiniMax H3 video workflows—text-to-video, image-to-video, and reference-based video generation guidance and execution. The code nonetheless includes a full text-chat API wrapper and corresponding CLI path, which is a broader AI capability not needed for the stated specialized video-toolkit purpose.
The manifest emphasizes MiniMax H3 video creation modes and related execution steps, not standalone image generation. This code exposes a general image generation endpoint and command, expanding the capability set beyond what is necessary for the declared video-only toolkit use case.
The init flow persistently stores the API key in ~/.ai-hive/config.json after interactive entry, but does not explicitly warn the user that credentials will be written to disk. Although the file is chmod'd to 0600, persistent local storage still increases credential exposure risk through backups, endpoint compromise, shared home-directory scenarios, or accidental inclusion in support bundles.
The skill parser description labels this as an 'AI Hive 裸接口视频 Skill', implying a video-focused interface. Yet the same skill exposes additional non-generation commands such as raw media upload and task inspection, which broadens the operational intent expressed by the description.