Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. oras.land/oras-go/v2
  4. ›
  5. CVE-2026-48978

CVE-2026-48978: oras-go: Malicious registry can hijack Bearer token realm to exfiltrate credentials and refresh tokens

July 1, 2026

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):

  1. SSRF to internal networks. A realm of http://169.254.169.254/... (AWS/Azure IMDS), http://10.0.0.x/... (RFC 1918), or http://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.

  2. TLS downgrade. A registry contacted over https:// can return a realm with an http:// 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 typing https://.

References

  • github.com/advisories/GHSA-xf85-363p-868w
  • github.com/oras-project/oras-go/commit/7a9f4b0b9558821b0422152ebe21ae56930fe764
  • github.com/oras-project/oras-go/releases/tag/v2.6.1
  • github.com/oras-project/oras-go/security/advisories/GHSA-xf85-363p-868w
  • nvd.nist.gov/vuln/detail/CVE-2026-48978

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 →

Affected versions

All versions before 2.6.1

Fixed versions

  • 2.6.1

Solution

Upgrade to version 2.6.1 or above.

Impact 3.1 LOW

CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-319: Cleartext Transmission of Sensitive Information
  • CWE-918: Server-Side Request Forgery (SSRF)

Source file

go/oras.land/oras-go/v2/CVE-2026-48978.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Mon, 13 Jul 2026 00:19:15 +0000.