CVE-2026-48978: oras-go: Malicious registry can hijack Bearer token realm to exfiltrate credentials and refresh tokens
oras-go’s auth.Client follows the realm URL from a registry’s WWW-Authenticate: Bearer challenge without validating its scheme or host. The realm field is server-controlled by design in the OCI/distribution spec — registries legitimately point token requests at a separate auth endpoint (e.g. Docker Hub’s registry-1.docker.io -> auth.docker.io), so cross-host realms on public DNS names are not in themselves a vulnerability. Two specific patterns, however, are never legitimate under any registry trust model and can be abused by a malicious or compromised registry (or a man-in-the-middle on a plaintext connection):
SSRF to internal networks. A realm of
http://169.254.169.254/...(AWS/Azure IMDS),http://10.0.0.x/...(RFC 1918), orhttp://127.0.0.1/...causes oras-go running on a cloud VM or corporate workstation to issue outbound HTTP requests from inside the user’s trust boundary to an endpoint the user did not choose. The user’s stored credentials are attached to those requests, but the principal harm is the network primitive — probing internal endpoints from the client. On IMDSv1 the response body is recoverable from log channels; on IMDSv2 the probe itself can still be used for service discovery.TLS downgrade. A registry contacted over
https://can return a realm with anhttp://scheme, causing oras-go to send the user’s credentials over plaintext to the token endpoint. This defeats the transport security the user chose when typinghttps://.
References
Code Behaviors & Features
Detect and mitigate CVE-2026-48978 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →