T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:393- Finding
Server-Controlled Task Metadata Permits Output-Directory Traversal
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill largely matches its AI-HIVE agriculture marketing purpose, but it should be reviewed because its scripts handle API keys and downloaded files with unsafe scoping that could expose credentials or overwrite local files in adverse conditions.
Review this skill before installing if you will use a real AI-HIVE key or private media. Prefer environment variables over --api-key, do not set AI_HIVE_BASE_URL or --base-url unless you fully trust the endpoint, use a low-privilege API key, and run downloads in a contained output directory. Treat all agriculture origin, testing, nutrition, efficacy, pricing, and authorization claims as requiring human verification before publication.
scripts/imagegen.py:393Server-Controlled Task Metadata Permits Output-Directory Traversal
scripts/imagegen.py:91Custom Base URL Can Redirect the AI-HIVE Bearer Credential to an Untrusted Server
scripts/imagegen.py:579API Key Accepted Through Command-Line Arguments
scripts/imagegen.py:7Unpinned Third-Party Dependency Installation Guidance
The skill asserts strong factual and authenticity boundaries for agricultural claims, but static analysis indicates there is no actual fact-checking, compliance enforcement, or provenance control in code. In this context, that is especially risky because agricultural origin, variety, process, testing, nutrition, and efficacy claims can affect consumer trust, regulatory exposure, and commercial decisions while the skill gives a false impression of safety enforcement.
The skill asserts strong factual and authenticity boundaries for agricultural claims, but static analysis indicates there is no actual fact-checking, compliance enforcement, or provenance control in code. In this context, that is especially risky because agricultural origin, variety, process, testing, nutrition, and efficacy claims can affect consumer trust, regulatory exposure, and commercial decisions while the skill gives a false impression of safety enforcement.
The skill asserts strong factual and authenticity boundaries for agricultural claims, but static analysis indicates there is no actual fact-checking, compliance enforcement, or provenance control in code. In this context, that is especially risky because agricultural origin, variety, process, testing, nutrition, and efficacy claims can affect consumer trust, regulatory exposure, and commercial decisions while the skill gives a false impression of safety enforcement.
The skill asserts strong factual and authenticity boundaries for agricultural claims, but static analysis indicates there is no actual fact-checking, compliance enforcement, or provenance control in code. In this context, that is especially risky because agricultural origin, variety, process, testing, nutrition, and efficacy claims can affect consumer trust, regulatory exposure, and commercial decisions while the skill gives a false impression of safety enforcement.
The skill advertises executable commands and code paths that imply access to environment variables, filesystem, network, and shell, but it does not declare any explicit tool scope or allowed-tools boundary. That creates an over-privileged integration surface where an agent may invoke capabilities broader than users would reasonably expect, increasing the chance of unintended file access, secret exposure, or command execution.
The activation text is very broad and overlaps with common marketing, image, and video requests, making accidental invocation likely. Overbroad triggering is dangerous because it can route ordinary user tasks into a more privileged skill path involving external services, file handling, or code execution without clear need.
The usage scenarios rely on ambiguous conditions like broad industry and capability keywords without hard boundaries, which can cause the skill to activate in contexts far outside its intended scope. Because the skill also references uploads, external model calls, and task execution, ambiguous triggering increases the risk of unnecessary data sharing, unintended charges, or misuse of privileged operations.
The default prompt is broadly phrased and can cause the skill to be invoked for a wide range of agriculture, image, video, and marketing requests without clear user intent boundaries. Because the skill also performs operational AI-HIVE actions such as querying models, uploading reference assets, saving price snapshots, routing by cost/speed, and recording task IDs, over-broad invocation increases the chance of unintended tool use, unnecessary data handling, or surprising autonomous behavior.
Forcing Chinese output in the default prompt without checking the user's language preference can override user intent and reduce transparency, especially for multilingual or non-Chinese users. In security terms this is mainly a trust and usability issue: users may misunderstand generated plans or operational instructions, which is more concerning here because the skill may guide media generation and workflow actions.
The file presents all instructions and policy text only in Chinese, which can amount to a language/locale policy violation when no user opt-in or alternative language support is offered. There is no indication that the skill is intentionally limited to a Chinese-speaking or region-specific audience as a documented exception.
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 docstring and user-facing interface are written as a Chinese-only tool description, and the script consistently presents prompts and operational text in Chinese. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified, which it is not here.
The file contains a broader generic CLI with user-info, models, chat, image, video, task, and upload commands, while the declared skill is a specialized agriculture marketing image/video skill. This expands the callable surface beyond the manifest and can enable unintended account inspection or generic model use if the script is invoked outside the narrowed skill entrypoint.
The skill exposes a task path that can call account-oriented functionality such as user-info/wallet retrieval in the same module even though that capability is not justified by the skill purpose. In an agent environment, hidden or adjacent account-inspection features increase the risk of unnecessary data access and scope creep with the user's API credentials.
The module implements generic multimodal chat capability unrelated to the specialized agriculture marketing image/video workflow. That broad capability can be repurposed to send arbitrary prompts and uploaded media to external models, creating unreviewed data egress and behavior outside the declared scope of the skill.
The skill embeds all core business context in Chinese string literals, including industry, mode, focus, channels, and policy boundary, with no indication that the user can opt into another language or locale. This is a natural-language policy concern because it effectively forces a specific language context rather than documenting a justified region-specific constraint or offering a choice.
The manifest describes a domain-specific skill for agricultural company image/video marketing workflows, while this file implements a general-purpose AI Hive CLI including text chat, model listing, user-info, image generation, and generic media upload. Those broader capabilities go beyond the stated specialized marketing-video purpose and are not necessary implementation details for the declared skill intent.
The manifest centers on creating and managing agricultural marketing image/video content, model selection, routing, task tracking, and asset handling. Fetching user account information and wallet balance is an account-management capability unrelated to that content-production purpose.
The top-level docstring describes the file as a general-purpose AI Hive tool covering text chat, image generation, video generation, model query, upload, and task polling. In contrast, the actual __main__ entrypoint uses skill_main() and a narrowed parser exposing only generate, task, upload, and init for a packaged image skill, creating contradictory intent documentation within the file.
This code file contains user-facing natural-language text exclusively in Chinese in the module docstring and throughout the CLI UX. That creates a language/locale constraint without offering the user a choice or documenting that the skill is intentionally region-specific.
The manifest discusses AI-HIVE model querying, media upload, pricing snapshots, routing, polling, and task recording, but does not mention browser launching or source-attribution telemetry via the skill name in a URL. This is an auxiliary onboarding/attribution capability rather than a direct requirement of the agricultural marketing task.