T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:39- Finding
Documentation Requests an Overprivileged GitHub Personal Access Token
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:39-41; duplicated inREADME.md:72-75
Vulnerability Type: Violation of least privilege through excessive API token permissions
Risk Level: MediumComplete Vulnerable Snippets:
SKILL.md:39-41markdown 1. **GitHub Token**: - Go to GitHub Settings → Developer settings → Personal access tokens - Create a token with `public_repo` scopeREADME.md:72-75markdown **Getting GitHub Token:** 1. Visit https://github.com/settings/tokens 2. Create new token with `public_repo` scope 3. Copy and save to `.env`Technical Analysis
The Skill instructs users to create a GitHub personal access token with the classic
public_reposcope. That scope provides broader access to public repositories than the implemented functionality requires.The relevant implementation in
src/scanner.js:24-34only submits a read-only request to GitHub's issue search endpoint:javascript const response = await axios.get(`${this.baseURL}/search/issues`, { headers: { 'Authorization': `token ${this.githubToken}`, 'Accept': 'application/vnd.github.v3+json' }, params: { q: `${query} is:issue is:open sort:created-desc`, per_page: limit } });No repository modification, issue creation, source-code update, or other write operation is implemented. Requiring
public_repotherefore violates the principle of least privilege. Public issue searches can be performed without authentication at lower rate limits, or with a fine-grained token limited to read-only metadata and issue access when authentication is necessary.The audited code sends the token only to the fixed HTTPS GitHub API endpoint and does not itself expose or exfiltrate it. Exploitation consequently requires a separate compromise of the token, local
.envfile, process environment, dependency, or host account. The excessive permission increases th ...[truncated 1487 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the recommendation to create a classic token with the
public_reposcope. - Make unauthenticated GitHub searching the default when its lower rate limit is acceptable.
- If authentication is required, instruct users to create a fine-grained personal access token with:
- Read-only access.
- Only the metadata and issue permissions required for search.
- Access restricted to the smallest feasible repository set.
- A short expiration period.
- Explicitly state that repository contents, administration, workflows, pull requests, and issue write permissions are not required.
- Update both
SKILL.mdandREADME.mdso their guidance remains consistent. - Add a warning that
.envmust not be committed, shared, included in logs, or copied into exported scan results. - Consider rejecting or warning about known overprivileged classic token configurations where GitHub APIs provide enough metadata to identify them.
- Recommend periodic token rotation and immediate revocation if disclosure is suspected.
Suggested replacement documentation:
markdown GitHub authentication is optional for public searches. To obtain higher rate limits, use a short-lived fine-grained personal access token with read-only Metadata and Issues access. Do not grant repository write, administration, workflow, or private-repository permissions.- Remove the recommendation to create a classic token with the
