T09 · Insecure Skill Coding Practices
- Location
scripts/generate_text2image.py:39- Finding
JWT Credential File Is Created Before Secure Permissions Are Enforced
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is meant to generate images with ai.fun.tv, but it needs review because it persists an authentication token locally and can download unvalidated provider-supplied URLs.
Review before installing if you use ai.fun.tv with real account credentials. Prefer passing the token through an environment variable or --authorization with --no-save-authorization, keep the skill directory private, and avoid --output-dir unless you trust the provider-returned image URLs and can tolerate local downloads.
scripts/generate_text2image.py:39JWT Credential File Is Created Before Secure Permissions Are Enforced
scripts/generate_text2image.py:76Unvalidated API-Supplied URLs Enable Client-Side SSRF and Unbounded Downloads
The skill performs sensitive actions including reading environment variables, persisting credentials to disk, making network requests, and invoking shell commands, but it does not declare any explicit tool scope or permission boundaries. This increases the risk of unintended or overly broad agent execution, especially because the skill handles authentication tokens and writes them locally.
The trigger phrases are broad enough to activate this skill for many generic image-generation or poster-related requests, not just requests explicitly intended for ai.fun.tv. Over-broad activation can route users into a workflow that stores tokens, performs network actions, and writes files when a different tool or a safer/manual response would have been more appropriate.
The manifest says this skill should be used for ai.fun.tv image generation and that the default model must be Fun-GP-image2, treating GPT and GPT-image2 as aliases of that same model. However, the code exposes additional unrelated model aliases such as banana, Doubao/即梦, Qwen, and Wan, and passes any normalized model through to task submission, expanding the skill beyond the declared model scope.
The instruction to '直接报告完整响应中的 msg' can force the agent to relay the upstream service's message verbatim, which may be in a specific language or locale regardless of the user's preference. There is no instruction to translate, localize, or ask the user for a language preference before presenting service text.
The manifest states the default model must use Fun-GP-image2 and that GPT/GPT-image2 are aliases for that same model. The argument help text instead says the model may be a 'label, alias, or API value,' which implies arbitrary API model selection and conflicts with the documented constrained model intent.
The only user-facing error messages are hard-coded in Chinese, which imposes a specific language on all users. This is a natural-language locale policy concern because the script does not provide opt-in, fallback, or documentation indicating it is intentionally limited to Chinese-speaking users.