# Contents: Write (repository)

Tier 2 permission, `permission:contents:write`. Page: https://ghtier.com/tier/permissions/contents-write

Pushes commits, creates, moves and deletes branches, tags and releases, merges pull requests, and sends repository_dispatch events. Cannot change files under .github/workflows without Workflows: write. On a repository other projects consume, moving a tag changes what they run, unless the tag belongs to an immutable release: its tag and assets are locked, though the release can still be deleted.

**Included in roles:** [Write](https://ghtier.com/tier/roles/repo-write.md) (Tier 1), [Maintain](https://ghtier.com/tier/roles/repo-maintain.md) (Tier 1), [Admin](https://ghtier.com/tier/roles/repo-admin.md) (Tier 1), [Collaborator on a personal repository](https://ghtier.com/tier/roles/personal-repo-collaborator.md) (Tier 1), [Owner](https://ghtier.com/tier/roles/org-owner.md) (Tier 0), [All-repository write](https://ghtier.com/tier/roles/org-all-repo-write.md) (Tier 1), [All-repository maintain](https://ghtier.com/tier/roles/org-all-repo-maintain.md) (Tier 1), [All-repository admin](https://ghtier.com/tier/roles/org-all-repo-admin.md) (Tier 0)

**Reached by classic scopes:** [repo](https://ghtier.com/tier/tokens/repo.md) (Tier 0), [public_repo](https://ghtier.com/tier/tokens/public-repo.md) (Tier 2), [workflow](https://ghtier.com/tier/tokens/workflow.md) (Tier 1)

**Keys and policies that act as or change it:** [SSH key on a user account](https://ghtier.com/tier/keys-policies/ssh-key.md) (Tier 1), [Deploy key with write access](https://ghtier.com/tier/keys-policies/deploy-key.md) (Tier 1), [SSH certificate authority private key](https://ghtier.com/tier/keys-policies/ssh-ca-key.md) (Tier 0), [Codespaces token](https://ghtier.com/tier/keys-policies/codespaces-token.md) (Tier 2), [Code owner (CODEOWNERS entry)](https://ghtier.com/tier/keys-policies/codeowners.md) (Tier 2), [Workflow dependency lockfile (actions.lock)](https://ghtier.com/tier/keys-policies/workflow-lockfile.md) (Tier 1)

**Enables techniques:** [Push directly, without review](https://ghtier.com/attack-paths/technique-no-review.md) (Tier 2), [Push more commits after approval](https://ghtier.com/attack-paths/technique-stale-approval.md) (Tier 2), [Approve someone else's PR, then push to it](https://ghtier.com/attack-paths/technique-last-push.md) (Tier 2), [Hide it in a change nobody can review](https://ghtier.com/attack-paths/technique-unreviewable.md) (Tier 2), [Use a trusted colleague's account](https://ghtier.com/attack-paths/technique-other-account.md) (Tier 2), [Force push or delete a protected branch](https://ghtier.com/attack-paths/technique-force-push.md) (Tier 1), [Delete branches and workflow runs](https://ghtier.com/attack-paths/technique-delete-runs.md) (Tier 1), [Push a release tag to an unreviewed commit](https://ghtier.com/attack-paths/technique-push-tag.md) (Tier 2), [Repoint existing tags on a published Action](https://ghtier.com/attack-paths/technique-repoint-tags.md) (Tier 2), [Run PR code in a privileged workflow](https://ghtier.com/attack-paths/technique-pwn-request.md) (Tier 1), [Read secrets from the runner](https://ghtier.com/attack-paths/technique-runner-memory.md) (Tier 2), [Trigger the publish workflow from a tampered branch](https://ghtier.com/attack-paths/technique-dispatch-publish.md) (Tier 1), [Release through the project's own pipeline](https://ghtier.com/attack-paths/technique-release-provenance.md) (Tier 2), [Plant editor or agent config that runs on open](https://ghtier.com/attack-paths/technique-editor-config.md) (Tier 2)

**Ways in that use it:** [Member with write access](https://ghtier.com/attack-paths/insider-write.md) (Tier 1), [Leaked token](https://ghtier.com/attack-paths/leaked-token.md) (Tier 1), [Compromised GitHub App or OAuth integration](https://ghtier.com/attack-paths/third-party-app.md) (Tier 1), [Stolen SSH or deploy key](https://ghtier.com/attack-paths/ssh-key.md) (Tier 1), [Untrusted input reaches a privileged workflow](https://ghtier.com/attack-paths/untrusted-input.md) (Tier 1), [Compromised Action or package](https://ghtier.com/attack-paths/upstream-dependency.md) (Tier 1), [Compromised developer tool or extension](https://ghtier.com/attack-paths/dev-tooling.md) (Tier 1)

**Starts escalations:** [Change what an existing workflow runs, get its secrets](https://ghtier.com/attack-paths/escalation-contents-to-secrets.md) (Tier 2), [Send a repository_dispatch payload to a workflow with secrets](https://ghtier.com/attack-paths/escalation-dispatch-payload-to-workflow.md) (Tier 2), [Move release tags on a widely used Action](https://ghtier.com/attack-paths/escalation-tags-to-downstream.md) (Tier 2)

**Gained through escalations:** [Add a collaborator or guest that outlives the attack](https://ghtier.com/attack-paths/escalation-members-to-collaborator.md) (Tier 2), [Take the workflow token from a runner](https://ghtier.com/attack-paths/escalation-runner-code-to-token.md) (Tier 2), [Persist on a non-ephemeral self-hosted runner](https://ghtier.com/attack-paths/escalation-fork-pr-to-runner.md) (Tier 2)

**Abused in incidents:** [tj-actions/changed-files supply-chain compromise (CVE-2025-30066)](https://ghtier.com/incidents/tj-actions-changed-files.md), [ArtiPACKED artifact token leakage](https://ghtier.com/incidents/artipacked.md), ["Pwn requests": pull_request_target & workflow_run](https://ghtier.com/incidents/pwn-requests.md), [Ultralytics build cache poisoning](https://ghtier.com/incidents/ultralytics.md), [Nx "s1ngularity"](https://ghtier.com/incidents/nx-s1ngularity.md), [Self-hosted runner takeovers (PyTorch and others)](https://ghtier.com/incidents/self-hosted-runner-attacks.md), [hackerbot-claw autonomous agent RCE](https://ghtier.com/incidents/hackerbot-claw.md), [TeamPCP tag force-overwrite campaign](https://ghtier.com/incidents/teampcp.md), [prt-scan: automated pull_request_target attacks](https://ghtier.com/incidents/prt-scan.md), [ChainDrop: a hijacked maintainer account publishes through trusted publishing](https://ghtier.com/incidents/chaindrop.md), [CVE-2026-3854: push-option metadata RCE](https://ghtier.com/incidents/cve-2026-3854.md)

**Strange findings:** [Write access reads every repository secret](https://ghtier.com/strange-findings/finding-write-reads-all-secrets.md), [Older organizations still give GITHUB_TOKEN write access](https://ghtier.com/strange-findings/finding-old-github-token-defaults.md), [Rewriting history does not remove a commit from GitHub](https://ghtier.com/strange-findings/finding-force-push-keeps-old-commits.md), [Pull requests a workflow opens need a person to start their checks](https://ghtier.com/strange-findings/finding-bot-pull-requests-wait-for-approval.md), [Push protection skips pushes over 50 MB in public repositories](https://ghtier.com/strange-findings/finding-push-protection-skips-large-public-pushes.md), [pull_request_target gives fork pull requests a write token and secrets](https://ghtier.com/strange-findings/finding-pull-request-target-gets-secrets.md), [Approval for outside contributors does not hold back pull_request_target](https://ghtier.com/strange-findings/finding-fork-approval-skips-pull-request-target.md), [Every collaborator on a personal private repository can push](https://ghtier.com/strange-findings/finding-personal-private-repo-collaborators-can-push.md), [workflow_run gets secrets after a fork's workflow without them](https://ghtier.com/strange-findings/finding-workflow-run-gets-secrets-after-fork.md)

**Sources:**
- [GitHub docs](https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps#repository-permissions-for-contents)

From ghtier (https://ghtier.com). Every entry and link: https://ghtier.com/data/graph.json. Tiers: https://ghtier.com/tier.
