Skip to content

[pull] trunk from cli:trunk - #260

Merged
pull[bot] merged 19 commits into
arc675:trunkfrom
cli:trunk
Sep 30, 2026
Merged

pull[bot] merged 19 commits into
arc675:trunkfrom
cli:trunk

Conversation

@pull

@pull pull Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

BagToad and others added 19 commits August 20, 2026 17:13
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
validateSignerWorkflow built a pattern anchored only at the start, and
sigstore-go applies SAN patterns with regexp.MatchString, which is
unanchored. The pin was therefore a prefix match: a workflow named
release.yml.attacker.yml satisfied a pin on release.yml.

Append (@[^@]*)?$ to both return paths so the pinned value must run to
the end of the SAN, optionally followed by a single @<ref>. The ref is
matched without an "@" so that an "@" in a workflow file name cannot be
presented as the separator. Refs appear as both git refs and commit
SHAs, so the suffix cannot assume a refs/ prefix.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The first cut of this fix ended the pattern with (@[^@]*)?$, which
treats the last "@" as the separator between workflow path and ref.
That rejects legitimate signers: "@" is valid in a git ref, and
refs/tags/pkg@1.2.3 is the tag convention used by JavaScript
monorepos, whose release workflows are exactly what --signer-workflow
is meant to pin.

Allowing any ref instead, with (@.*)?$, is not an option. Actions
loads a workflow file whose name contains "@", the OIDC
job_workflow_ref claim carries the name verbatim, and Fulcio leaves
"@" unescaped because it is a legal path character, so a file named
release.yml@evil.yml yields a SAN that a permissive pattern accepts
for a pin on release.yml.

Match the ref by shape instead: either a "refs/"-prefixed path or a
bare object ID. A workflow file name can be neither, because Actions
only loads workflows stored directly in .github/workflows so the name
cannot contain "/", and the name must carry a .yml or .yaml extension
so it cannot be a bare object ID.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Trunk changed the same lines in internal/zip and run download:

- Use errors.AsType in ExtractZip, following the Go 1.27.1 bump
- Pass the repository host to downloadArtifact and send the request
  through api.Client, keeping the openDestination callback
- Set repo on apiPlatform in Test_Download so RepoHost resolves

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The optional "@<ref>" suffix is right for the documented flag format,
which carries no ref and has to keep matching a certificate from any
ref. Applied to a value that pins a ref, though, it allows a second
ref to follow the pinned one.

A git ref may be named "main@refs/heads/attacker": git accepts it,
GitHub accepts the push, and Actions runs a workflow from it, issuing
a certificate whose job_workflow_ref ends "@refs/heads/main@refs/
heads/attacker". A pin on refs/heads/main matched that, so the pin no
longer constrained which ref the workflow ran from, and a branch
protection rule on main does not cover the attacker's branch name.

Append the optional suffix only when the value does not already end
in a ref. When it does, anchor the pattern at the end of the SAN.

This is narrower than the prefix match it replaces rather than a
regression against it: a bare prefix match already admitted both this
SAN and "@refs/heads/mainattacker", which stays rejected either way.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The trunk merge brought in a test that calls downloadAsset directly.
destinationWriter now keeps its destination directory open until
Close, so on Windows the test could not remove its temporary
directory and failed during cleanup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Make SourceRepositoryRef check case-sensitive
Make --signer-workflow an identity match instead of a prefix match
Prevent flag injection in installs from skill search
Harden filesystem writes against symlinks
@pull pull Bot locked and limited conversation to collaborators Sep 30, 2026
@pull pull Bot added the ⤵️ pull label Sep 30, 2026
@pull
pull Bot merged commit fc4b137 into arc675:trunk Sep 30, 2026
12 of 14 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants