T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- SKILL.md:249
- Finding
- Excessive External Repository Access Through Organization-Wide GitHub App Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 249–264 **Vulnerability Type**: Excessive repository permissions and external disclosure risk **Risk Level**: High ### Vulnerable Code ```bash # Create GitHub App (one time) clawhub code-reviewer create-app \ --name "Code Reviewer" \ --webhook-url "https://api.clawhub.com/webhooks/github" \ --permissions "contents=read, pull_requests=write" # Install on repositories clawhub code-reviewer install \ --app-id 12345 \ --repo github.com/yourorg/yourrepo # Or install on all org repos clawhub code-reviewer install-org \ --org yourorg \ --app-id 12345 ``` ### Technical Analysis The documented setup sends GitHub webhook events to an external Clawhub endpoint and grants the associated GitHub App `contents=read` and `pull_requests=write` permissions. Read access to repository contents is relevant to code review, while pull-request write access is needed to publish review results. However, the organization-wide installation option expands those privileges to every repository available through the installation rather than limiting access to repositories that require automated review. The documentation also advertises support for private repositories but does not describe repository allowlisting, webhook payload minimization, source-code retention, encryption, deletion procedures, access logging, or tenant-isolation controls. Consequently, users are instructed to establish a broad trust relationship with an external service without corresponding data-handling safeguards. This is a least-privilege violation when organization-wide installation is used unnecessarily. The risk arises from the combination of sensitive source-code access, pull-request modification privileges, an external network destination, and a potentially organization-wide scope. ### Attack Path 1. An administrator follows the documented setup and creates the GitHub App. 2. The administrator configures `https://api. ...[truncated 1340 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Make selected-repository installation the default and remove organization-wide installation from the quick-start path. - Require explicit administrator confirmation before enabling access to all organization repositories or any private repository. - Separate analysis from mutation privileges where possible. Use a read-only app for analysis and request pull-request write access only when review publication is enabled. - Apply the narrowest available GitHub permissions and document why each permission is necessary. - Document exactly which webhook events and fields are transmitted to the external service. - Minimize webhook payloads and avoid transmitting full file contents unless analysis explicitly requires them. - Publish source-code retention, encryption, tenant-isolation, access-control, deletion, incident-response, and audit-log policies. - Support customer-controlled or on-premises processing for sensitive repositories. - Provide repository allowlists and prevent automatic expansion of access when new organization repositories are created. - Recommend periodic review and revocation of inactive app installations and credentials. ]]>
