How it works
A GitHub release is a tag, some text and a list of assets. Each asset is its own object with an id, name, size, digest, updated_at and a browser_download_url built from the tag and the file name. Consumers, install scripts and other pipelines fetch that URL and trust what comes back because of where it came from.
Nothing in an ordinary release ties the asset to the build that was meant to produce it. A user with push access can edit, delete and upload assets through the web interface, the REST API or the GitHub CLI. Uploading a file whose name already exists is refused, so a replacement is a delete followed by an upload, which gh release upload --clobber does in one command. The file name and the download URL survive the swap. The asset's id, digest, size and updated_at do not.
The divergence between "what was built" and "what consumers get" can be introduced at several points:
- After publication. The asset of an existing release is replaced, as above.
- At publication. The publishing step uploads something other than the build output, because a step in the release job was tampered with or consumed a poisoned artifact or cache. A run can even fail overall after its upload step succeeded.
- By moving the tag. The tag is repointed to another commit and the release is rebuilt from it, or consumers who build from the tag get different source.
- On another channel. The same project publishes to a package registry or a mirror, and the attacker changes the copy there. A consumer's digest then differs from the release asset although the release was never touched.
Prerequisites
- Write access to the repository's releases. That is a maintainer or collaborator with push access, a personal access token with contents write (see personal access token theft and abuse), or a
GITHUB_TOKENwithcontents: writetaken from a running job (see GITHUB_TOKEN and installation token abuse). - A release that is not immutable.
- Consumers that download the asset without verifying it against an independent record.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
1. List the release and its assets
gh release view v1.2.3 --repo octo-org/octo-repo --json tagName,isImmutable,publishedAt,assets
isImmutable: false means the assets can still be changed. Note each asset's name, size and digest so that the replacement can match what users expect to see.
2. Get the original and prepare the replacement
gh release download v1.2.3 --repo octo-org/octo-repo --pattern 'app-linux-amd64.tar.gz' --dir original/
sha256sum original/app-linux-amd64.tar.gz
The attacker builds a modified copy that behaves like the original and carries the payload, and gives it the same file name.
3. Replace the asset
# Deletes the existing asset with the same name, then uploads the new file
gh release upload v1.2.3 modified/app-linux-amd64.tar.gz --clobber --repo octo-org/octo-repo
The same through the REST API, which is what a stolen workflow token would use:
# Find the asset id, delete it, upload the replacement
curl -s -H "Authorization: Bearer $TOKEN" \
https://api.github.com/repos/octo-org/octo-repo/releases/<release_id>/assets
curl -s -X DELETE -H "Authorization: Bearer $TOKEN" \
https://api.github.com/repos/octo-org/octo-repo/releases/assets/<asset_id>
curl -s -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/octet-stream" \
--data-binary @modified/app-linux-amd64.tar.gz \
"https://uploads.github.com/repos/octo-org/octo-repo/releases/<release_id>/assets?name=app-linux-amd64.tar.gz"
4. Replace the checksums too
Projects often publish a SHA256SUMS file as another asset of the same release. It is replaced the same way, so that a user who checks the download against it sees a match.
5. Let consumers fetch it
Every download of the unchanged URL now returns the attacker's file: users, package managers that wrap the release, container builds, and other organizations' pipelines that pin the tag but not the digest. The asset's download_count rises, but it is an aggregate and identifies no consumer.
Impact
The attacker's code runs wherever the release is installed, with the trust the project has earned and with no change to the source repository. For a widely used tool this is a compromise of every downstream organization, and of their build systems first. Because the tag, the release notes and the URL are unchanged, the swap can stay unnoticed until someone compares digests.
OPSEC and artifacts
- Same name, same size class. Keeping the file name and a similar size avoids casual notice. The asset object is new: its
id,digestandupdated_atdiffer from the values at publication, andupdated_atis later than the release'spublished_at. - Matching checksum file. Replacing the checksum asset defeats in-release verification. It also gives the checksum file a new
idandupdated_at. - Token choice. Using a workflow token makes the change appear as the Actions bot during a run; using a maintainer's token makes it appear as that person. The asset's
uploaderfield records which identity uploaded the current file. - Short window. An attacker can restore the original after a target has downloaded the file. The asset identity changes again, and consumers who recorded the digest of what they received still hold the evidence.
- Nothing in Git. The commit history and the tag do not change in the plain replacement, so source review and branch protection see nothing.
- Provenance mismatch. If the project attests its builds, the replaced file has no attestation that matches its digest.
Detection
- Snapshot and compare. Record each asset's
id,name,size,digestandupdated_atwhen a release is published, and compare on a schedule. A changed display label alone does not mean changed bytes; a changed digest does.
gh release view v1.2.3 --repo octo-org/octo-repo --json assets \
--jq '.assets[] | {id, name, size, digest, updatedAt}'
- Verify against an independent record.
# Immutable release: the release exists and is immutable; the local file matches one of its assets
gh release verify v1.2.3 --repo octo-org/octo-repo
gh release verify-asset v1.2.3 ./app-linux-amd64.tar.gz --repo octo-org/octo-repo
# Build provenance: the file was produced by a workflow of this repository
gh attestation verify ./app-linux-amd64.tar.gz -R octo-org/octo-repo
- Locate the point of divergence. Compare the archived build output with the approved manifest, then the build output with the asset's digest, then the asset with what the consumer received. A mismatch between build and asset points at the publishing step or the asset's history; a match there with a different consumer digest points at a mirror, a cache or another channel.
- Watch the controls around releases. Alert when immutable releases are turned off for a repository or the organization policy changes, when a ruleset is deleted (see the branch protection or ruleset removed rules), and when the publishing environment loses a protection rule (see the environment protection removed rules).
- Watch who can write. New tokens with access to the organization are covered by the personal access token access granted rules.
Mitigation
- Turn on immutable releases. Published assets can then no longer be modified or deleted and the tag is locked to its commit. Publish in three steps: create the release as a draft, attach every asset, then publish.
- Attest builds and verify on the consumer side. Generate artifact attestations in the release workflow and make
gh attestation verifyorgh release verify-assetpart of every install and deployment script.
permissions:
id-token: write
contents: read
attestations: write
steps:
- name: Generate artifact attestation
uses: actions/attest@v4
with:
subject-path: 'dist/app-linux-amd64.tar.gz'
- Limit who can write releases. Grant
contents: writeonly to the single publishing job, run that job in a protected environment with required reviewers and tag restrictions, and keep every other workflow at read-only, following least privilege. - Remove long-lived publishing tokens. Replace personal access tokens stored as secrets with the job's own token or OIDC-based publishing; where a token must remain, apply the personal access token security guide.
- Protect tags with rulesets so that a release tag cannot be moved or deleted.
- Pin by digest downstream. Consumers should record the digest of the asset they reviewed and refuse anything else, instead of trusting a tag or a URL.
Detection rules for this attack
Log events to collect
FAQ
Can a GitHub release asset be changed after the release is published?
Yes, unless the release is immutable. Anyone with push access can delete an asset and upload a new file with the same name. The release tag, the page and the download URL stay the same; the asset's id, digest and update time change.
How do I know a release binary is the one the project built?
Compare it against a record the publisher can't change afterwards. For an immutable release, gh release verify-asset checks that a local file exactly matches an asset of the release. For builds with artifact attestations, gh attestation verify checks the file against the signed provenance.
Does a checksum file in the same release protect consumers?
No. Whoever can replace the binary can replace the checksum file next to it. A digest only helps when it comes from a source the attacker cannot write to, such as a signed attestation or a release that has been made immutable.
What do immutable releases change?
Once an immutable release is published, its assets cannot be modified or deleted and its tag is locked to its commit. GitHub also generates a release attestation that names the tag, the commit and the assets, which consumers can verify.
References
- Compromise Software Supply Chain, T1195.002 (MITRE ATT&CK)
- REST API endpoints for release assets (GitHub Docs)
- Immutable releases (GitHub Docs)
- Verifying the integrity of a release (GitHub Docs)
- Using artifact attestations to establish provenance for builds (GitHub Docs)
- gh release upload (GitHub CLI manual)
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.