T09 · Insecure Skill Coding Practices
- Location
scripts/imagegen.py:109- Finding
Stored API Credentials Can Be Redirected to an Arbitrary Endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly does the advertised AI image-generation work, but it handles API credentials in a way that can send them to a user- or environment-controlled API endpoint.
Review before installing. Use this only with a trusted AI Hive endpoint, avoid setting `AI_HIVE_BASE_URL` or `--base-url` unless you fully trust the destination, use a limited API key, and install dependencies in a virtual environment. Be aware that product images you provide will be uploaded to the service and generated outputs are downloaded locally.
scripts/imagegen.py:109Stored API Credentials Can Be Redirected to an Arbitrary Endpoint
SKILL.md:82Unpinned Runtime Dependency Installation
This markdown file contains user-facing natural language almost exclusively in Chinese, which can impose a language constraint on users without opt-in. The policy for SQP-3 flags language or locale restrictions unless the skill offers choice or clearly justifies the locale limitation.
The skill invokes Python scripts, installs dependencies, and relies on shell, file, environment, and likely network access, but it does not declare any explicit tool scope or permissions boundary. This creates an authorization gap where an agent may run the skill with broader capabilities than intended, increasing the risk of unintended command execution, filesystem access, or external requests if task inputs or downstream scripts are abused.
The file is presented as a Shopify image-generation/editing skill, but the implementation is a broad generic AI client that exposes text chat, video generation, model enumeration, task polling, user-info lookup, and arbitrary media upload. This scope mismatch increases attack surface and enables capability abuse beyond the user’s expected consent, including unintended account data access and use of unrelated generative endpoints.
The module docstring explicitly describes a generic AI capability tool rather than a Shopify-specific image skill, which materially contradicts the declared purpose. This kind of misleading packaging is dangerous because reviewers and users may grant trust, tokens, or files under a narrower expectation than the code actually implements.
The module docstring and all user-facing guidance in this file are written in Chinese, including setup, prompts, errors, and command help. There is no indication that users can opt into another language, which may violate an organizational language/locale policy requiring user choice rather than a forced locale.
Arbitrary text chat is unrelated to Shopify image editing and allows this skill to act as a general-purpose LLM client. That broadens the trust boundary, increases opportunities for prompt misuse or data leakage through an unrelated endpoint, and defeats the principle that a narrowly described skill should only expose narrowly required capabilities.
Video generation is outside the declared image-generation/editing scope, yet the code includes full support for uploading image/video/audio inputs and submitting video jobs. This expands the skill’s effective permissions and can be abused for unreviewed media processing workflows that users and reviewers would not expect from an image-only Shopify skill.
The manifest description includes Chinese text alongside English, which imposes a multilingual presentation choice without explaining whether this skill is intended for bilingual users or offering a language preference. Under the policy rule, language or locale constraints should be opt-in or clearly justified.
The example API key value includes Chinese-only instructional text ("请替换为你的APIKey"), which imposes a specific language in user-facing configuration content. There is no indication that the skill is region-specific or that users may use another language, so this appears to violate the language/locale policy criterion.
User-info and wallet-balance retrieval are unrelated to creating Shopify product images and expose unnecessary account metadata. In a skill context, this violates least privilege and can normalize collection of billing/account information that the user did not expect to share for image editing.
No suspicious patterns detected.