DEV Community

andreagomez
andreagomez

Posted on

A dot should not authenticate a build: GitHub CLI's signer matching flaw

A dot should not authenticate a build: GitHub CLI's signer matching flaw

gh attestation verify is meant to answer a narrow question: was this artifact built by the repository or workflow that policy trusts? CVE-2026-64655 shows how a signer check can answer a different question when user-controlled names are inserted into a regular expression. GitHub permits dots in organization, repository, and workflow path names. In a regex, a dot matches any character.

The vulnerable comparison

The GitHub CLI advisory says the issue affects the --signer-repo and --signer-workflow options. A matcher intended for a trusted signer such as github/artifact-attestations-workflows could also accept a lookalike such as github/artifact.attestations-workflows because the dot was treated as a wildcard. If the attacker can create that lookalike repository or workflow, the verifier may accept an attestation that policy did not intend to trust.

The flaw is low severity in the vendor's scoring because the attacker needs control of an account and a naming pattern close to the trusted identity. The security consequence is still important. Verification is often a gate in a release pipeline. A false pass can move an artifact into production, a package registry, or a privileged deployment path even when the signature and build record are internally valid. The problem is the meaning assigned to the certificate identity, not the cryptographic signature itself.

Where it fits in the release process

Attestations bind an artifact to build evidence. A verifier then maps certificate subject alternative names and issuer data to an expected organization, repository, or workflow. That mapping must be exact. A regular expression is appropriate only when the pattern is fully anchored and every character that has regex meaning is escaped. A glob or substring check has the same risk in a different form.

The advisory names version 2.97.0 as the fixed release. Older CLI installations may remain in CI runners, developer laptops, release containers, and build caches long after a central pipeline is updated. Inventory every place that runs gh attestation verify, including wrapper scripts and action containers. A version check on one central runner does not cover a cached binary.

Remediation

Upgrade GitHub CLI to 2.97.0 or later. After upgrading, test the verifier with the trusted signer and with a deliberately similar lookalike that differs by one regex metacharacter. The lookalike must fail closed. Do not test only the successful path. If the policy cannot state the exact signer, use a supported exact-match or allowlisted identity mechanism rather than a broad pattern.

Audit release records created while older clients were in use. Start with artifacts admitted through --signer-repo or --signer-workflow, then compare the attestation certificate identity with the intended repository or workflow. Re-check any artifact that passed verification but whose signer name contains punctuation or another character that could have matched an unescaped expression. Preserve the attestation, the verifier version, and the policy input used at the time.

Long term, treat the verifier as production code. Pin its version, test known-good and known-bad signer identities in CI, and fail the job when the negative test succeeds. A signature can be valid while the policy that evaluates it is wrong.

References

Top comments (0)