# CVE-2024-51746: Use of incorrect Rekor entries during verification in gitsign

> Attackers with valid ephemeral keys can bypass signature verification by exploiting incorrect Rekor entry selection during online validation.

- **Severity:** Low 1.8 (`CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 5 Nov 2024
- **Updated:** 5 Nov 2024
- **Also known as:** GHSA-8pmp-678w-c8xx, GO-2024-3252

## What is CVE-2024-51746?

CVE-2024-51746 is a low-severity vulnerability in sigstore gitsign, published on 5 Nov 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

Gitsign is a keyless Sigstore to signing tool for Git commits with your a GitHub / OIDC identity. gitsign may select the wrong Rekor entry to use during online verification when multiple entries are returned by the log. gitsign uses Rekor's search API to fetch entries that apply to a signature being verified. The parameters used for the search are the public key and the payload. The search API returns entries that match either condition rather than both. When gitsign's credential cache is used, there can be multiple entries that use the same ephemeral keypair / signing certificate. As gitsign assumes both conditions are matched by Rekor, there is no additional validation that the entry's hash matches the payload being verified, meaning that the wrong entry can be used to successfully pass verification. Impact is minimal as while gitsign does not match the payload against the entry, it does ensure that the certificate matches. This would need to be exploited during the certificate validity window (10 minutes) by the key holder.

Weakness: CWE-706 (Use of Incorrectly-Resolved Name or Reference)

## Which versions are affected by CVE-2024-51746?

3 open source packages ship an affected version, including github.com/sigstore/gitsign.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/sigstore/gitsign` | Go | All versions | 0.11.0 |
| `github.com/sigstore/gitsign` | Go | All versions | 0.11.0 |
| `github.com/sigstore/gitsign` | Go | All versions | 0.11.0 |

## How do I fix CVE-2024-51746?

Upgrade github.com/sigstore/gitsign to 0.11.0 or later.

## Is CVE-2024-51746 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-51746 and fix it if it is affected.

What it is: CVE-2024-51746 is a low-severity vulnerability in sigstore gitsign, published on 5 Nov 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-51746 exists.

Affected packages and fixed versions:
- github.com/sigstore/gitsign (Go): affected all versions; fixed in 0.11.0
- github.com/sigstore/gitsign (Go): affected all versions; fixed in 0.11.0
- github.com/sigstore/gitsign (Go): affected all versions; fixed in 0.11.0

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-2024-51746/ (Markdown: https://insights.sbomify.com/CVE-2024-51746/index.md)
```

## Sources

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

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