T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/image-edit.sh:85
- Finding
- Undisclosed Upload of Local Images to a Third-Party Temporary Hosting Service<![CDATA[ ## Vulnerability Details **File Location**: `scripts/image-edit.sh`, lines 85-98 **Vulnerability Type**: Undisclosed third-party data disclosure **Risk Level**: Medium ### Vulnerable Code ```bash if [[ -f "$SOURCE" ]]; then # Local file: upload to temp host to get a URL, then use GET endpoint # (Pollinations image API is GET-only, no POST support) echo "Uploading local file to temporary host..." TEMP_URL=$(curl -s -F "reqtype=fileupload" -F "time=1h" -F "fileToUpload=@$SOURCE" https://litterbox.catbox.moe/resources/internals/api.php) if [[ -z "$TEMP_URL" || ! "$TEMP_URL" =~ ^https?:// ]]; then echo "Error: Failed to upload local file. Please provide a URL instead." echo "Example: image-edit.sh \"$PROMPT\" --source https://example.com/image.jpg" exit 1 fi echo "Uploaded: $TEMP_URL" SOURCE="$TEMP_URL" fi ``` ## Technical Analysis When a local image is supplied to the image-editing script, the file is uploaded to `litterbox.catbox.moe` before Pollinations processes it. The primary documentation states that local files are accepted but does not clearly disclose that local images will be transferred to an additional temporary hosting provider. The script's usage message at line 72 also states that local files are uploaded to `0x0.st`, while the implemented destination is Litterbox. This discrepancy prevents users from accurately identifying the external party receiving their data. The returned URL is accepted when it merely begins with `http://` or `https://`. The script does not verify that the returned hostname belongs to the expected service, does not require HTTPS, and does not provide an explicit consent checkpoint before uploading potentially sensitive content. ### Attack Path 1. A user or agent invokes `scripts/image-edit.sh` with a local image through the `--source` option. 2. The script recognizes the argument as an existing local file. 3. The file is uploaded in full to `https://litterbox.catbox.moe/resources/ ...[truncated 935 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Prefer a direct authenticated upload to Pollinations rather than using a public temporary hosting service. 2. If third-party hosting is unavoidable, obtain explicit user consent before every upload and clearly identify: - The exact service receiving the file. - Whether the resulting URL is public. - The expected retention period. - Any applicable privacy policy. 3. Correct the inaccurate `0x0.st` statement so that documentation and runtime help identify the actual destination. 4. Require an HTTPS response URL and validate its parsed hostname against an explicit allowlist. 5. Reject redirects to unapproved hosts by applying an appropriate redirect policy. 6. Validate file type and size before upload and reject files outside the documented image formats. 7. Avoid printing the complete hosted URL where logs could expose access to the uploaded image. 8. Provide a mode that rejects local files and requires users to supply a URL under their own control. ]]>
