T09 · Insecure Skill Coding Practices
- Location
SKILL.md:137- Finding
Overly Broad Temporary-Directory Allowlisting Recommendation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:137-139;references/feishu-file-sending-notes.md:57-60
Vulnerability Type: T09: Insecure Skill Coding Practices
Risk Level: MediumVulnerable Snippets:
SKILL.md:137-139markdown If dynamic files are commonly generated under `/tmp/`, consider adding `/tmp` to Feishu `mediaLocalRoots` in `~/.openclaw/openclaw.json` and restart gateway. 如果经常生成临时文件,可在配置中将 `/tmp` 加入飞书渠道的 `mediaLocalRoots` 白名单,然后重启 gateway。references/feishu-file-sending-notes.md:57-60markdown ## 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 the shared
/tmpdirectory tomediaLocalRoots. This broadens the set of local files that the Feishu attachment mechanism is permitted to access and conflicts with the principle of least privilege.A shared temporary directory can contain files created by unrelated users or processes. Depending on the gateway's path-validation implementation, it may also contain attacker-controlled symbolic links or other filesystem objects that resolve to files outside the intended outbound-file workspace. Treating every path beneath
/tmpas eligible media therefore creates a path-confusion and unintended-file-disclosure risk.The project does not itself implement automatic file collection, credential access, or exfiltration. Exploitation requires the gateway configuration to adopt this recommendation and a subsequent attachment operation to reference attacker-influenced content.
Attack Path
- An administrator follows the documented recommendation and adds
/tmpto FeishumediaLocalRoots. - A local attacker or another process creates a file in
/tmp, or places a symbolic link there that targets a file readable by the gateway proce ...[truncated 1062 chars]
- An administrator follows the documented recommendation and adds
- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to add the entire
/tmpdirectory tomediaLocalRoots. - Create a dedicated outbound directory, such as
~/.openclaw/workspace/outbound, owned by the gateway account and inaccessible to unrelated users. - Configure
mediaLocalRootswith only that dedicated directory. - Copy generated attachments into the dedicated directory using securely generated, non-predictable filenames.
- Before transmission, resolve the canonical path and verify that it remains beneath the approved root.
- Reject symbolic links and non-regular files, and verify expected ownership and restrictive permissions.
- Where temporary storage is unavoidable, use a private per-process or per-user directory with mode
0700rather than shared/tmp. - Delete staged outbound files after delivery according to an explicit retention policy.
- Update both affected documentation files so that troubleshooting guidance consistently preserves least-privilege filesystem access.
- Remove the recommendation to add the entire
