CVE-2026-33540: Github.com/distribution/distribution/v3 Distribution Affected By Pull-through Cache Vulnerability

HIGH
Advisory Identifier: GHSA-3p65-76g6-3w7r
CVSS 7.5
CWE-918
Published
Advisory Summary

CVE-2026-33540 is a HIGH (CVSS 7.5) distribution affected by pull-through cache vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Github.com/distribution/distribution/v3 libraries in the Go ecosystem. The issue involves distribution affected by pull-through cache credential exfiltration via www-authenticate bearer realm. Remediation is available by upgrading affected packages to version 3.1.0.

CVE-2026-33540 at a Glance

CVE Identifier CVE-2026-33540
GHSA Identifier GHSA-3p65-76g6-3w7r
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Github.com/distribution/distribution/v3
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/S:U/C:H/I:N/A:N).

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

How to Fix CVE-2026-33540

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

github.com/distribution/distribution/v3 fixed: 3.1.0
Upgrade github.com/distribution/distribution/v3 to 3.1.0
github.com/distribution/distribution fixed: Latest secure release
Upgrade github.com/distribution/distribution to Latest secure release
Verify Direct and Transitive Dependencies

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

inspect dependencies for github.com/distribution/distribution/v3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-33540, inspect your project dependencies for Github.com/distribution/distribution/v3:

inspect dependencies for github.com/distribution/distribution/v3

Analyze the terminal output to locate any version of Github.com/distribution/distribution/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Github.com/distribution/distribution/v3, 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

