T09 · Insecure Skill Coding Practices
- Location
references/advanced.md:40- Finding
Shell Command Injection Through Attacker-Controlled Filenames
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Cloudflare R2 upload skill is not malicious, but it needs review because its instructions can publish local or URL-fetched content with too little scoping and include unsafe shell examples.
Install only if you are comfortable with an agent using your Wrangler login to write to R2. Before any upload, confirm the exact local path, destination bucket/path, and whether the object will be public; avoid home-directory searches, broad globs, and URL imports from untrusted sources. Do not use the concurrent xargs example as written.
references/advanced.md:40Shell Command Injection Through Attacker-Controlled Filenames
SKILL.md:48Server-Side Request Forgery and Data Disclosure Through Unrestricted URL Uploads
references/error-handling.md:61Predictable Temporary File Permits Symlink Attacks
SKILL.md:21Overbroad Home-Directory Search Can Select and Upload Unintended Sensitive Files
The trigger phrases include generic terms like '上传' and '存储', which can match ordinary file-handling requests not specifically meant for Cloudflare R2. This raises the risk of accidental activation, causing unintended remote upload of local files or disclosure of public URLs when the user only asked for local handling or another storage target.
The skill centers on uploading local files to remote R2 storage and returning a public URL, but it provides no user-facing warning about off-device transmission or public exposure. In an agent setting, this can lead to inadvertent exfiltration of sensitive local data or publication of files the user did not intend to expose.
The direct-from-URL flow fetches third-party content with curl and immediately writes it into the user's R2 bucket, without warning about relaying external content into their storage. This can result in storage abuse, ingestion of malicious or illegal content, or unexpected cost and compliance issues if a user supplies or is tricked into supplying an untrusted URL.
The skill is described as upload-focused, but it also documents bucket enumeration and object deletion commands. Expanding capability beyond the declared purpose increases the chance an agent could perform destructive or discovery actions a user did not intend, especially if invoked under a broad upload-related trigger context.
The examples perform bulk uploads of local files to a remote Cloudflare R2 bucket using broad file globs and directory iteration, but provide no warning that all matched files will be transmitted off-host. In an agent skill context focused on uploading, this increases the chance of accidental exfiltration of unintended files, especially if users or downstream agents run the snippets with an overbroad directory or bucket variable.
The concurrent upload example discovers files automatically with find and uploads them in parallel to a remote bucket, which can rapidly exfiltrate a large set of local files if run from the wrong directory or with a broader pattern than intended. The lack of any caution, dry-run step, or scope validation makes accidental bulk transfer more dangerous in this skill because the surrounding purpose is to automate remote file upload.
The title and all operational guidance are written in Chinese, with no indication that the user can choose another language or that the document is intentionally limited to a Chinese-speaking audience. Under the stated policy, forcing a specific language without opt-in is a natural-language policy issue.