CVE-2025-25204: `gh attestation verify` returns incorrect exit code during verification if no attestations are present

Published Feb 14, 2025
·
Updated

Summary

A bug in GitHub's Artifact Attestation CLI tool, gh attestation verify, may return an incorrect zero exit status when no matching attestations are found for the specified --predicate-type <value> or the default https://slsa.dev/provenance/v1 if not specified. This issue only arises if an artifact has an attestation with a predicate type different from the one provided in the command. As a result, users relying solely on these exit codes may mistakenly believe the attestation has been verified, despite the absence of an attestation with the specified predicate type and the tool printing a verification failure.

Users are advised to update gh to version v2.67.0 as soon as possible.

Initial report: https://github.com/cli/cli/issues/10418 Fix: https://github.com/cli/cli/pull/10421

Details

The gh attestation verify command fetches, loads, and attempts to verify attestations associated with a given artifact for a specified predicate type. If an attestation is found, but the predicate type does not match the one specified in the gh attestation verify command, the verification fails, but the program exits early.

Due to a re-used uninitialized error variable, when no matching attestations are found, the relevant function returns nil instead of an error, causing the program to exit with a status code of 0, which incorrectly suggests successful verification.

PoC

Run gh attestation verify with local attestations using the --bundle flag and specify a predicate type with --predicate-type that you know will not match any of the attestations the command will attempt to verify. Confirm that the command exits with a zero status code.

Impact

Users who rely exclusively on the exit status code of gh attestation verify may incorrectly verify an attestation when the attestation's predicate type does not match the specified predicate type in the command.

Other sources

gh attestation verify returns incorrect exit code during verification if no attestations are present

Microsoft

gh is GitHub’s official command line tool. Starting in version 2.49.0 and prior to version 2.67.0, under certain conditions, a bug in GitHub's Artifact Attestation cli tool gh attestation verify causes it to return a zero exit status when no attestations are present. This behavior is incorrect: When no attestations are present, gh attestation verify should return a non-zero exit status code, thereby signaling verification failure. An attacker can abuse this flaw to, for example, deploy malicious artifacts in any system that uses gh attestation verify's exit codes to gatekeep deployments. Users are advised to update gh to patched version v2.67.0 as soon as possible.

NVD

Affected Software

3 affected componentsFixes available
GitHub gh>2.49.0<=2.67.0
go/github.com/cli/cli/v2>=2.49.0<2.67.0
2.67.0
Microsoft azl3 gh 2.62.0-8

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/cli/cli/v2 to a version that resolves this vulnerability.

    Fixed in 2.67.0
  2. Upgrade

    Upgrade gh (GitHub CLI) to a version that resolves this vulnerability.

    Fixed in v2.67.0
  3. Compensating control

    Do not rely exclusively on the exit status code of `gh attestation verify`. Confirm the command output indicates verification success, especially in cases where no attestations are expected to match the specified `--predicate-type`.

Event History

Feb 14, 2025
CVE Published
via MITRE·04:38 PM
Data Sourced
via MITRE·04:38 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·05:19 PM
Mar 13, 2025
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-25204?

CVE-2025-25204 is considered a moderate severity vulnerability due to its potential to mislead users about the presence of attestations.

2

How do I fix CVE-2025-25204?

To fix CVE-2025-25204, upgrade the GitHub CLI tool `gh` to version 2.67.0 or later.

3

What versions of `gh` are affected by CVE-2025-25204?

CVE-2025-25204 affects versions of the GitHub CLI tool `gh` from 2.49.0 up to (but not including) 2.67.0.

4

What is the impact of CVE-2025-25204 on users?

The impact of CVE-2025-25204 on users is that it may lead to incorrect behavior where the tool reports success even when no attestations are present.

5

Is there a workaround for CVE-2025-25204?

There are no documented workarounds for CVE-2025-25204; the recommended action is to upgrade to a fixed version.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203