T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- scripts/github-permissions.json:24
- Finding
- Overprivileged GitHub Token Guidance Violates the Read-Only Security Model## Vulnerability Details **File Location**: `SKILL.md:19-21`, `SKILL.md:55`, and `scripts/github-permissions.json:15-16,24-25` **Vulnerability Type**: Excessive GitHub token permissions **Risk Level**: Medium ### Vulnerable Code and Configuration `SKILL.md:19-21`: ```markdown ## Prerequisites - GitHub personal access token with read-only permissions (or classic token with `repo`, `read:org`, `security_events`) - Set as `GITHUB_TOKEN` environment variable ``` `SKILL.md:55`: ```markdown **Classic token alternative:** If fine-grained tokens unavailable, use scopes: `repo`, `read:org`, `security_events` ``` `scripts/github-permissions.json:15-16`: ```json "code_scanning_alerts": {"access": "read", "reason": "Code scanning (CodeQL) results"}, "actions": {"access": "read", "reason": "GitHub Actions workflow permissions and security"}, ``` `scripts/github-permissions.json:24-25`: ```json "classic_token_scopes": ["repo", "read:org", "security_events"], "classic_token_note": "If fine-grained tokens are not available, use a classic token with these 3 scopes" ``` ### Technical Analysis The Skill declares a read-only security model, but its fallback setup instructions recommend a classic personal access token with the broad `repo` scope. A classic token carrying this scope is not constrained to the read-only API operations used by the Skill and can provide extensive access to private repositories, including modification capabilities. The fine-grained permission manifest also requests Code Scanning Alerts and Actions permissions that are not exercised by the reviewed implementation. The CI/CD check reads workflow files through the repository Contents API, while no module retrieves CodeQL alerts or calls GitHub Actions APIs. Recommending unused or write-capable permissions violates least privilege. Although the audited code only performs read operations, the credential itself remains usable outside the Skill ...[truncated 1161 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the classic `repo` PAT recommendation or clearly state that it does not provide a read-only security boundary. 2. Require fine-grained PATs restricted to the specific organization and repositories being audited. 3. Grant only the permissions required by the checks the user enables. 4. Remove Code Scanning Alerts permission until the implementation actually performs a CodeQL or code-scanning check. 5. Remove Actions permission unless an Actions-specific API is introduced; workflow-file inspection currently uses Contents access. 6. Separate checks into permission profiles so high-sensitivity checks such as audit-log and 2FA inspection do not force every user to grant organization-administration access. 7. Keep tokens short-lived, rotate them regularly, and document immediate revocation procedures. 8. Prefer a GitHub App with explicitly selected read-only permissions where operationally feasible.
