T09 · Insecure Skill Coding Practices
- Location
scripts/skin.py:193- Finding
User-Controlled Output Name Allows File Creation Outside the Designated Directory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does what it says by uploading a chosen skin photo to WiseDiag, but it should be reviewed because it handles sensitive health images and can write reports outside its advertised output folder.
Install only if you are comfortable sending skin photos and related questions to WiseDiag's cloud service. Prefer a temporary environment variable for the API key, verify WiseDiag's privacy policy independently, avoid passing untrusted --name or --output values, and consider pinning dependencies plus constraining output filenames before broader use.
scripts/skin.py:193User-Controlled Output Name Allows File Creation Outside the Designated Directory
requirements.txt:1Unbounded Dependency Version Prevents Reproducible and Reviewed Installations
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
request_part = ("request", (None, json.dumps(request_data, ensure_ascii=False), "application/json"))
file_part = ("files", (p.name, fh, _mime(p.name)))
with requests.post(
url, headers=headers, files=[request_part, file_part],
stream=True, timeout=REQUEST_TIMEOUT,
) as resp:
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
export WISEDIAG_API_KEY=your_api_key_here
echo 'export WISEDIAG_API_KEY=your_api_key_here' >> ~/.zshrc source ~/.zshrc
The skill advertises capabilities that include reading environment variables, writing files, and making network requests, but it does not declare an explicit tool scope such as permissions or allowed-tools. This creates an authorization and transparency gap: an agent may invoke the skill without clear restrictions, while the skill can exfiltrate local image data and use API credentials to contact an external service. In this context, the risk is heightened because the skill handles sensitive medical images and sends them to a remote cloud endpoint.
The request payload hard-codes the language field to "zh", which enforces a specific locale regardless of user preference. The file does not offer a language choice or explain that the tool is intentionally limited to Chinese-only operation, so this is a natural-language locale policy concern.
The skill uploads a user-selected local skin image to an external medical AI API, but the code provides no explicit consent or privacy warning at the point of transmission. Because skin photos may contain sensitive health information and metadata, users may not realize that local files are leaving the device and being processed by a third party.
The dependency is specified as requests>=2.28.0, which allows any newer version to be installed and makes builds non-reproducible. This can unintentionally pull in vulnerable or breaking releases over time, and in a skill that uploads local image data to an external AI service, dependency drift increases supply-chain and reliability risk.
requests>=2.28.0
The manifest does not pin the requests version, so it is impossible to verify whether the installed package includes fixes for known advisories affecting some releases. In this skill context, the package will likely handle outbound HTTP requests for image upload/analysis, so using an affected version could expose request metadata, credentials, or TLS verification behavior depending on the runtime-resolved release.