T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:91- Finding
Arbitrary API Base URL Can Exfiltrate the AI-HIVE API Key
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a disclosed AI-HIVE video workflow, but it needs review because API credential handling is under-scoped and some shipped code is broader than the stated video purpose.
Install only if you are comfortable giving this skill an AI-HIVE API key, uploading selected media to AI-HIVE, and potentially creating billable generation tasks. Avoid custom --base-url or AI_HIVE_BASE_URL values unless you fully trust the endpoint, prefer environment variables or a dedicated limited API key, and review ~/.ai-hive/config.json after init.
scripts/videogen.py:91Arbitrary API Base URL Can Exfiltrate the AI-HIVE API Key
scripts/videogen.py:12Unpinned Runtime Dependency Installation
This finding is more severe because the documented/observed mismatch reportedly includes undeclared generic chat, image generation, account info access, wallet balance retrieval, model discovery, and local API-key setup/storage. Undeclared access to account and credential-related functions materially expands the attack surface: a user may invoke a narrowly branded video-editing skill while unknowingly exposing API keys, account metadata, or billing context to broader capabilities than expected.
This finding is more severe because the documented/observed mismatch reportedly includes undeclared generic chat, image generation, account info access, wallet balance retrieval, model discovery, and local API-key setup/storage. Undeclared access to account and credential-related functions materially expands the attack surface: a user may invoke a narrowly branded video-editing skill while unknowingly exposing API keys, account metadata, or billing context to broader capabilities than expected.
This finding is more severe because the documented/observed mismatch reportedly includes undeclared generic chat, image generation, account info access, wallet balance retrieval, model discovery, and local API-key setup/storage. Undeclared access to account and credential-related functions materially expands the attack surface: a user may invoke a narrowly branded video-editing skill while unknowingly exposing API keys, account metadata, or billing context to broader capabilities than expected.
The file presents itself as a Seedance video edit/extend skill, but actually implements a broad multi-purpose AI client with chat, image, video, model discovery, upload, and account functions. This capability mismatch violates least privilege and expands what the skill can do if invoked or repurposed, making policy bypass and unintended data/API usage more likely.
The skill advertises executable workflows involving environment variables, local file access, networking, and shell commands, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, this can lead to over-broad implicit capabilities, making unauthorized file access, command execution, or external requests more likely if the skill is invoked or extended unsafely.
The skill enables allow_implicit_invocation without defining tight activation constraints, examples, or guardrails, so the agent may invoke this capability from vague user requests. Because this skill can generate runnable AI-HIVE commands and production workflows for video editing/generation, overbroad auto-invocation increases the chance of unintended media-manipulation assistance, including potentially deceptive or policy-sensitive use cases, without an explicit user request to use this specific tool.
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 module documentation explicitly describes a generic AI capability tool, which contradicts the Seedance-specific manifest and signals that the implementation scope is broader than disclosed. This mismatch is dangerous because reviewers and users may trust a narrowly described skill while receiving a much more capable tool.
The text chat command is unrelated to the declared video-editing purpose and gives the skill a general-purpose LLM interface. In this context, extra capability increases attack surface and can enable prompt/data exfiltration or unauthorized use of the user's AI-Hive account beyond the expected Seedance workflow.
Standalone image generation is outside the manifested Seedance video extension/editor scope. Unnecessary generation features broaden possible misuse, billing exposure, and policy evasion paths while giving operators capabilities they would not reasonably expect from this skill.
The init flow persists the API key to a config file after prompting for it, but does not clearly warn the user beforehand that the credential will be stored on disk. Although file permissions are tightened to 0600, silent persistence of secrets can violate user expectations and increase risk on shared, backed-up, or later-compromised systems.
The file’s natural-language description and skill name are presented in Chinese-only form in the module docstring and argparse description/string metadata. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation, and this file does not indicate that users may choose another language.
The module docstring describes the skill entirely in Chinese, and the CLI’s user-facing help and status text are also written only in Chinese. For a general-purpose skill, this creates a language policy concern because the skill imposes a specific locale without any opt-in, fallback, or statement that it is intended only for Chinese-speaking users.
The code supports user-info and models operations that query wallet/account information and enumerate all available models. Although model lookup may support backend routing, exposing these as user-invocable commands is broader than the manifest’s focused Seedance video editing/extension role.