Vulnerabilities in pkg:npm/@sigstore/oci

PACKAGE
Advisory Identifier: GHSA-pf56-329r-95rw
Advisory Summary

CVE-2026-59891 is a CRITICAL (CVSS 9.6) credential confusion vulnerability (CWE-522: Insufficiently Protected Credentials) affecting @sigstore/oci libraries in the npm ecosystem. The issue involves credential confusion in @sigstore/oci can leak registry credentials to an attacker-controlled registry. Remediation is available by upgrading affected packages to version 0.7.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@sigstore/oci

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@sigstore/oci. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-pf56-329r-95rw CVE-2026-59891 CRITICAL Credential confusion in @sigstore/oci can leak registry credentials to an attacker-controlled registry

CVE-2026-59891 at a Glance

CVE Identifier CVE-2026-59891
GHSA Identifier GHSA-pf56-329r-95rw
Severity CRITICAL
CVSS v3.1 Base Score 9.6
CWE Classification CWE-522: Insufficiently Protected Credentials
Affected Product @sigstore/oci
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.6

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

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

How to Fix CVE-2026-59891

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

@sigstore/oci fixed: 0.7.1
npm install @sigstore/oci@0.7.1
Verify Direct and Transitive Dependencies

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

npm ls @sigstore/oci

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-59891, inspect your project dependencies using npm:

npm ls @sigstore/oci

Analyze the terminal output to locate any version of @sigstore/oci in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.1), your application is affected.

Note: The npm ls @sigstore/oci command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In @sigstore/oci, 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

### Impact This is a credential-exposure / credential-confusion issue. `getRegistryCredentials()` reads credentials from the Docker config file (`~/.docker/config.json`) and selects an entry by checking whether any configured auth key **contains** the target registry string: ```js Object.keys(dockerConfig.auths || {}).find((key) => key.includes(registry)) ``` 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 (for example, an attacker-controlled `cr.io` matches a configured `ghcr.io`). **Who is impacted:** Any consumer of `@sigstore/oci` that uploads artifacts to an OCI registry using credentials from a Docker config, where the destination registry/image reference can be influenced by an untrusted party. This includes `@actions/attest` and the `actions/attest`, `actions/attest-build-provenance`, and `actions/attest-sbom` GitHub Actions when run with `push-to-registry: true`, where the `subject-name` input determines the destination registry. This is classified as a **critical** vulnerability given the potential, in a theoretical worst-case scenario, to expose long-lived registry credentials. However, in practice, exploitation requires all of the following: - The Docker config on the host contains credentials for a registry. - The destination registry/image reference is influenced by an untrusted source. - The attacker controls a registry whose hostname is a substring of (or is otherwise contained within) a configured Docker auth key. Under those conditions, registry credentials present on the host (e.g. a GHCR, Docker Hub, or cloud-registry token) can be sent to an attacker-controlled registry during the authentication exchange. ### Patches Fixed in **`@sigstore/oci@0.7.1`**. Credential selection now requires an **exact host match**: both the target registry and each Docker auth key are canonicalized — stripping any `https?://` scheme and path and normalizing the Docker Hub aliases (`index.docker.io` / `registry-1.docker.io` / `docker.io`) — and compared for equality. When no exact match exists, credential lookup now fails rather than falling back to an unrelated credential. - **Affected versions:** `<= 0.7.0` (all releases from `0.1.0`). - **Patched version:** `0.7.1`. Downstream consumers should pick up the patched `@sigstore/oci`; subsequent releases of `@actions/attest` and the `actions/attest*` GitHub Actions will bundle the fix. ### Workarounds - Treat the destination registry/image reference as trusted input — do not allow untrusted sources to influence the registry/image reference passed to `@sigstore/oci` (or the `subject-name` of `actions/attest*` when `push-to-registry: true`). - Limit the credentials available in the host's Docker config to only those required for the operation, and avoid authenticating to registries whose hostnames have substring relationships with potential untrusted destinations. - Scope registry tokens narrowly and prefer short-lived credentials.

CVE-2026-59891 Affected @sigstore/oci Versions

1 component(s)
Fixed Versions:
0.7.1
Product / Package Ecosystem Affected Versions Fixed Version
@sigstore/oci
npm
< 0.7.1
0.7.1

References

Frequently Asked Questions

