T09 · Insecure Skill Coding Practices
- Location
scripts/linux/sync-all.sh:59- Finding
Dry-Run Request Fails Open into a Real Bulk Synchronization
- Content
View full analysis
&2 fi echo ">> clawhub ${args[*]}" clawhub "${args[@]}" ``` ### Technical Analysis When the user explicitly supplies `--dry-run`, the script first checks whether the installed ClawHub CLI advertises support for that option. If capability detection fails, the script only prints a warning and continues without adding `--dry-run`. The capability check can return false either because the CLI genuinely lacks the option or because the local `grep` utility is unavailable. In both cases, an operation requested as a non-mutating preview becomes the mutating command `clawhub sync --all`. This is a fail-open safety-control implementation. It also contradicts the package's documented “safe by default” design principle. Because synchronization is a bulk publishing operation, the omitted flag changes the security semantics of the command rather than merely dropping optional metadata. ### Attack Path 1. A user invokes `sync-all.sh --dry-run` to inspect what would be uploaded. 2. The installed CLI does not advertise `--dry-run`, or capability detection fails. 3. The script warns that it will run without dry-run but does not require confirmation or terminate. 4. The argument array remains `sync --all`. 5. The script executes `clawhub sync --all`. 6. Local skill content within the CLI's synchronization scope may be uploaded to ClawHub. ### Impact Assessment An authenticated user may unintentionally publish multiple local skill folders. The operation runs with the invoking user's existing filesystem access and ClawHub account permissions; it does not obtain elevated operating-system pri ...[truncated 406 chars]- Remediation
View remediation
&2 exit 1 fi fi ``` - Treat capability-detection failures separately from unsupported options. Explicitly report when required utilities or CLI help output are unavailable. - Never silently weaken a user-requested safety control. - If non-dry execution is still needed, require a separate explicit option such as `--allow-without-dry-run`. - Add a confirmation step before bulk publication when running interactively. - Perform a local preflight scan for common secrets and sensitive files before any real synchronization. - Add automated tests proving that `--dry-run` never invokes a mutating synchronization when the option is unavailable. ]]>
