T09 · Insecure Skill Coding Practices
- Location
references/feishu-file-sending-notes.md:57- Finding
Overly Broad Temporary Directory Media Allowlist Recommendation
- Content
View full analysis
Vulnerability Details
File Location:
references/feishu-file-sending-notes.md, lines 57–60
Vulnerability Type: Unsafe local file access configuration
Risk Level: MediumComplete Snippet:
markdown ## Suggested config direction If dynamic files are commonly generated under `/tmp/openclaw/`, consider adding `/tmp/openclaw` or `/tmp` to Feishu `mediaLocalRoots` and restart the gateway.Technical Analysis
The documentation recommends adding either
/tmp/openclaw/or the entire system-wide/tmpdirectory to Feishu'smediaLocalRoots. Allowlisting/tmpviolates least-privilege principles because it makes a shared temporary directory eligible as a source for outbound attachments.On multi-process or multi-user systems,
/tmpmay contain files created by unrelated applications or users. Broadly authorizing this directory increases the chance that an unintended, attacker-controlled, or sensitive temporary file can be transmitted through Feishu. The risk may also be increased by symlinks or path-resolution weaknesses if the gateway does not canonicalize paths and reject symbolic-link traversal.This recommendation is unnecessary because
SKILL.md, lines 43–46, already describes a safer procedure: copy only the intended file into a dedicated allowed workspace before sending it.Attack Path
- An administrator follows the documented recommendation and adds
/tmptomediaLocalRoots. - An unrelated application, local attacker, or compromised process creates or identifies a sensitive or misleading file under
/tmp. - The Agent receives a malicious, ambiguous, or mistaken instruction to send that path as a Feishu attachment.
- Because
/tmpis allowlisted, the gateway accepts the file as an authorized media source. - The file is transmitted to a Feishu user or group, resulting in unauthorized disclosure.
Exploitability depends on the gateway's path canonicalization, symlink handl ...[truncated 560 chars]
- An administrator follows the documented recommendation and adds
- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to add the system-wide
/tmpdirectory tomediaLocalRoots. - Create a dedicated media staging directory, such as
~/.openclaw/workspace/outbound-media/, accessible only to the gateway account. - Copy only the explicitly requested file into that directory before transmission.
- Resolve and validate the canonical path before sending, and ensure it remains beneath the approved staging root.
- Reject symbolic links and paths containing traversal components.
- Apply restrictive directory and file permissions.
- Generate unpredictable staged filenames to prevent collisions and substitution.
- Delete staged files after successful delivery or after a short retention period.
- If a temporary directory is operationally required, use a private per-service directory with restrictive permissions rather than the shared
/tmproot.
- Remove the recommendation to add the system-wide