hi guys, commit: 40594bd98e6d6ed993b5c6021c93fdf96d2e5851 (as-of 2026-01-31) contact: GitHub Security Advisory (https://github.com/distribution/distribution/security/advisories/new) ## summary in pull-through cache mode, distribution discovers token auth endpoints by parsing `WWW-Authenticate` challenges returned by the configured upstream registry. the `realm` URL from a bearer challenge is used without validating that it matches the upstream registry host. as a result, an attacker-controlled upstream (or an attacker with MitM position to the upstream) can cause distribution to send the configured upstream credentials via basic auth to an attacker-controlled `realm` URL. this is the same vulnerability class as CVE-2020-15157 (containerd), but in distribution’s pull-through cache proxy auth flow. ## severity HIGH note: the baseline impact is credential disclosure of the configured upstream credentials. if a deployment uses broader credentials for upstream auth (for example cloud iam credentials), the downstream impact can be higher; i am not claiming this as default for all deployments. ## impact credential exfiltration of the upstream authentication material configured for the pull-through cache. attacker starting positions that make this realistic: - supply chain / configuration: an operator configures a proxy cache to use an upstream that becomes attacker-controlled (compromised registry, stale domain, or a malicious mirror) - network: MitM on the upstream connection in environments where the upstream is reachable over insecure transport or a compromised network path ## affected components - `registry/proxy/proxyauth.go:66-81` (`getAuthURLs`): extracts bearer `realm` from upstream `WWW-Authenticate` without validating destination - `internal/client/auth/session.go:485-510` (`fetchToken`): uses the realm URL directly for token fetch - `internal/client/auth/session.go:429-434` (`fetchTokenWithBasicAuth`): sends credentials via basic auth to the realm URL ## reproduction attachment: `poc.zip` (local harness) with canonical and control runs. the harness is local and does not contact a real registry: it uses two local HTTP servers (upstream + attacker token service) to demonstrate whether basic auth is sent to an attacker-chosen realm. ```bash unzip -q -o poc.zip -d poc cd poc make canonical make control ``` expected output (excerpt): ``` [CALLSITE_HIT]: getAuthURLs::configureAuth [PROOF_MARKER]: basic_auth_sent=true realm_host=127.0.0.1 account_param=user authorization_prefix=Basic ``` control output (excerpt): ``` [CALLSITE_HIT]: getAuthURLs::configureAuth [NC_MARKER]: realm_validation=PASS basic_auth_sent=false ``` ## suggested remediation validate that the token `realm` destination is within the intended trust boundary before associating credentials with it or sending any authentication to it. one conservative option is strict same-host binding: only accept a realm whose host matches the configured upstream host. ## fix accepted when - distribution does not send configured upstream credentials to an attacker-chosen realm URL - a regression test covers the canonical and blocked cases [addendum.md](https://github.com/user-attachments/files/24984637/addendum.md) [poc.zip](https://github.com/user-attachments/files/24984638/poc.zip) [PR_DESCRIPTION.md](https://github.com/user-attachments/files/24984639/PR_DESCRIPTION.md) [RUNNABLE_POC.md](https://github.com/user-attachments/files/24984640/RUNNABLE_POC.md) best, oleh

CVE-2026-33540 Affected Github.com/distribution/distribution/v3 Versions

2 component(s)
Fixed Versions:
3.1.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/distribution/distribution/v3
Go
< 3.1.0
3.1.0
github.com/distribution/distribution
Go
≤ 2.8.3

References

Frequently Asked Questions

What is CVE-2026-33540?
CVE-2026-33540 is a security vulnerability in Github.com/distribution/distribution/v3 involving Distribution affected by pull-through cache credential exfiltration via www-authenticate bearer realm under CWE-918: Server-Side Request Forgery (SSRF).
Which Github.com/distribution/distribution/v3 versions are affected?
Affected versions include releases prior to 3.1.0 across affected packages: github.com/distribution/distribution/v3, github.com/distribution/distribution.
What version fixes CVE-2026-33540?
Upgrading to 3.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/distribution/distribution/v3 affected?
Yes, github.com/distribution/distribution/v3 is affected in releases prior to 3.1.0. Upgrade your dependency to 3.1.0 or later.
Is github.com/distribution/distribution affected?
Yes, github.com/distribution/distribution is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-33540?
CVE-2026-33540 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-33540?
CVE-2026-33540 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Go dependencies for CVE-2026-33540?
Run the dependency tree command: 'inspect dependencies for github.com/distribution/distribution/v3'. 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-3p65-76g6-3w7r",
  "modified" : "2026-04-06T23:42:43Z",
  "published" : "2026-04-06T17:52:52Z",
  "aliases" : [ "CVE-2026-33540" ],
  "summary" : "Distribution affected by pull-through cache credential exfiltration via www-authenticate bearer realm",
  "details" : "hi guys,\n\ncommit: 40594bd98e6d6ed993b5c6021c93fdf96d2e5851 (as-of 2026-01-31)\ncontact: GitHub Security Advisory (https://github.com/distribution/distribution/security/advisories/new)\n\n## summary\n\nin pull-through cache mode, distribution discovers token auth endpoints by parsing `WWW-Authenticate` challenges returned by the configured upstream registry. the `realm` URL from a bearer challenge is used without validating that it matches the upstream registry host. as a result, an attacker-controlled upstream (or an attacker with MitM position to the upstream) can cause distribution to send the configured upstream credentials via basic auth to an attacker-controlled `realm` URL.\n\nthis is the same vulnerability class as CVE-2020-15157 (containerd), but in distribution’s pull-through cache proxy auth flow.\n\n## severity\n\nHIGH\n\nnote: the baseline impact is credential disclosure of the configured upstream credentials. if a deployment uses broader credentials for upstream auth (for example cloud iam credentials), the downstream impact can be higher; i am not claiming this as default for all deployments.\n\n## impact\n\ncredential exfiltration of the upstream authentication material configured for the pull-through cache.\n\nattacker starting positions that make this realistic:\n- supply chain / configuration: an operator configures a proxy cache to use an upstream that becomes attacker-controlled (compromised registry, stale domain, or a malicious mirror)\n- network: MitM on the upstream connection in environments where the upstream is reachable over insecure transport or a compromised network path\n\n## affected components\n\n- `registry/proxy/proxyauth.go:66-81` (`getAuthURLs`): extracts bearer `realm` from upstream `WWW-Authenticate` without validating destination\n- `internal/client/auth/session.go:485-510` (`fetchToken`): uses the realm URL directly for token fetch\n- `internal/client/auth/session.go:429-434` (`fetchTokenWithBasicAuth`): sends credentials via basic auth to the realm URL\n\n## reproduction\n\nattachment: `poc.zip` (local harness) with canonical and control runs.\n\nthe harness is local and does not contact a real registry: it uses two local HTTP servers (upstream + attacker token service) to demonstrate whether basic auth is sent to an attacker-chosen realm.\n\n```bash\nunzip -q -o poc.zip -d poc\ncd poc\nmake canonical\nmake control\n```\n\nexpected output (excerpt):\n\n```\n[CALLSITE_HIT]: getAuthURLs::configureAuth\n[PROOF_MARKER]: basic_auth_sent=true realm_host=127.0.0.1 account_param=user authorization_prefix=Basic\n```\n\ncontrol output (excerpt):\n\n```\n[CALLSITE_HIT]: getAuthURLs::configureAuth\n[NC_MARKER]: realm_validation=PASS basic_auth_sent=false\n```\n\n## suggested remediation\n\nvalidate that the token `realm` destination is within the intended trust boundary before associating credentials with it or sending any authentication to it. one conservative option is strict same-host binding: only accept a realm whose host matches the configured upstream host.\n\n## fix accepted when\n\n- distribution does not send configured upstream credentials to an attacker-chosen realm URL\n- a regression test covers the canonical and blocked cases\n\n[addendum.md](https://github.com/user-attachments/files/24984637/addendum.md)\n[poc.zip](https://github.com/user-attachments/files/24984638/poc.zip)\n[PR_DESCRIPTION.md](https://github.com/user-attachments/files/24984639/PR_DESCRIPTION.md)\n[RUNNABLE_POC.md](https://github.com/user-attachments/files/24984640/RUNNABLE_POC.md)\n\n\nbest,\noleh",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/distribution/distribution/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/distribution/distribution"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.8.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/distribution/distribution/security/advisories/GHSA-3p65-76g6-3w7r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33540"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/distribution/distribution/commit/cc5d5fa4ba02157501e6afa2cc6a903ad0338e7b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/distribution/distribution"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-06T17:52:52Z",
    "nvd_published_at" : "2026-04-06T15:17:10Z"
  }
}