What is CVE-2026-59891?
CVE-2026-59891 is a security vulnerability in @sigstore/oci involving Credential confusion in @sigstore/oci can leak registry credentials to an attacker-controlled registry under CWE-522: Insufficiently Protected Credentials.
Which @sigstore/oci versions are affected?
Affected versions include releases prior to 0.7.1 across affected packages: @sigstore/oci.
What version fixes CVE-2026-59891?
Upgrading to 0.7.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @sigstore/oci affected?
Yes, @sigstore/oci is affected in releases prior to 0.7.1. Upgrade your dependency to 0.7.1 or later.
What is the CVSS score of CVE-2026-59891?
CVE-2026-59891 has a CVSS v3.1 base score of 9.6 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-59891?
CVE-2026-59891 is classified under CWE-522: Insufficiently Protected Credentials (The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.).
How can I check npm dependencies for CVE-2026-59891?
Run the dependency tree command: 'npm ls @sigstore/oci'. 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-pf56-329r-95rw",
  "modified" : "2026-07-21T19:34:05Z",
  "published" : "2026-07-21T19:34:05Z",
  "aliases" : [ "CVE-2026-59891" ],
  "summary" : "Credential confusion in @sigstore/oci can leak registry credentials to an attacker-controlled registry",
  "details" : "### Impact\n\nThis is a credential-exposure / credential-confusion issue.\n\n`getRegistryCredentials()` reads credentials from the Docker config file (`~/.docker/config.json`) and selects an entry by checking whether any configured auth key **contains** the target registry string:\n\n```js\nObject.keys(dockerConfig.auths || {}).find((key) => key.includes(registry))\n```\n\nBecause 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 (for example, an attacker-controlled `cr.io` matches a configured `ghcr.io`).\n\n**Who is impacted:** Any consumer of `@sigstore/oci` that uploads artifacts to an OCI registry using credentials from a Docker config, where the destination registry/image reference can be influenced by an untrusted party. This includes `@actions/attest` and the `actions/attest`, `actions/attest-build-provenance`, and `actions/attest-sbom` GitHub Actions when run with `push-to-registry: true`, where the `subject-name` input determines the destination registry.\n\nThis is classified as a **critical** vulnerability given the potential, in a theoretical worst-case scenario, to expose long-lived registry credentials. However, in practice, exploitation requires all of the following:\n\n- The Docker config on the host contains credentials for a registry.\n- The destination registry/image reference is influenced by an untrusted source.\n- The attacker controls a registry whose hostname is a substring of (or is otherwise contained within) a configured Docker auth key.\n\nUnder those conditions, registry credentials present on the host (e.g. a GHCR, Docker Hub, or cloud-registry token) can be sent to an attacker-controlled registry during the authentication exchange.\n\n### Patches\n\nFixed in **`@sigstore/oci@0.7.1`**. Credential selection now requires an **exact host match**: both the target registry and each Docker auth key are canonicalized — stripping any `https?://` scheme and path and normalizing the Docker Hub aliases (`index.docker.io` / `registry-1.docker.io` / `docker.io`) — and compared for equality. When no exact match exists, credential lookup now fails rather than falling back to an unrelated credential.\n\n- **Affected versions:** `<= 0.7.0` (all releases from `0.1.0`).\n- **Patched version:** `0.7.1`.\n\nDownstream consumers should pick up the patched `@sigstore/oci`; subsequent releases of `@actions/attest` and the `actions/attest*` GitHub Actions will bundle the fix.\n\n### Workarounds\n\n- Treat the destination registry/image reference as trusted input — do not allow untrusted sources to influence the registry/image reference passed to `@sigstore/oci` (or the `subject-name` of `actions/attest*` when `push-to-registry: true`).\n- Limit the credentials available in the host's Docker config to only those required for the operation, and avoid authenticating to registries whose hostnames have substring relationships with potential untrusted destinations.\n- Scope registry tokens narrowly and prefer short-lived credentials.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@sigstore/oci"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.7.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sigstore/sigstore-js/security/advisories/GHSA-pf56-329r-95rw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-59891"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sigstore/sigstore-js/commit/85c58380758b97ce1b74ef470e55cc21f9d3aa89"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sigstore/sigstore-js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sigstore/sigstore-js/releases/tag/%40sigstore%2Foci%400.7.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-522" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-21T19:34:05Z",
    "nvd_published_at" : "2026-07-14T17:17:15Z"
  }
}