T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:90- Finding
Unrestricted API Endpoint Override Can Disclose the Bearer API Key
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent AI Hive image-generation skill, but it needs review because it can store and send an API key and user media through configurable, insufficiently validated endpoints.
Review before installing. Use a dedicated low-privilege AI Hive API key, avoid custom `--base-url`, `AI_HIVE_BASE_URL`, or edited config hosts unless you fully trust them, and only upload media you are comfortable sending to the configured service. Prefer an isolated Python environment and a pinned dependency install.
scripts/imagegen.py:90Unrestricted API Endpoint Override Can Disclose the Bearer API Key
scripts/imagegen.py:279Server-Controlled Upload and Download URLs Are Used Without Trust Validation
SKILL.md:79Runtime Dependency Installation Is Unpinned and Lacks Integrity Verification
The skill invokes shell commands, installs a package, and runs a Python script with network, file, and environment access, but it does not declare any tool scope or permission boundaries. This creates unnecessary ambient authority: an agent may execute the skill with broader capabilities than intended, increasing the chance of unsafe file access, network egress, or command execution if the script or its inputs are abused.
The manifest description and the entire skill guidance are written as mandatory Chinese-language instructions for generating JD e-commerce images, with no indication that users may choose another language or that the locale restriction is optional. This matches the policy category for language/locale constraints imposed without user opt-in.
The skill is advertised as a JD e-commerce image generation/editing tool, but the file also contains generic chat and video generation primitives plus broader OpenAPI access logic. This expands the skill’s effective capability beyond user expectations and least-privilege design, increasing the risk of unauthorized or unintended use if another component invokes these hidden functions or the file is repurposed.
The module docstring and all user-facing CLI guidance are written in Chinese, establishing a Chinese-only interaction pattern. The policy requires flagging language or locale constraints when the skill forces a specific language without opt-in or documented justification.
This markdown file presents substantive skill documentation only in Chinese, which effectively forces a specific language on readers. Under the policy, language constraints should either be optional for the user or clearly justified as region-specific.
The placeholder value for api_key includes Chinese text (请替换为你的APIKey), which imposes a specific language in user-facing configuration content. The file does not offer a language choice or explain that the skill is intended only for a Chinese-speaking or region-specific audience.
User-info and wallet-balance retrieval are unrelated to the stated JD image-generation purpose and expose account metadata that is not necessary for core operation. Even if not directly exploitable on their own, unnecessary account-inspection features increase information exposure and violate capability minimization.
Model listing and model lookup expose broader service discovery than required for a fixed-purpose JD image skill, allowing users or wrappers to enumerate capabilities beyond the advertised image workflow. In context, this is an overbroad feature set that increases attack surface and can aid misuse of the underlying platform.