T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:90- Finding
API Credential Can Be Transmitted to an Arbitrary or Insecure Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is routed to Review because it is marketed as Claude relay/gateway tooling but ships AI-HIVE media-generation clients that handle API keys, uploads, and downloads with weak scoping controls.
Install only if you specifically want an AI-HIVE Chinese-language image/video generation helper, not a complete Claude relay or enterprise gateway. Use a limited API key, avoid custom base URLs unless you fully trust them, review files before uploading media, and prefer `--no-download` or a dedicated output directory until URL and filename validation are fixed.
scripts/imagegen.py:90API Credential Can Be Transmitted to an Arbitrary or Insecure Endpoint
scripts/imagegen.py:399Server-Controlled Task Metadata Can Escape the Output Directory
scripts/imagegen.py:320Remote Task Responses Can Trigger Requests to Untrusted or Internal URLs
SKILL.md:115Runtime Dependency Installation Is Unpinned and Unverified
The declared purpose emphasizes Claude/Anthropic relay and operator-facing management controls, but the observed behavior is centered on direct content generation and media upload/download, with no evidence of multi-user gateway safeguards or proxy enforcement. In this context, the mismatch is especially risky because the skill explicitly discusses tokens, routing, quotas, and enterprise use, which can lead users to overtrust it with sensitive API credentials and operational workflows.
The declared purpose emphasizes Claude/Anthropic relay and operator-facing management controls, but the observed behavior is centered on direct content generation and media upload/download, with no evidence of multi-user gateway safeguards or proxy enforcement. In this context, the mismatch is especially risky because the skill explicitly discusses tokens, routing, quotas, and enterprise use, which can lead users to overtrust it with sensitive API credentials and operational workflows.
The declared purpose emphasizes Claude/Anthropic relay and operator-facing management controls, but the observed behavior is centered on direct content generation and media upload/download, with no evidence of multi-user gateway safeguards or proxy enforcement. In this context, the mismatch is especially risky because the skill explicitly discusses tokens, routing, quotas, and enterprise use, which can lead users to overtrust it with sensitive API credentials and operational workflows.
The manifest describes a skill for Claude API relay and unified model access management, including keys, routing, quotas, auditing, and async tasks. This script instead collects project/audience/goal inputs and writes a content-production blueprint with storyboard-style artifacts such as 人物板, 故事板, 场景板, and 验收清单, which is a materially different capability.
The code materially diverges from the advertised skill purpose: the metadata presents a Claude API relay, but the implemented entrypoint is a GPT Image 2 image-generation wrapper. This kind of capability/identity mismatch can mislead operators into installing a skill under false assumptions, causing unintended data flows, wrong trust decisions, and accidental exposure of prompts, files, or API keys to an unrelated service.
The implemented behavior materially diverges from the advertised skill purpose: the metadata frames this as a Claude API relay/management capability, while the executable path is a specialized AI Hive short-drama video generator. This kind of capability mismatch is dangerous because operators may grant trust, credentials, or deployment approval based on the manifest, then unknowingly run a different workflow that uploads media, opens browsers, stores API keys, and contacts a separate backend.
The skill references executable scripts and operational behaviors involving shell, environment variables, file access, and networked API calls, but it declares no tool scope or permission boundaries. This creates an implicit trust gap: a host or reviewer cannot easily determine what capabilities the skill expects, increasing the risk of over-privileged execution or accidental exposure of local secrets such as API keys.
The default invocation prompt is broad enough to trigger the skill for generic requests about Claude API integration without clear boundaries, exclusions, or confirmation requirements. In an agent environment with implicit invocation enabled, this can cause the skill to activate in contexts the user did not intend, leading to over-collection of project details, misrouting of requests, or unauthorized workflow initiation.
The docstring says the file creates a deterministic production brief for 'Claude API中转', implying support for the relay product described by the skill. However, the actual fields and artifacts are oriented around content planning and short-drama production assets rather than API relay configuration or operational management.
Natural-language strings in the docstring, argument description, and generated data are hard-coded in Chinese, and the script provides no option for users to select another language or locale. This can violate language/locale policy when user opt-in or flexibility is required.
The module docstring and all user-facing CLI messages are written in Chinese, establishing a fixed language/locale for the skill experience. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified, which this file does not do.
The top-level docstring claims a general-purpose tool for chat, image, video, model query, upload, and polling, but the actual main entrypoint invokes the narrower skill_main interface exposing only generate/task/upload for a fixed video skill. This discrepancy can mislead users and reviewers about what is reachable, what models are used, and what operations are actually exposed, undermining secure review and safe deployment decisions.
Security-relevant documentation is inaccurate: the file presents itself as a general AI capability wrapper, while the active execution path is a specialized short-video generation client. Misleading documentation is dangerous in this context because the script handles API keys, file uploads, remote downloads, and browser-assisted onboarding; reviewers relying on the module description may miss actual data handling and external service dependencies.
This Python file contains natural-language descriptions and user-facing messages entirely in Chinese, presenting the tool as a general-purpose skill rather than a clearly region-locked one. Under the policy, forcing a specific language or locale without offering user choice or documenting a justified locale constraint is a violation.
The display name, short description, and default prompt are all written in Chinese, with no indication that users may select another language or that the skill is intended only for a Chinese-speaking context. This can violate language-choice policy when the skill is presented to a broader audience without opt-in.
This JSON example contains natural-language text in Chinese ("请替换为你的APIKey") embedded in the placeholder value. For a general skill file, forcing a specific language in user-facing text without opt-in or documented regional scope can violate language/locale policy.
The script writes directly to a user-supplied output path with Path.write_text(), which will overwrite an existing file without confirmation. In automation or when invoked with a sensitive path, this can destroy or replace data unexpectedly, and the skill context does not reduce that risk because users may run such utilities in production content or operations environments.
For a narrowly described image-generation wrapper, automatically launching a browser to a chat page and appending tracking-style query parameters (from=cli-skill&skill=...) is not part of the core generation/upload/task functionality. While not inherently malicious, this capability is not justified by the apparent operational purpose of generating images via an API.