CVE-2026-118763: @sigstore/oci sends the registry Authorization header to a cross-host blob-upload Location
@sigstore/oci up to 0.7.1 sends the registry Authorization header to whatever host a registry names in a blob-upload Location header. A malicious or impersonated registry can capture the push credential (basic username and password, or a bearer token) when you attach an artifact with attachArtifactToImage(). Upgrade to 0.7.2.
Published Oct 30, 2026 · Analysis Oct 31, 2026
What an attacker can do
In packages/oci/src/registry.ts, signIn() installs the credential as a default header on the shared fetch client. uploadBlob() then reads the Location header from the registry's response. If the value starts with a slash it is joined to the registry base URL. Otherwise it goes to new URL() unchanged, so an absolute URL can point to any host. The blob is PUT to that URL with the same client, and the default Authorization header goes along. Custom headers from the Docker config (creds.headers) also go along.
The fetch library strips Authorization on cross-host redirects it follows itself. That does not help, because this PUT is a fresh explicit call, not a followed redirect.
The attacker must control or impersonate the registry, or sit where a registry redirects uploads to third-party storage. The victim must push an artifact or attestation. The prize is a registry credential: a raw username:password for basic auth, or a bearer token. The reporter traced this from source and did not run a push against a hostile registry. It is a residual of the earlier credential-confusion advisory, whose fix changed only credential selection in credentials.ts.
Who is affected
The npm package @sigstore/oci at version 0.7.1 and earlier is affected. Code paths that call attachArtifactToImage(), including tools built on it such as the sigstore CLI attach command, push through the vulnerable upload path.
Check your install:
npm ls @sigstore/ociThe package may arrive as a transitive dependency, so check lockfiles of tools that attach signatures or attestations to OCI images.
@sigstore/oci
- Ecosystem
- npm
- Affected
- <= 0.7.1
- Fixed in
- 0.7.2
- Check
npm ls @sigstore/oci
How to fix it
Upgrade to @sigstore/oci 0.7.2.
npm install @sigstore/[email protected]The 0.7.2 release notes I read describe exact host matching for Docker credential selection, and do not mention the upload Location path. The sigstore-js pull request 1762 ("Harden OCI registry request handling") says redirect and auth-header handling is applied more consistently across hops, and that requests default to HTTPS and public destinations. Confirm for yourself that your installed version is 0.7.2 or later. Rotate any registry credential you used against a registry you do not trust.
How to tell if you were hit
Review the registry's upload responses: a Location header that names a host other than the registry host is the trigger. In network logs from CI or developer machines running attach or sign steps, look for PUT requests to blob-upload URLs on unexpected hosts, especially with an Authorization header. Check registry audit logs for use of your push credential from unfamiliar IP addresses. Rotate tokens if a push went through an untrusted or compromised registry.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
@sigstore/oci sends the registry Authorization header to a cross-host blob-upload Location
Affected versions and vulnerable location
- Confirmed on sigstore-js at
3a83271(current HEAD). - File:
packages/oci/src/registry.ts. signIn()installs the credential as a DEFAULT header on the shared client:this.#fetch = this.#fetch.defaults({ headers: { [HEADER_AUTHORIZATION]: 'Basic ' + basicAuth } })(:126-128) or... 'Bearer ' + token(:145-147), pluscreds.headersfrom the Docker config (:104).uploadBlob()reads theLocationresponse header (:184), buildsuploadLocation = new URL(location.startsWith('/') ? this.#baseURL + location : location)(:190-192), and PUTs the blob to it through the same client:await this.#fetch(uploadLocation.href, { method: 'PUT', body: blob, headers: { [HEADER_CONTENT_TYPE]: ... } })(:198).- There is no check that
uploadLocation's host (or scheme) equals the registry host before the PUT is sent.
Root cause
Because signIn() sets Authorization via .defaults(), it is attached to every request the client issues, including requests to a host the client read out of a server response. When a POST to .../blobs/uploads/ returns an absolute Location pointing to a different host, uploadBlob() PUTs the blob there with the registry Authorization header still attached. If the challenge scheme was basic, that header carries the raw registry username:password; if bearer, it carries the access token; creds.headers custom auth headers ride along too.
The library's HTTP layer (make-fetch-happen / minipass-fetch) strips Authorization on cross-host redirects it follows internally, which protects the HEAD ... { redirect: 'follow' } at :167. It does not help here, because the PUT to the upload Location is a fresh, explicit this.#fetch() call, not a followed redirect, so the default header is applied unconditionally.
This is a residual of GHSA-pf56-329r-95rw / CVE-2026-59891 (credential confusion in @sigstore/oci). The fix for that advisory (commit 85c5838) changed only credentials.ts, replacing a key.includes(registry) substring match with an exact host match when SELECTING which Docker credential to load. It never touched registry.ts, which controls WHERE the loaded credential is sent. The cross-host send remains.
Attacker model
A user pushing a signed artifact/attestation to an OCI registry via attachArtifactToImage(). The credential leaks to any host the registry names in the blob-upload Location. This is reachable when the registry is malicious or compromised, or when a registry that legitimately redirects blob uploads to third-party storage is impersonated. The OCI distribution spec permits absolute upload Location values (registries commonly redirect blob storage to a separate host), so a compliant-but-hostile registry can steer the PUT to an attacker host and capture the credential. This is the same "attacker-controlled registry" threat model accepted for GHSA-pf56.
Reachability trace
index.ts:43 attachArtifactToImage() -> new OCIImage(...).addArtifact() -> image.ts:67 this.#client.signIn(credentials) (installs the default Authorization header) -> image.ts:76/79 this.#client.uploadBlob(...) -> registry.ts:198 PUT to the response-supplied Location with the default Authorization header attached. Same RegistryClient instance throughout, so the default persists.
Reproduction
Source-verified. No live push against a hostile registry was executed in this pass. Confirmed:
rg -n "defaults\(|HEADER_AUTHORIZATION|Location|new URL\(|this.#fetch\(uploadLocation" packages/oci/src/registry.ts
git log --oneline -3 -- packages/oci/src/credentials.ts packages/oci/src/registry.tssignIn() sets Authorization via .defaults(); uploadBlob() PUTs to uploadLocation.href (which may be an absolute cross-host URL) with no host check; the GHSA-pf56 fix commit is the latest change to credentials.ts, while registry.ts has only dependency bumps since.
Suggested fix
Do not send the registry Authorization (or creds.headers) to an upload Location on a different host. Compare uploadLocation.host (and require https) against the registry host before the PUT; if it differs, issue the PUT without the credential (matching how registries that redirect to pre-signed storage URLs expect the upload to be unauthenticated), or explicitly re-authenticate for that host. More generally, avoid attaching the credential via a client-wide .defaults() and instead attach it per-request only to the registry host.
How it was found and a note on tooling
Every place @sigstore/oci was traced to attach a credential to an outbound request and checked whether the request host can be steered by a server response. The blob-upload Location path attaches the client-default Authorization to a PUT whose host comes from the registry response, with no host-equality check, and the GHSA-pf56 fix touched only the credential-selection code, not this send path. I used AI assistance for the trace and drafting and manually verified the cited lines and the fix scope at HEAD 3a83271. Verification is source-only; I did not execute a push against a hostile registry.
Independent re-verification at HEAD (2026-07-31)
Re-read at HEAD 3a83271. Unchanged, and the two halves sit in the same file:
126-127: this.#fetch = this.#fetch.defaults({ headers: { [HEADER_AUTHORIZATION]: `Basic ${basicAuth}` } })
145-146: this.#fetch = this.#fetch.defaults({ headers: { [HEADER_AUTHORIZATION]: `Bearer ${token}` } })
104: this.#fetch = this.#fetch.defaults({ headers: creds.headers })and in uploadBlob():
const uploadLocation = new URL(
location.startsWith('/') ? `${this.#baseURL}${location}` : location
);
...
await this.#fetch(uploadLocation.href, { method: 'PUT', ... });The ternary is the whole issue. A relative Location is anchored to #baseURL, but an absolute one is passed to new URL() verbatim, so its host is whatever the registry response said. There is no comparison against the registry host or scheme before the PUT, and because the credential was installed with .defaults() rather than passed per-request, it is attached automatically.
Worth separating from the redirect case: the HEAD at the top of uploadBlob() uses redirect: 'follow', and the fetch layer does strip Authorization across hosts on redirects it follows itself. That protection does not apply here, because the PUT is a fresh explicit call the library makes to a URL it parsed out of a response body header, not a redirect being followed.
This has not been executed against a hostile registry, so the leak is traced from the source rather than observed on the wire. The control flow above is unambiguous, but it is better to state the limit than imply a packet capture that has not been created.
Credited to arpitjain099.
Questions
- Which @sigstore/oci versions are affected by CVE-2026-118763?
Version 0.7.1 and earlier. The patched version is 0.7.2.
- Does the attacker need to compromise my machine?
No. They need to run or impersonate the registry you push to, and you must push an artifact through attachArtifactToImage(). The registry steers the blob PUT to the attacker's host.
- Is it exploited in the wild?
No source says so, and there is no KEV entry. The reporter verified the flaw from source only and did not run a push against a hostile registry.
- How does this relate to the earlier @sigstore/oci credential advisory?
That fix changed credentials.ts so the right Docker credential is selected by exact host match. It did not change registry.ts, which decides where the loaded credential is sent, so this cross-host send remained.
References
Read for this analysis:
- https://github.com/sigstore/sigstore-js/releases/tag/@sigstore/[email protected]
- https://github.com/sigstore/sigstore-js/pull/1762
- https://github.com/sigstore/sigstore-js/security/advisories/GHSA-j63v-mwhm-56jx
- https://nvd.nist.gov/vuln/detail/CVE-2026-118763
- https://github.com/sigstore/sigstore-js/commit/b855f46cfe81f26481c6d3f4b333dfd00f2fd1b1
- https://github.com/sigstore/sigstore-js/commit/e4ca65c3ab3c675456ab9b0bd04217ceccad3558
- https://github.com/advisories/GHSA-j63v-mwhm-56jx
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
