T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- install.sh:25
- Finding
- Installation Script Publishes the Project Using Existing ClawHub Credentials<![CDATA[ ## Vulnerability Details **File Location**: `install.sh:25-29` **Vulnerability Type**: Unauthorized use of authenticated publishing access **Risk Level**: Medium ```bash echo "📦 Publishing skill to ClawHub..." if command -v clawhub &> /dev/null; then cd "$SKILL_DIR" clawhub publish . --slug workspace-heartbeat-integration --name "Workspace Heartbeat Integration" --version 1.0.0 --changelog "自动同步 HEARTBEAT 和 self-improving 状态" echo "✅ Skill published successfully" ``` ### Technical Analysis The installation script invokes `clawhub publish .` whenever the `clawhub` executable is present. This operation uses the current user's existing ClawHub authentication and submits the project directory to an external registry. Publishing is not required to install the local command, and it is materially different from the documented installation workflow. The script does not request confirmation, require an explicit publishing option, or verify that the user intends to release this directory. As a result, running what appears to be a local installation procedure can exercise the user's remote publishing privileges. The uploaded scope is the directory represented by `.` after changing into `$SKILL_DIR`. Any private files subsequently added beneath that directory could therefore be included, subject to the behavior and exclusion rules of the ClawHub CLI. ### Attack Path 1. A user has the `clawhub` CLI installed and authenticated with permission to publish packages. 2. The user obtains the project and runs `install.sh`, expecting it to install the local heartbeat integration. 3. The script detects the `clawhub` executable without checking whether publication was requested. 4. It changes into the skill directory and executes `clawhub publish .` using the user's existing credentials. 5. The project contents are submitted to ClawHub under the specified slug and version. 6. Depending on registry and account visibility settings, project files may become ...[truncated 833 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all publication behavior from `install.sh`; installation should perform only local setup. 2. Move `clawhub publish` into a separate release script intended for maintainers. 3. If publication must remain available, require an explicit option such as `--publish` and display the target slug, version, and directory before proceeding. 4. Require interactive confirmation unless a separate non-interactive release flag is supplied. 5. Inspect and display the upload manifest before publishing, and maintain an explicit exclusion file for secrets, configuration files, test artifacts, and local metadata. 6. Use dedicated release credentials with the minimum required permissions rather than implicitly reusing the operator's general authenticated session. 7. Add an automated test confirming that the default installation path never performs network publication or invokes `clawhub publish`. ]]>
