CVE-2026-33540: Distribution affected by pull-through cache credential exfiltration via www-authenticate bearer realm

Published Apr 6, 2026
·
Updated

Distribution is a toolkit to pack, ship, store, and deliver container content. Prior to 3.1.0, 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 vulnerability is fixed in 3.1.0.

Other sources

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

[CALLSITEHIT]: getAuthURLs::configureAuth [PROOFMARKER]: basicauthsent=true realmhost=127.0.0.1 accountparam=user authorizationprefix=Basic

control output (excerpt):

[CALLSITEHIT]: getAuthURLs::configureAuth [NCMARKER]: realmvalidation=PASS basicauthsent=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 poc.zip PRDESCRIPTION.md RUNNABLEPOC.md

best, oleh

— GitHub

Affected Software

12 affected componentsFixes available
go/github.com/distribution/distribution<=2.8.3
go/github.com/distribution/distribution/v3<3.1.0
3.1.0
Distribution Project Distribution Go<3.1.0
debian/docker-registry<=2.8.2+ds1-1, <=2.8.3+ds1-2
2.8.3+ds1-3
ubuntu/docker-registry*
ubuntu/docker-registry*
ubuntu/docker-registry*
ubuntu/docker-registry*
ubuntu/docker-registry*
ubuntu/docker-registry*
ubuntu/docker-registry*
ubuntu/docker-registry*

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/distribution/distribution/v3 to a version that resolves this vulnerability.

    Fixed in 3.1.0
  2. Upgrade

    Upgrade debian/docker-registry to a version that resolves this vulnerability.

    Fixed in 2.8.3+ds1-3
  3. Upgrade

    Upgrade distribution to a version that resolves this vulnerability.

    Fixed in 3.1.0
  4. Compensating control

    Validate the bearer realm URL against the intended trust boundary before associating credentials with it or sending authentication; a conservative option is to accept only realms whose host matches the configured upstream host.

Event History

Apr 6, 2026
CVE Published
via MITRE·02:55 PM
Data Sourced
via MITRE·02:55 PM
DescriptionSeverityWeakness
Data Sourced
via OSV·03:17 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·03:17 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·05:52 PM
Data Sourced
via GitHub·05:52 PM
DescriptionSeverityWeaknessAffected Software
Updated
via GitHub·11:42 PM
Description
Apr 9, 2026
Data Sourced
via NVD·06:36 PM
Affected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203