T09 · Insecure Skill Coding Practices
- Location
setup.md:61- Finding
Incorrect Path Causes Unintended Permission Modification
- Content
View full analysis
Vulnerability Details
File Location:
setup.md, lines 61–65
Vulnerability Type: Incorrect permission target caused by a path typo
Risk Level: Mediumbash mkdir -p ~/Clawic/data/discover/{findings,archive} touch ~/Clawic/data/discover/{memory.md,watchlist.md,heartbeat-state.md} chmod 700 ~/discover ~/Clawic/data/discover/findings ~/Clawic/data/discover/archive chmod 600 ~/Clawic/data/discover/{memory.md,watchlist.md,heartbeat-state.md}Technical Analysis
The documented state root is consistently
~/Clawic/data/discover/, but thechmod 700command targets~/discoverinstead of that root. The unrelated path is not created or otherwise used by this skill.If
~/discoveralready exists, running the setup block changes its permissions without a legitimate need. At the same time, the intended~/Clawic/data/discover/root does not receive mode700and may retain permissions inherited from the parent directory or the user'sumask.This is an insecure configuration practice involving an incorrect access-control target. It does not grant the skill elevated operating-system privileges, but it can unexpectedly alter access to unrelated user-owned content and leave the actual state root less restricted than intended.
Attack Path
- A user approves initialization of the discovery skill.
- The user or agent executes the setup commands from
setup.md. - The shell expands
~/discoverto an unrelated path in the current user's home directory. - If that path exists and is owned by the executing user, its mode is changed to
700. - Group and other users who previously had legitimate access can no longer access that directory.
- Meanwhile,
~/Clawic/data/discover/does not receive the intended explicit directory permissions.
Exploitation requires the setup block to be executed and an existing, user-modifiable
~/discoverpath. The effect is limited by the privileges of the account ...[truncated 609 chars]- Remediation
View remediation
Remediation Suggestions
Replace the incorrect permission command with one that targets the documented state root:
bash chmod 700 ~/Clawic/data/discover \ ~/Clawic/data/discover/findings \ ~/Clawic/data/discover/archiveRetain restrictive permissions for the state files:
bash chmod 600 ~/Clawic/data/discover/{memory.md,watchlist.md,heartbeat-state.md}For additional hardening:
- Resolve and validate the intended state path before modifying permissions.
- Avoid applying
chmodto paths not created or explicitly managed by the setup procedure. - Use a restrictive creation mask such as
umask 077before creating state directories and files. - Fail safely if the target resolves outside
~/Clawic/data/discover/. - Add a setup test that verifies every permission target is beneath the documented state root.
A hardened setup sequence would be:
bash umask 077 mkdir -p ~/Clawic/data/discover/{findings,archive} touch ~/Clawic/data/discover/{memory.md,watchlist.md,heartbeat-state.md} chmod 700 ~/Clawic/data/discover \ ~/Clawic/data/discover/findings \ ~/Clawic/data/discover/archive chmod 600 ~/Clawic/data/discover/{memory.md,watchlist.md,heartbeat-state.md}
