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

> The GitHub CLI incorrectly reports success when attestations are missing, allowing attackers to bypass deployment gates and install malicious artifacts.

- **Severity:** Medium 6.3 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Feb 2025
- **Updated:** 3 Mar 2025
- **Also known as:** AZL-56885, GHSA-fgw4-v983-mgp8, GO-2025-3467

## What is CVE-2025-25204?

CVE-2025-25204 is a medium-severity vulnerability in cli, published on 14 Feb 2025. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

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

Weakness: CWE-390 (Detection of Error Condition Without Action)

## Which versions are affected by CVE-2025-25204?

4 open source packages ship an affected version, including github.com/cli/cli/v2 and github.com/cli/cli.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/cli/cli/v2` | Go | From 2.49.0 | 2.67.0 |
| `github.com/cli/cli/v2` | Go | From 2.49.0 | 2.67.0 |
| `github.com/cli/cli/v2` | Go | From 2.49.0 | 2.67.0 |
| `github.com/cli/cli` | Go | All versions | None |

## How do I fix CVE-2025-25204?

Upgrade github.com/cli/cli/v2 to 2.67.0 or later.

## Is CVE-2025-25204 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-25204 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-25204 and fix it if it is affected.

What it is: CVE-2025-25204 is a medium-severity vulnerability in cli, published on 14 Feb 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-25204 exists.

Affected packages and fixed versions:
- github.com/cli/cli/v2 (Go): affected from 2.49.0; fixed in 2.67.0
- github.com/cli/cli/v2 (Go): affected from 2.49.0; fixed in 2.67.0
- github.com/cli/cli/v2 (Go): affected from 2.49.0; fixed in 2.67.0
- github.com/cli/cli (Go): affected all versions; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-25204/ (Markdown: https://insights.sbomify.com/CVE-2025-25204/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-25204
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-25204
- OSV: https://osv.dev/vulnerability/CVE-2025-25204

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-25204/
Summaries are generated and may contain mistakes; the official description above is the record.
