T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:19- Finding
Repository-wide GitHub permissions exceed the Skill's functional requirements
- Content
View full analysis
" \ -H "Accept: application/vnd.github+json" \ https://api.github.com/repos///actions/permissions/workflow \ -d '{"default_workflow_permissions":"write","can_approve_pull_request_reviews":true}' ``` The generated workflow also requests write access: ```yaml permissions: contents: write ``` ### Technical Analysis Creating a workflow file requires write access to the selected repository, and publishing a release requires repository contents write access for the relevant job. It does not require: - A classic PAT with broad `repo` access across every repository available to that token. - Write permissions as the default for every workflow in the repository. - Permission for GitHub Actions to approve pull-request reviews. The `can_approve_pull_request_reviews` setting is unrelated to building or publishing OpenClash. Enabling it expands the authority of all workflows in the repository and can weaken branch-protection controls when combined with a compromised or attacker-controlled workflow. Although the authorization header is sent to `api.github.com`, which is consistent with the declared repository-management operation, the requested scope and repository-wide permission changes violate least privilege. ### Attack Path 1. The user creates or supplies a classic PAT with the `repo` scope. 2. The Skill receives that token and uses it to modify the selected repository. 3. The Skill enables write permissions by default for repository workflows and permits workflow-based pull-request approvals. 4. An attacker compromises a dependency, modifies another work ...[truncated 814 chars]- Remediation
View remediation
