A hijacked GitHub release lets an attacker swap the binaries thousands of users download without touching your source code or your CI pipeline, so release assets need their own controls for publishing, immutability and verification. Most software supply chain programmes concentrate on the build: pinned actions, hardened runners, signed provenance. The release page is a separate surface. Anyone holding a maintainer account or a token with write access to the repository can usually edit a published release, delete an asset and upload a different file under the same name. Users who follow the install instructions in the README then fetch the replacement.
This guide explains how release asset hijacks work, which GitHub features reduce the risk (immutable releases, release attestations, artifact attestations and tag rulesets), how consumers should verify what they download, and how to treat the accounts and tokens that can publish releases as privileged identities. It covers the release stage only. For signing keys and signing services see the Code Signing Security Guide, and for approval gates before deployment see Release Management Security Gates.
Key takeaways
- Release assets on GitHub are mutable by default: a user or token with write access can replace a binary after publication, and nothing in the build pipeline will notice.
- Immutable releases lock the Git tag to a commit and prevent assets from being modified or deleted once a release is published, according to GitHub's documentation.
- Each immutable release automatically gets a release attestation recording the tag, commit SHA and assets, which consumers can check with
gh release verifyandgh release verify-asset. - Artifact attestations from
actions/attestadd build provenance, so a consumer can confirm a binary came from a specific repository's workflow, not just from the release page. - The accounts, personal access tokens, GitHub Apps and workflow tokens that can publish releases are privileged non-human and human identities. Inventory them, minimise them and monitor their use.
- Verification only protects users if it is documented, scripted and enforced in installers, package managers and internal mirrors.
How a release asset hijack works
A GitHub release is a record attached to a Git tag. It holds a title, release notes and a set of uploaded files, often called assets: compiled binaries, archives, checksums, installers. GitHub also generates source code archives on demand. Many projects tell users to download assets directly, for example with a curl command pointed at the "latest" release URL, and many install scripts and package managers resolve that URL automatically.
The attack pattern is simple. The attacker gains write access to the repository, usually through a stolen session, a phished maintainer, a leaked personal access token or a compromised automation token. They then edit an existing release, remove the legitimate asset and upload a malicious file with the same name. Optionally they also replace the checksum file in the same release, so a naive checksum check still passes. Because the source code and the CI workflow are untouched, code review, branch protection and build hardening do not trigger. The first signal is often a user or a security vendor noticing that a binary hash changed.
The OVHcloud CLI Compromise 2026 is a recent example. A hijacked contributor GitHub account replaced release binaries for OVHcloud CLI versions 0.11.0 to 0.15.0 with a stealer that searched disks for secrets, and the swap bypassed CI/CD because release immutability was not enabled. The lesson applies to every project that distributes binaries through GitHub releases: the release page is part of the trust chain.
In MITRE ATT&CK terms this is T1195.002 Compromise Software Supply Chain. The payload choice in recent cases, secret stealers aimed at developer and CI machines, means a single swapped release can turn into a wave of leaked cloud keys, API tokens and SSH keys downstream.
Who can change a release
Before choosing controls, list every identity that can create, edit or delete releases in each repository that ships binaries. In practice that includes:
- Human maintainers and administrators with write or higher repository roles, including dormant contributors who were never removed.
- Organisation owners, who can usually grant themselves access to any repository.
- Personal access tokens issued by those humans, particularly classic tokens with the broad
reposcope. - GitHub Apps and OAuth apps installed with contents write permission.
- The
GITHUB_TOKENin workflows that requestcontents: write, and any third-party release actions those workflows call. - Deploy keys with write access, which can push tags.
Each of these is a path to a hijacked release. The non-human ones (tokens, apps, deploy keys) are frequently the least visible, because nobody owns them after the engineer who created them moves on. Treat the release publishing role the way you would treat a production deployment role. The GitHub and GitHub Actions Security Guide covers organisation level settings for tokens and apps.
Immutable releases
GitHub's immutable releases feature changes the default. According to GitHub's documentation, once a release is published as immutable its Git tag is locked to a specific commit and cannot be moved, and the tag cannot be deleted while the release exists. Release assets such as binaries and archives cannot be modified or deleted. If the release itself is deleted, the tag can be deleted but its name cannot be reused. The title, release notes, pre-release marking and "latest release" status remain editable.
GitHub also describes repository resurrection protection: if a repository is deleted and recreated with the same name, tags tied to immutable releases in the original repository cannot be reused. That closes a related trick where an attacker who gains control of a namespace recreates a project and republishes old version numbers with new content.
Immutable releases are enabled per repository or across an organisation through release settings. Plan the rollout carefully:
- Use the draft workflow. GitHub recommends creating the release as a draft, attaching all assets, then publishing. Once published, you cannot add a forgotten asset, so release automation must upload everything before the publish step.
- Fix the release process, not the setting. Projects that routinely re-upload assets to fix a bad build will need a new habit: cut a new patch version instead.
- Check older releases. Confirm on each release page whether it shows the "Immutable" label. Treat older, unlabelled releases as mutable and plan to supersede or archive them.
- Enable at organisation level where possible, so new repositories inherit the setting and individual maintainers cannot quietly opt out.
Immutability does not stop an attacker with write access from publishing a new, malicious release with a higher version number. It removes the silent swap of an existing, trusted version, and it makes any malicious change visible as a new release event that monitoring can catch.
Release attestations and consumer verification
GitHub's documentation states that creating an immutable release automatically generates a cryptographically verifiable release attestation. The attestation records the release tag, the commit SHA and the release assets, so consumers can confirm that the artefacts they use match the published release.
Consumers verify with the GitHub CLI. From the documentation:
gh release verify RELEASE-TAGchecks that a release exists and is immutable.gh release verify-asset RELEASE-TAG ARTIFACT-PATHchecks that a local file exactly matches an asset in that release.
One documented limitation matters: verify-asset cannot check a release's source code zip or tarball, because GitHub creates those on demand when someone requests a download. If users build from source archives, publish your own source archive as an asset or point them at a signed tag instead.
Release attestations answer the question "is this the file that was published on that release?" They do not answer "was this file built from that commit by our pipeline?" That second question needs build provenance.
Build provenance with artifact attestations
Artifact attestations let a workflow sign a statement about where and how a binary was built. GitHub's documentation shows the actions/attest action with a subject-path input for binaries, or subject-name and subject-digest for container images, plus an optional sbom-path. A workflow attesting binaries needs the permissions id-token: write, contents: read and attestations: write; container images also need packages: write.
Consumers verify with gh attestation verify PATH/TO/ARTIFACT -R ORGANIZATION/REPOSITORY, which confirms the artefact was attested by a workflow in that repository. For container images the subject is an oci:// reference. SBOM attestations can be checked by adding --predicate-type.
Availability depends on plan. GitHub states that artifact attestations work on public repositories on Free, Pro and Team plans, while private or internal repositories need GitHub Enterprise Cloud. Legacy plans are not supported.
Combining the two is the strongest posture for a project that ships binaries:
- The release workflow builds the binary and attests provenance with
actions/attest. - The workflow creates a draft release, uploads the attested binaries and checksums, then publishes it as immutable.
- Consumers run
gh release verify-assetto confirm the file matches the release, andgh attestation verifyto confirm it was built by the expected repository.
An attacker who steals a maintainer session can still publish a new release, but they cannot produce valid provenance from the legitimate workflow without also compromising that workflow, and they cannot alter existing immutable releases. The SLSA and Build Provenance Guide explains how provenance maps to SLSA build levels, and the Sigstore Guide covers the keyless signing model underneath.
Protecting tags with rulesets
Releases point at tags, so tag integrity matters even before a release is immutable. GitHub rulesets can target tags by name pattern, such as v*. The documented rules include:
- Restrict creations: only users with bypass permission can create matching tags.
- Restrict updates: only users with bypass permission can push to matching tags.
- Restrict deletions: only users with bypass permission can delete matching tags. Selected by default.
- Block force pushes: prevents force pushes to matching tags. Enabled by default.
The bypass list can name specific roles, teams or GitHub Apps. A practical pattern is to allow only a dedicated release GitHub App, used by the release workflow, to create version tags, and to keep human maintainers off the bypass list except for a small break-glass team. That turns tag creation, and therefore release creation from a new tag, into an action that only automation performs.
Securing the identities that publish releases
Every release hijack starts with an identity. The controls below reduce how many identities can publish and how useful a stolen one is.
Human maintainers
- Require phishing-resistant multi-factor authentication for every organisation member, and prefer passkeys or security keys for anyone with write access to release repositories.
- Review repository collaborators quarterly. Remove dormant contributors, and downgrade outside collaborators who no longer ship releases.
- Separate the ability to merge code from the ability to publish releases where the team is large enough.
Tokens, apps and workflow credentials
- Disallow or tightly restrict classic personal access tokens at organisation level. Fine-grained tokens can be scoped to a repository and to contents permission, with an expiry.
- Publish releases from a workflow, using a GitHub App or the workflow token, not from a maintainer's laptop. Give
contents: writeonly to the release job, not to the whole workflow. - Pin third-party release actions to a full commit SHA, since a compromised action inside the release job inherits its write token.
- Protect the release job with a deployment environment that requires approval, so a stolen token alone cannot trigger publication.
These are standard non-human identity controls: know each credential, give it one purpose, give it an owner and an expiry, and watch it. The Software Supply Chain Security Guide places them in the wider pipeline context.
Detection and response
Release changes leave a trail in the organisation audit log and in repository webhooks. Useful signals, to be mapped to the event names in your own GitHub audit log export:
- Release edits or asset deletions on releases older than a few hours, especially on the latest release.
- Releases created or tags pushed outside the release workflow, or by an identity that is not the release App.
- New personal access tokens or app installations with contents write on release repositories, followed by release activity.
- Asset hashes that differ from the hashes recorded at publication time. Record asset SHA-256 values in an external system when you publish, then compare on a schedule.
If a release is hijacked, act in this order: revoke the session and tokens of the identity used, remove or replace the malicious assets and publish a clean patch version, publish an advisory with the malicious hashes and affected versions, and tell users to rotate any secrets present on machines that ran the bad binary. A stealer payload means the downstream incident is a secrets incident, so plan for credential rotation at scale.
Guidance for consumers and internal mirrors
Organisations that depend on open source binaries can protect themselves even when the upstream project has not adopted these controls:
- Pin downloads to a specific version and a recorded SHA-256 hash, not to a "latest" URL.
- Where the upstream project uses immutable releases or attestations, run
gh release verify-assetandgh attestation verifyin the pipeline that ingests the binary into an internal artefact repository. - Mirror approved binaries internally and install from the mirror, so a later upstream swap does not reach production machines.
- Treat a changed hash for an existing version as a security event, never as a reason to update the pinned hash.
- Apply a cooling-off period before adopting new releases of developer tools that run with access to credentials.
Common failure patterns
- Publishing checksums inside the same mutable release as the binaries, so an attacker replaces both.
- Enabling immutable releases but keeping a habit of deleting and recreating releases to fix mistakes, which leaves gaps and confuses users.
- Generating artifact attestations but never documenting the verification command, so no consumer runs it.
- Leaving long-lived classic tokens with
reposcope on maintainer machines, where a secret stealer finds them. - Giving
contents: writeto every job in a workflow, including jobs that run untrusted code from pull requests. - Install scripts that fetch the latest release without pinning or verification.
- No owner for release automation tokens, so nobody notices when they are used outside the workflow.
Practitioner checklist
- List every repository that publishes binaries through GitHub releases and every identity that can edit them.
- Enable immutable releases at organisation level and move release automation to the draft, upload, publish sequence.
- Add
actions/attestto release workflows and documentgh attestation verifyandgh release verify-assetin the README. - Create a tag ruleset for version tags that restricts creation, updates and deletions to a release GitHub App.
- Remove classic personal access tokens from release repositories and set expiry on fine-grained tokens.
- Require phishing-resistant MFA for everyone with write access to release repositories.
- Record asset hashes externally at publication and alert on any change.
- Write a release hijack runbook that includes downstream secret rotation guidance for users.
Standards and references
- GitHub Docs: Immutable releases
- GitHub Docs: Verifying the integrity of a release
- GitHub Docs: Using artifact attestations to establish provenance for builds
- GitHub Docs: Available rules for rulesets
- OpenSSF: SLSA v1.0 Security Levels
- NIST: SP 800-218 Secure Software Development Framework (SSDF) Version 1.1
- MITRE ATT&CK: T1195.002 Compromise Software Supply Chain
Related NHI Mgmt Group resources: Code Signing Security Guide · GitHub and GitHub Actions Security Guide · SLSA and Build Provenance Guide · OVHcloud CLI Compromise 2026