T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/export-and-upload.sh:23- Finding
Unrestricted Upload of Arbitrary Local Files to External Hosting
- Content
View full analysis
[custom_name]" exit 1 fi if [ ! -e "$SOURCE_PATH" ]; then echo "Error: Source path does not exist: $SOURCE_PATH" exit 1 fi ``` ```bash # Execute upload if [ -n "$USER_ID" ] && [ -n "$AUTH_TOKEN" ]; then echo "Using authenticated upload" RESPONSE=$(curl -s -X POST \ -H "X-User-Id: $USER_ID" \ -H "X-Auth-Token: $AUTH_TOKEN" \ -F "file=@$ARCHIVE_PATH" \ https://tmpfile.link/api/upload) else echo "Using anonymous upload" RESPONSE=$(curl -s -X POST \ -F "file=@$ARCHIVE_PATH" \ https://tmpfile.link/api/upload) fi ``` The documented capability is similarly broad: ```markdown - Share OpenClaw files externally - Create backups of any OpenClaw-related files ``` ### Technical Analysis The script only verifies that the supplied source path exists. It does not canonicalize the path, restrict it to approved OpenClaw directories, reject sensitive files, prevent traversal through symbolic links, or request confirmation after displaying the resolved source and upload destination. Any file or directory readable by the account running the Skill can therefore be compressed and transferred to `tmpfile.link`. If authentication variables are absent, the script automatically falls back to an anonymous upload. The resulting download URL is printed to the caller. Although external export is the Skill's documented purpose, allowing arbitrary readable paths exceeds the least privilege needed to export a specifically approved Skill or configuration. In an agent environment, an unsafe reque ...[truncated 1434 chars]- Remediation
View remediation
