Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-25204 Overview
CVE-2025-25204 affects gh, GitHub's official command line tool. Versions starting at 2.49.0 and prior to 2.67.0 contain a flaw in the gh attestation verify subcommand. Under certain conditions, the tool returns a zero exit status when no attestations exist for a given artifact. A zero exit status conventionally signals success, so downstream automation treats the artifact as verified. Attackers can abuse this behavior to slip malicious artifacts through deployment pipelines that rely on gh attestation verify exit codes as a gate. The maintainers assigned CWE-390: Detection of Error Condition Without Action and released the fix in v2.67.0.
Critical Impact
Deployment pipelines that use gh attestation verify as a gatekeeper may accept unsigned or unattested artifacts as verified, enabling supply chain compromise.
Affected Products
- GitHub CLI (gh) versions 2.49.0 through 2.66.x
- CI/CD pipelines using gh attestation verify in gating logic
- GitHub Actions workflows invoking the affected gh subcommand for artifact attestation checks
Discovery Timeline
- 2025-02-14 - CVE-2025-25204 published to the National Vulnerability Database
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-25204
Vulnerability Analysis
GitHub Artifact Attestations let publishers cryptographically sign build artifacts and let consumers verify provenance. The gh attestation verify subcommand performs that check from the command line. The subcommand is designed to exit with a non-zero status when verification fails, matching POSIX conventions used by shell scripts and CI systems.
In the affected versions, the subcommand returns exit status 0 when no attestations are present for the artifact under review. Callers cannot distinguish that outcome from a successful verification. Automation that pipes the exit code into conditional deployment logic will treat an unattested artifact as trusted. This turns a supply-chain integrity control into a silent pass.
The issue is classified under CWE-390, which covers error conditions detected but not acted upon. The command detects the absence of attestations but fails to propagate that state as a failure signal.
Root Cause
The root cause lies in the exit-code handling path when the attestation lookup returns an empty set. Instead of treating "no attestations found" as verification failure, the subcommand returns success. The upstream fix in Pull Request #10421 corrects this by returning a non-zero exit status when zero attestations are located for the target artifact.
Attack Vector
An attacker with the ability to publish or substitute an artifact consumed by a pipeline that uses gh attestation verify for gating can bypass the control. The attacker does not need to forge an attestation. They only need to ensure that no attestation exists for the malicious artifact. The verify command exits with status 0, and the pipeline proceeds to deploy or promote the artifact. Exploitation requires the victim environment to depend on the exit code as its enforcement mechanism, which is the documented usage pattern. See the GitHub Security Advisory GHSA-fgw4-v983-mgp8 for full technical detail.
Detection Methods for CVE-2025-25204
Indicators of Compromise
- Deployment events for artifacts that have no corresponding entry in the GitHub Artifact Attestations API
- CI logs showing gh attestation verify returning exit code 0 without a matching "attestation verified" success message in stdout
- Release or promotion pipelines using gh versions between 2.49.0 and 2.66.x that touched production between those release dates
Detection Strategies
- Inventory all CI/CD systems, container build hosts, and developer workstations for installed gh versions and flag any within the vulnerable range.
- Audit pipeline definitions (GitHub Actions, Jenkins, GitLab CI) for calls to gh attestation verify and confirm the caller also parses stdout, not just the exit code.
- Cross-reference deployed artifact digests against the attestations API to identify artifacts promoted without a valid attestation record.
Monitoring Recommendations
- Alert on invocations of gh attestation verify from hosts running gh older than v2.67.0.
- Log and retain full stdout and stderr from attestation verification steps so post-hoc review can confirm attestation presence.
- Track artifact provenance metadata in a centralized data store and reconcile deployment records against it on a scheduled basis.
How to Mitigate CVE-2025-25204
Immediate Actions Required
- Upgrade gh to version 2.67.0 or later on every workstation, build agent, and container image that runs gh attestation verify.
- Audit recent deployments performed by pipelines that used a vulnerable gh version and re-verify artifact provenance out of band.
- Update GitHub Actions workflows that install gh via actions/setup-gh or package managers to pin the patched version.
Patch Information
The fix ships in GitHub CLI v2.67.0. Details are tracked in GitHub Issue #10418 and merged via Pull Request #10421. The patched build makes gh attestation verify return a non-zero exit status when no attestations are present.
Workarounds
- Parse the stdout of gh attestation verify and fail the pipeline unless a success message is explicitly present, rather than relying on exit code alone.
- Add a secondary gate that queries the GitHub Attestations API directly and fails if the artifact digest returns zero attestations.
- Restrict which identities can push artifacts to registries consumed by gated pipelines until all gh installations are patched.
# Configuration example: enforce patched gh version and validate stdout
gh --version | awk '/gh version/ {split($3,v,"."); if (v[1]<2 || (v[1]==2 && v[2]<67)) {print "gh too old"; exit 1}}'
OUTPUT=$(gh attestation verify "oci://$REGISTRY/$IMAGE@$DIGEST" --repo "$OWNER/$REPO" 2>&1)
STATUS=$?
if [ $STATUS -ne 0 ] || ! echo "$OUTPUT" | grep -q "Verification succeeded"; then
echo "Attestation verification failed for $DIGEST"
exit 1
fi
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

