CVE-2025-25204: Github.com/cli/cli/v2 `gh Attestation Verify` Returns Incorrect Vulnerability

MODERATE
Advisory Identifier: GHSA-fgw4-v983-mgp8
CVSS 6.3
CWE-390
Published
Advisory Summary

CVE-2025-25204 is a MODERATE (CVSS 6.3) `gh attestation verify` returns incorrect vulnerability (CWE-390: Detection of Error Condition Without Action) affecting Github.com/cli/cli/v2 libraries in the Go ecosystem. The issue involves `gh attestation verify` returns incorrect exit code during verification if no attestations are present. Remediation is available by upgrading affected packages to version 2.67.0.

CVE-2025-25204 at a Glance

CVE Identifier CVE-2025-25204
GHSA Identifier GHSA-fgw4-v983-mgp8
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-390: Detection of Error Condition Without Action
Affected Product Github.com/cli/cli/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2025-25204

To remediate this vulnerability, upgrade all affected Github.com/cli/cli/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/cli/cli/v2 fixed: 2.67.0
Upgrade github.com/cli/cli/v2 to 2.67.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/cli/cli/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-25204, inspect your project dependencies for Github.com/cli/cli/v2:

inspect dependencies for github.com/cli/cli/v2

Analyze the terminal output to locate any version of Github.com/cli/cli/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.67.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-390: Detection of Error Condition Without Action, where the product detects a specific error, but takes no actions to handle the error. In Github.com/cli/cli/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2025-25204 Affected Github.com/cli/cli/v2 Versions

1 component(s)
Fixed Versions:
2.67.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cli/cli/v2
Go
≥ 2.49.0
< 2.67.0
2.67.0

References

Frequently Asked Questions

What is CVE-2025-25204?
CVE-2025-25204 is a security vulnerability in Github.com/cli/cli/v2 involving `gh attestation verify` returns incorrect exit code during verification if no attestations are present under CWE-390: Detection of Error Condition Without Action.
Which Github.com/cli/cli/v2 versions are affected?
Affected versions include releases prior to 2.67.0 across affected packages: github.com/cli/cli/v2.
What version fixes CVE-2025-25204?
Upgrading to 2.67.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/cli/cli/v2 affected?
Yes, github.com/cli/cli/v2 is affected in releases prior to 2.67.0. Upgrade your dependency to 2.67.0 or later.
What is the CVSS score of CVE-2025-25204?
CVE-2025-25204 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:H/A:N.
What CWE is associated with CVE-2025-25204?
CVE-2025-25204 is classified under CWE-390: Detection of Error Condition Without Action (The product detects a specific error, but takes no actions to handle the error.).
How can I check Go dependencies for CVE-2025-25204?
Run the dependency tree command: 'inspect dependencies for github.com/cli/cli/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fgw4-v983-mgp8",
  "modified" : "2025-02-14T18:40:04Z",
  "published" : "2025-02-14T17:19:14Z",
  "aliases" : [ "CVE-2025-25204" ],
  "summary" : "`gh attestation verify` returns incorrect exit code during verification if no attestations are present",
  "details" : "### Summary\n\nA 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.\n\nUsers are advised to update `gh` to version `v2.67.0` as soon as possible.\n\nInitial report: https://github.com/cli/cli/issues/10418\nFix: https://github.com/cli/cli/pull/10421\n\n### Details\n\nThe 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.\n\nDue 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.\n\n### PoC\n\nRun `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.\n\n### Impact\n\nUsers 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cli/cli/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.49.0"
      }, {
        "fixed" : "2.67.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cli/cli/security/advisories/GHSA-fgw4-v983-mgp8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-25204"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cli/cli/issues/10418"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cli/cli/pull/10421"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cli/cli"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-390" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-14T17:19:14Z",
    "nvd_published_at" : "2025-02-14T17:15:19Z"
  }
}