T09 · Insecure Skill Coding Practices
- Location
scripts/nohup-reminder.sh:210- Finding
Predictable Temporary Message File Allows Symlink Clobbering
- Content
View full analysis
"$msg_file") ``` ### Technical Analysis The temporary message path is constructed using a workspace checksum and a sequential reminder ID. It is therefore predictable to a local attacker who can determine or guess those values. The shell redirection operator used by: ```bash printf '%s' "$text" > "$msg_file" ``` follows an existing symbolic link. Although `umask 077` protects the permissions of a newly created file, it does not provide exclusive creation and does not prevent symbolic-link traversal. If an attacker creates the expected path as a symbolic link before the reminder is added, the script can truncate and overwrite the linked destination. Exploitation is restricted to files writable by the account running the skill; this issue does not independently bypass operating-system file permissions. ### Attack Path 1. A local attacker determines or predicts `WORKSPACE_KEY`, which is derived from a checksum of the reminder-store path. 2. The attacker determines or guesses the next sequential reminder ID. 3. The attacker creates a symbolic link such as `/tmp/oclaw-rem--.msg` pointing to a file writable by the OpenClaw user. 4. The user creates the corresponding reminder. 5. The script opens the predictable path using ordinary shell redirection. 6. The operating system follows the symbolic link, truncating the destination and writing the reminder text into it. ### Impact Assessment A successful attack can overwrite or corrupt arbitrary files writable by the OpenClaw account. Depending on the se ...[truncated 396 chars]- Remediation
View remediation
"$msg_file" ``` Where available, the implementation should additionally validate ownership and permissions of the runtime directory before using it. ]]>
