Skip to content
Advisory Advanced

GHSL-2026-225: Artifact metadata injection in actions/attest

The privileged commit-dist.yml workflow trusts a branch name supplied in artifact metadata from an unprivileged producer workflow that runs on pull_request. An attacker who can open a fork pull request could modify the producer to supply an arbitrary branch name and malicious dist/ content, causing the privileged workflow to commit and push that content to a chosen branch.

jarlob Follow

Originally disclosed on GitHub Security Lab

The commit-dist.yml workflow in the actions/attest project improperly trusts an artifact-supplied branch name. This allows attackers to compromise the workflow and push attacker-controlled dist/ content to a branch of their choosing, potentially affecting repository integrity.

jarlob, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The privileged consumer workflow trusts a branch name supplied by an unprivileged producer workflow that runs on pull_request, without cross-checking it against the workflow_run event's head_branch or head_repository.

Impact

If pull request access is opened to everyone, an external contributor could place attacker-chosen content into the tracked dist/ bundle on a branch, committed by a trusted automation identity; the default branch is protected, so the practical target is a live Dependabot pull request branch.

What the attacker needed

Pull request access opened to everyone; attacker can open a fork pull request

The fix

The issue was fixed by constraining the origin of the branch rather than changing the channel, as stated in the disclosure timeline.

How it was found

  1. An attacker opens a pull request from a fork, modifying rebuild-dist.yml to drop the Dependabot gate and to emit a chosen head-ref, a matching real head-sha, and malicious dist/ contents.
  2. The unprivileged producer run completes successfully with event == pull_request, publishing the rebuilt-dist artifact.
  3. workflow_run starts commit-dist.yml from the trusted default-branch definition, which downloads that artifact.
  4. Validation and the head check both pass, because the attacker supplied a syntactically valid branch name and the actual current tip of that branch.
  5. The workflow checks out the chosen branch, replaces dist/, commits, and pushes with contents: write.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A repository uses two automated workflows: one that runs on pull requests without special permissions, and another that runs after it with permission to write to the repository. The first workflow passes a branch name to the second through a file, and the second trusts that name without checking where it came from. Someone who can open a pull request could change the first workflow to supply a different branch name and malicious files, and the second workflow would then commit those files to that branch.

More by jarlob

View all

192 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.