T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:49- Finding
Overprivileged GitHub Personal Access Token Requirement
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:49-54
Additional Location:README.md:23-31
Vulnerability Type: Excessive credential privileges
Risk Level: MediumVulnerable Code/Configuration Snippet:
markdown 1. Go to https://github.com/settings/tokens 2. Click "Generate new token (classic)" 3. Name: `openclaw-github-skill` 4. Scopes: `repo` (required), `read:user` (optional) 5. Copy the tokenThe README further describes the requested permission as follows:
markdown 4. Scopes (permissions): - `repo` — Full control of private repositories - `public_repo` — Limited access to public repositories only - `read:user` — Read user profile data (optional)Technical Analysis
The setup instructions direct users to create a classic GitHub personal access token with the broad
reposcope. That scope provides extensive control over all private repositories accessible to the user, while the Skill's declared operations are limited to reading repository information, reading commits and CI status, creating issues, creating repositories, and creating pull requests.The implementation automatically reads this token from
process.env.GITHUB_TOKENorcontext.config.github.tokenand attaches it to all GitHub API requests:javascript if (process.env.GITHUB_TOKEN) { headers['Authorization'] = `token ${process.env.GITHUB_TOKEN}`; return headers; } const config = context.config?.github || {}; if (config.token) { headers['Authorization'] = `token ${config.token}`; }Requiring a classic
repotoken violates least-privilege principles because the credential authorizes repository operations beyond those exposed by the Skill. Although the audited implementation only sends the credential to the fixed official endpointhttps://api.github.com, compromise of the Skill process, host environment, OpenClaw configuration, or a future malicious m ...[truncated 1513 chars]- Remediation
View remediation
Remediation Suggestions
- Replace the recommendation for a classic PAT with a fine-grained GitHub PAT restricted to explicitly selected repositories.
- Document the exact repository permissions required for each action, separating read permissions from write permissions.
- Offer a read-only configuration for listing repositories, retrieving repository details, checking CI status, searching repositories, and viewing commits.
- Require users to opt into separate write permissions for issue, repository, and pull-request creation.
- Consider using separate credentials for repository creation because account-level repository creation may require authority distinct from access to existing repositories.
- Require explicit user confirmation immediately before write operations.
- Avoid placing long-lived tokens in broadly inherited process environments where feasible; use the platform's protected credential store.
- Rotate existing classic PATs after migrating to restricted credentials.
- Update both
SKILL.mdandREADME.mdso the documented permission model consistently reflects least-privilege requirements.
