# CVE-2026-59891: Credential confusion in @sigstore/oci can leak registry credentials to an attacker-controlled registry

> An attacker can leak registry credentials by exploiting substring matching in credential selection, allowing access to sensitive authentication data.

- **Severity:** Critical 9.6 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 14 Jul 2026
- **Updated:** 21 Jul 2026
- **Also known as:** GHSA-pf56-329r-95rw

## What is CVE-2026-59891?

CVE-2026-59891 is a critical vulnerability in sigstore-js, published on 14 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

sigstore-js provides JavaScript libraries for interacting with Sigstore services. Prior to 0.7.1, getRegistryCredentials() reads credentials from the Docker config file and selects an entry by checking whether any configured auth key contains the target registry string. Because this is a substring match rather than an exact host match, credentials configured for one registry can be selected for and transmitted to a different registry whose hostname has a substring relationship with a configured auth key. This issue is fixed in version 0.7.1.

Weakness: CWE-522 (Insufficiently Protected Credentials)

## Which versions are affected by CVE-2026-59891?

2 open source packages ship an affected version, including @sigstore/oci.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@sigstore/oci` | npm | All versions | 0.7.1 |
| `@sigstore/oci` | npm | All versions | 0.7.1 |

## How do I fix CVE-2026-59891?

Upgrade @sigstore/oci to 0.7.1 or later.

## Is CVE-2026-59891 being exploited?

There is no known exploitation of CVE-2026-59891 in the wild and no public exploit code.

Public exploit code:

- Isolated regression and security-control lab for CVE-2026-59891 in @sigstore/oci (github_poc): https://github.com/gyubin02/cve-2026-59891-control-lab

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-59891 and fix it if it is affected.

What it is: CVE-2026-59891 is a critical vulnerability in sigstore-js, published on 14 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-59891 in the wild and no public exploit code.

Affected packages and fixed versions:
- @sigstore/oci (npm): affected all versions; fixed in 0.7.1
- @sigstore/oci (npm): affected all versions; fixed in 0.7.1

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

## Sources

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

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