T09 · Insecure Skill Coding Practices
- Location
scripts/qweather.sh:36- Finding
Unvalidated API Host Can Receive QWeather Authentication Tokens
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent QWeather helper, but it needs review because it handles API credentials and can send or cache bearer tokens without enough safeguards.
Review before installing. Use only a QWeather API host copied from the official console, keep the private key and local/ directory owner-readable only, do not commit local files, and be aware that setup and tests make network requests and create local state.
scripts/qweather.sh:36Unvalidated API Host Can Receive QWeather Authentication Tokens
scripts/gen-jwt.mjs:49JWT Cache File Is Written Without Explicit Restrictive Permissions
Referenced artifact was not completely inspected
- JWT(Ed25519),通过 `scripts/gen-jwt.mjs` 生成,支持 token 缓存(`local/jwt-cache.json`)
Referenced artifact was not completely inspected
- JWT(Ed25519),通过 `scripts/gen-jwt.mjs` 生成,支持 token 缓存(`local/jwt-cache.json`)
The skill advertises and instructs use of shell, network, and environment-backed capabilities, but it does not declare any explicit tool scope or permission boundaries. This makes the operational trust boundary unclear and can allow an agent runtime to invoke powerful capabilities more broadly than a user would reasonably expect.
The operational instructions for the skill are presented in Chinese and direct the agent behavior in that language, but there is no indication that the user can choose another language or that the locale restriction is intentional for a region-specific compliance reason. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.
The first-run flow tells the agent to automatically create files, generate keys, and execute shell scripts, but it does not require a clear consent checkpoint for filesystem writes and command execution. In practice, this can lead to surprising local changes, script execution, or persistence actions before the user fully understands the side effects.
The script caches a live JWT bearer token in a predictable local file under ../local/jwt-cache.json without any access-control hardening, encryption, or warning to the operator. If that directory is readable by other local users, accidentally committed, included in logs/backups, or exposed by tooling, the token can be reused until expiry to access the QWeather API as the project.
The script's prompts are entirely in Chinese and the API connectivity test explicitly sets lang=zh, which forces a specific language/locale. This is a natural-language policy issue because no user opt-in or configurable language choice is provided in the file.
The script defaults to a Chinese city name and later forces lang=zh in API requests while all user-facing help and output strings are in Chinese. This is a natural-language locale constraint with no user opt-in or language selection mechanism, which fits the language/locale policy violation category.
The inline comment is written in Chinese (还剩 60 秒以上才复用) while the rest of the script and user-facing messages are in English. This imposes a locale choice in natural-language content without offering user choice or documenting a justified region-specific constraint.
The inline comment is written in Chinese (1 小时有效期) while the surrounding code and messages are in English. This creates a natural-language locale inconsistency that effectively forces one language without opt-in or justification.
This code performs outbound HTTP requests with a bearer token and user-supplied city/location data via curl, but the script provides no visible notice, prompt, or comment warning users that their query will be sent to a remote weather service. For code files, network calls that transmit user or system data should have some form of disclosure unless clearly covered elsewhere, and no such warning is present in this file.
This shell script emits user-facing status messages and test descriptions entirely in Chinese, which imposes a specific language on users without any opt-in or stated regional justification. The policy explicitly calls for flagging language or locale constraints when they are forced rather than optional or documented as region-specific.
No suspicious patterns detected.