T09 · Insecure Skill Coding Practices
- Location
scripts/download.py:39- Finding
Authentication Cookie Exposure Through Command-Line Arguments and Redirectable Requests
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real pic.netbian.com wallpaper downloader, but it handles a logged-in browser cookie in a risky way and includes opt-in permanent file deletion.
Review before installing. Only run this if you are comfortable using a logged-in pic.netbian.com session cookie; avoid placing real session cookies directly in shell commands or shared logs. Check the output directory carefully before using --delete, because it permanently removes non-matching JPG files.
scripts/download.py:39Authentication Cookie Exposure Through Command-Line Arguments and Redirectable Requests
scripts/download.py:60Unbounded Response Reads and Out-of-Bounds JPEG Metadata Parsing
The code substantially aligns with the core declared purpose: it targets pic.netbian.com, scans the mobile wallpaper category by default, uses a token-based download endpoint, applies a default 180-second interval, and validates image resolution before saving. However, two materially described capabilities are not present in the code. First, the declared description explicitly includes a WeChat QR login flow, but the script has no login automation at all and only requires the user to pass an existing cookie. Second, the description says it performs cleanup of non-4K files, but the implementation merely skips saving images whose detected width is below the threshold; it does not remove previously downloaded files or perform directory cleanup. Because these are explicit advertised features absent from the implementation, this is a description-behavior mismatch.
The declared description presents a site-specific wallpaper downloader with authentication, download, rate-limiting, and verification features. The supplied code does not perform any network access, login, token handling, or downloading. It only validates JPEG width in a local directory and optionally deletes files that do not meet a minimum width threshold. While the cleanup/non-4K verification aspect partially overlaps with the description, the primary purpose and major capabilities described are absent, so this is a clear mismatch.
The skill describes workflows that require network access and reading browser-derived cookie data, but it declares no explicit tool scope or permissions boundary. That creates an authorization ambiguity where an agent may invoke broader-than-intended capabilities without clear user or platform controls, increasing the chance of unintended data access or network actions.
The script requires a user-supplied authenticated cookie and sends it in outbound requests, but it provides no warning about the sensitivity of that credential, its account scope, or the risks of exposing it via command-line arguments. Passing cookies on the CLI can leak them through shell history, process listings, logs, or orchestration tooling, which could enable account/session hijacking if the cookie is reused.
When --delete is provided, the script permanently removes files via os.remove(f). Although the docstring and argument help mention deletion, there is no confirmation prompt or explicit user warning about the irreversible nature of the action before files are deleted.
All user-facing documentation and runtime messages in this script are written exclusively in Chinese, with no option or note allowing users to select another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless clearly justified as region-specific.
The docstring and CLI help text are presented in Chinese only, which is a natural-language locale choice embedded in the skill. Under the policy, forcing a specific language without user opt-in can be a language or locale policy violation.