T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:91- Finding
API Credentials Can Be Transmitted to an Attacker-Controlled Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This automotive video skill is mostly coherent, but it needs review because its API client can send the user's AI-HIVE key to arbitrary configured endpoints and can download server-named files without enough validation.
Install only if you trust the publisher and the AI-HIVE endpoint you will use. Avoid custom base URLs unless you control them, keep API keys out of command history, review ~/.ai-hive/config.json before authenticated runs, and prefer --no-download or a disposable output directory when testing task downloads.
scripts/videogen.py:91API Credentials Can Be Transmitted to an Attacker-Controlled Endpoint
scripts/videogen.py:401Server-Controlled Task Metadata Can Cause Arbitrary File Downloads and Path Traversal
scripts/videogen.py:7Unpinned Third-Party Dependency Installation Creates Supply-Chain Risk
The declared description promises a substantial automotive video-generation and delivery workflow, including intake of authorized source materials, generation of multiple creative outputs, and AI-HIVE API-based media production operations. The supplied code does none of that. It only parses command-line arguments and emits a deterministic draft JSON file with predefined fields. While this could be a supporting component for a larger skill, the provided chunk's actual behavior is materially narrower than the declared purpose and lacks the core advertised capabilities.
The declared description describes a specialized automotive marketing/demo content skill with AI-assisted asset generation and domain-specific outputs. The supplied code does not implement those behaviors. Instead, it is a generic ffmpeg wrapper for simple video manipulation tasks. While basic video editing could be a supporting component of a larger video-production skill, this code chunk alone materially differs from the declared primary purpose and omits the core advertised capabilities and integrations. There are no suspicious undeclared capabilities beyond generic file/media processing, but the description does not accurately represent what this code actually does.
Referenced artifact was not completely inspected
python3 scripts/videogen.py init --skill-name automotive-feature-demo-ai-hive
Referenced artifact was not completely inspected
python3 scripts/videogen.py init --skill-name automotive-feature-demo-ai-hive
The skill advertises executable commands and API-driven workflows but declares no explicit tool scope or permission boundaries. In a skill ecosystem, this can cause the runtime or reviewer to underestimate that the skill may access environment variables, local files, shell commands, or the network, increasing the chance of unintended secret exposure or unsafe execution paths.
Overly broad trigger phrases can cause the skill to activate in unrelated car or product-content conversations, leading to inappropriate routing into workflows that may request files, invoke external services, or encourage paid generation actions. In this context, broad activation increases the attack surface for prompt confusion, accidental tool use, and unintended disclosure of business assets or media.
The natural-language instruction in the default prompt requires a "production-ready Chinese workflow," which imposes a specific language choice by default. The file does not offer the user a language option or document a justified region-specific constraint.
This code file includes user-facing natural-language strings entirely in Chinese, including the skill description, argparse description, skill name, and search aliases. The file does not offer any language choice or explain that the skill is intentionally region-specific, which can violate a language/locale policy requiring user opt-in or justification.
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 implements a broad, reusable AI Hive client with text chat, image generation, model listing, media upload, and generic task polling, while the declared skill is narrowly scoped to automotive feature demo video generation. This scope mismatch expands the capability surface available through the skill package and can enable unintended use outside the manifest’s restrictions, weakening policy boundaries and increasing abuse potential.
The module docstring and CLI/parser descriptions repeatedly present the tool as a ‘通用 AI 能力调用工具’ and advertise general AI capabilities, contradicting the automotive-only manifest. Misleading scope documentation matters because operators and higher-level agents may trust the manifest while the implementation encourages broader use, creating a policy-confusion channel that can be exploited to invoke out-of-scope functionality.
This code file contains user-facing natural-language strings and the top-level docstring is entirely in Chinese, presenting the tool as a general-purpose interface without documenting a locale restriction or opt-in. Under the policy rule, forcing a specific language in user-facing instructions is a language/locale policy violation unless the skill offers choice or clearly justifies the constraint.
The manifest description defines usage through Chinese-only trigger phrases and content descriptions, but does not indicate that other languages are supported or that the user can opt into this locale. Under the stated policy, a language-specific constraint should either be optional or clearly documented as a justified regional limitation.