T09 · Insecure Skill Coding Practices
- Location
vision_ai.py:17- Finding
Untrusted Parent-Directory Module Import Can Execute External Code and Control API Routing
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This image-recognition skill mostly matches its stated purpose, but it relies on an unbundled parent-directory Python config that can run code and redirect API uploads.
Review this before installing. Use a virtual environment, pin dependencies, and do not use API mode for sensitive images unless you accept third-party upload. The parent-directory llm_config dependency should be bundled or replaced with inert validated config before trusting API keys or uploads, and batch mode should only be run on directories you intentionally selected.
vision_ai.py:17Untrusted Parent-Directory Module Import Can Execute External Code and Control API Routing
vision_ai.py:63Extension-Only Image Validation Allows Arbitrary File Content to Be Uploaded
The skill metadata does not declare any tool scope or allowed-tools restrictions, yet the skill references executable code capabilities via a Python script and the analyzer detected shell-capable behavior. Without explicit permission boundaries, an agent may invoke broader tools than intended, increasing the risk of unintended command execution or misuse of local resources. In this context, the skill handles files, optional network APIs, and local model downloads, which makes missing scope controls more meaningful than in a purely descriptive skill.
The natural-language content of the skill, including the description, usage, troubleshooting, and warnings, is entirely in Chinese. This can amount to a language/locale policy issue because the file does not provide user opt-in, alternative language support, or a justified region-specific constraint.
The top-level documentation states this is a safe tool for image and video recognition. In practice, the validator only permits JPEG/PNG/WEBP/GIF images, and all analysis paths assume still-image inputs with no video decoding or frame extraction. This is an active contradiction between documentation and actual behavior.
In API mode, the tool base64-encodes user-supplied images and sends them to third-party model providers, but it does not provide a clear privacy notice or obtain explicit consent at the point of transfer. This can lead to unintentional disclosure of sensitive local images, especially because the skill is presented as a 'safe' image-recognition tool and users may assume processing is local.
The Anthropic path uploads image content to an external API without any explicit user notice or confirmation in the workflow. If users analyze personal, regulated, or confidential images, this can cause unintended data exposure to a third party and create compliance or privacy issues.
The user-facing comments and prompts in this installer are entirely in Chinese, including the installation wizard and interactive questions. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.
This requirements file contains natural-language comments only in Chinese, such as the header and dependency mode descriptions. That imposes a specific language/locale in the skill's visible text without any indication that users can choose another language, which matches the language-policy concern for natural-language content.
Using a lower-bound specifier like Pillow>=10.0.0 allows installation of any future release, which makes builds non-reproducible and can silently introduce vulnerable or breaking versions through the supply chain. In a vision-processing skill, Pillow is security-relevant because it parses untrusted image files, so dependency drift increases exposure to parser bugs and potential code execution or denial-of-service issues.
# AI视觉识别技能依赖
# 核心依赖
Pillow>=10.0.0
# API模式(推荐,功能更强大)
openai>=1.0.0
Pillow has multiple known advisories, and because the manifest does not pin an exact version, it is impossible to verify whether deployed environments will resolve to a fixed or affected release. This is particularly relevant here because the skill performs image recognition, meaning Pillow is likely to process attacker-controlled image inputs and is therefore on the direct attack path.
openai>=1.0.0 is unpinned, so environments may resolve to different SDK releases over time, reducing reproducibility and potentially pulling in a version with newly introduced security issues or unsafe defaults. The direct security impact is lower than image/model parsing libraries because this is primarily an API client, but supply-chain and behavior drift risks still exist.
Pillow>=10.0.0
# API模式(推荐,功能更强大)
openai>=1.0.0
anthropic>=0.18.0
# 本地模式(可选,无需API但需要下载模型)
anthropic>=0.18.0 permits uncontrolled upgrades, which can introduce vulnerable SDK versions or changed security behavior without review. Because API SDKs may handle credentials, filesystem interaction, and local tooling, version drift can affect confidentiality and local environment safety.
# API模式(推荐,功能更强大)
openai>=1.0.0
anthropic>=0.18.0
# 本地模式(可选,无需API但需要下载模型)
torch>=2.0.0
The Anthropic SDK has published advisories, and without exact version pinning the installed version cannot be verified as unaffected. The context is somewhat less dangerous than image/model parsers because this is an SDK dependency, but it may still touch credentials, local files, or tool interfaces depending on usage.
torch>=2.0.0 is unpinned, allowing arbitrary newer versions to be installed, which is risky for a local-model skill because PyTorch has a history of issues around deserialization, model loading, and denial of service. In this context, local inference stacks often process downloaded models and complex binary formats, so dependency drift materially increases attack surface.
anthropic>=0.18.0
# 本地模式(可选,无需API但需要下载模型)
torch>=2.0.0
transformers>=4.30.0
PyTorch has several serious advisories, and the lack of version pinning means the security posture of the actual installed dependency is unverifiable. In a local vision model workflow, this is more dangerous because PyTorch may load models, tensors, and serialized artifacts from external sources, placing it directly in a high-risk execution path.
transformers>=4.30.0 allows uncontrolled upgrades of a library that commonly downloads, parses, and executes model-related logic across many formats and integrations. In a vision AI skill using local models, this makes the context more dangerous because compromised or vulnerable releases could affect model loading, prompt/template processing, or temporary-file handling.
# 本地模式(可选,无需API但需要下载模型)
torch>=2.0.0
transformers>=4.30.0
Transformers has multiple known advisories, and since the manifest does not pin a version, there is no assurance that installations avoid affected releases. This is especially relevant in a vision AI skill that may download models or preprocess untrusted artifacts, making the library part of a sensitive attack surface.
文件中的标题、CLI输出及默认提示词均固定为中文,例如默认分析提示和交互文案都未提供其他语言选项。根据规则,强制特定语言而没有用户选择或明确的地域性说明,属于语言/locale策略问题。
The manifest description presents the skill as a picture-recognition tool supporting local and API modes, which implies analyzing supplied images. However, the implementation adds broader filesystem traversal via batch directory enumeration, recursively discovering files under a directory rather than only analyzing explicitly provided images. This expands behavior beyond the narrowly described single-image recognition role.
No suspicious patterns detected.