← All permissions
Repository permission·contents:read
Contents: Read
Tier 3 · Low
Why Tier 3
Reads code, commits, branches, tags and releases. On a private repository this is the source code itself.
Data plane permissions start at Tier 2. This one is lowered for the reason above.
- Target
- Repository
- Plane
- DataCode: Repository contents, branches, tags, pull requests, checks and commit signing keys.
- Granted by
- Fine-grained PAT, GitHub App, GITHUB_TOKEN
- Available on
- Every setup
- In a workflow
permissions: contents: read
What it unlocks
49 REST endpoints need this permission. A few of them:
- POST /markdown
- GET /repos/{owner}/{repo}/activity
- GET /repos/{owner}/{repo}/branches
- GET /repos/{owner}/{repo}/branches/{branch}
Roles that include it
- T0OwnerThe organization and every repository in it
- T0All-repository adminEvery repository in the organization
- T1WriteOne repository
- T1MaintainOne repository
- T1AdminOne repository
- T1Security managerThe organization and every repository in it
- T1All-repository writeEvery repository in the organization
- T1All-repository maintainEvery repository in the organization
- T1Enterprise security managerEvery organization in the enterprise
- T2TriageOne repository
- T2All-repository triageEvery repository in the organization
- T3ReadOne repository
- T3All-repository readEvery repository in the organization
Classic scopes that reach it
- T0repodocumented
- T1security_eventsdocumented
- T2public_repodocumented
Attack paths
Techniques it enables
- Clone private repos with a stolen token Read or expose private code
- Get an agent to copy private code into public Read or expose private code
Abused in
Fixed or limited by
- Set an organization-wide maximum PAT lifetime (90 days is a reasonable default)
- Audit and revoke stale PATs, unused SSH keys, and inactive accounts
- Disable classic PATs organization-wide, forcing migration to fine-grained PATs
- Review every currently installed GitHub App / OAuth App and its granted scope
- Keep OAuth app access restrictions on and require security/IT approval for new apps
- Enforce an IP allow list for Git and web UI access from trusted ranges