T09 · Insecure Skill Coding Practices
- Location
references/channel-adapters.md:20- Finding
Predictable Shared Temporary File Exposes Outreach Content to Symlink and Collision Attacks
- Content
View full analysis
/tmp/outclaw_msg.txt` 2. Draft (non-trust mode): `gog gmail drafts create --to "" --subject "" --body-file /tmp/outclaw_msg.txt -j` 3. Send (trust mode): `gog gmail send --to "" --subject "" --body-file /tmp/outclaw_msg.txt -j` 4. Capture `id` and `threadId` from the JSON response for response detection ``` The main Skill instructions also use fixed shared paths: ```text /tmp/outclaw-plan-draft.md /tmp/outclaw-reply.md ``` The validation workflow reads these same predictable paths: ```bash python3 ~/.openclaw/skills/outclaw/shared/scripts/channel_validator.py \ --from-file /tmp/outclaw-plan-draft.md --format human python3 ~/.openclaw/skills/outclaw/shared/scripts/draft_checker.py \ --from-file /tmp/outclaw-plan-draft.md --format human ``` ### Technical Analysis The Skill instructs the Agent to place prospect details and outbound email content in globally predictable files under `/tmp`. It does not require: - Exclusive file creation; - A private temporary directory; - Restrictive file permissions; - Symbolic-link checks; - File ownership verification; - Unique paths for concurrent campaigns; - Guaranteed deletion after use. The shell redirection in: ```bash printf '%s' "$body" > /tmp/outclaw_msg.txt ``` follows symbolic links. If another local process creates `/tmp/outclaw_msg.txt` as a symbolic link before the command runs, the Agent can overwrite the link target with the privileges of the Agent process, provided that account can write to the target. The fixed filename also creates a time-of-check/time- ...[truncated 2608 chars]- Remediation
View remediation
"$body_file" ``` 8. Delete temporary files immediately after the corresponding draft, validation, or send operation. Retain the cleanup trap as a fallback for failures and interruptions. 9. Add concurrency tests that run multiple campaigns simultaneously and verify that no message body, plan, or validation result crosses campaign boundaries. 10. Add a symlink regression test that pre-creates the historical fixed paths and confirms that the Skill refuses to write through them. ]]>
