CVE-2026-44882: Portainer: Kubernetes middleware continues after token validation failure, bypassing endpoint authorization

Published May 14, 2026
·
Updated

Summary

Portainer proxies requests to Kubernetes clusters through a middleware layer (kubeClientMiddleware) that validates the requesting user's token before forwarding traffic to the cluster. When security.RetrieveTokenData returned an error, the middleware wrote an HTTP 403 response but was missing a return statement — execution continued into the handler with a nil tokenData value.

The Kubernetes endpoints sit behind Portainer's outer AuthenticatedAccess bouncer, so an attacker requires a valid Portainer session. However, a user whose secondary token validation fails in kubeClientMiddleware — for example a user without permission to access a given Kubernetes endpoint — would have their request forwarded to the cluster anyway, bypassing the authorization check. The same defect was present in both the CE and EE codebases.

Severity

High CWE-863 — Incorrect Authorization

Privilege required is Low — any valid Portainer session is sufficient to reach the middleware. Once the authorization outcome is bypassed, the attacker can read and modify Kubernetes resources on the target endpoint that their role should not permit — confidentiality and integrity impact are both High. No availability impact is introduced directly.

Affected Versions

The missing return statement has been present since Kubernetes proxy support was introduced.

| Branch | First vulnerable | Fixed in | |--------------|------------------|------------| | 2.33.x (LTS) | 2.33.0 | 2.33.8 |

Portainer 2.39.0 and later are not affected — the fix was present from the initial 2.39.0 release. All releases prior to 2.33.0 are end-of-life and will not receive a fix; users on EOL versions should upgrade to a supported release.

Workarounds

There is no configuration change that prevents the bypass directly. Administrators who cannot immediately upgrade can reduce exposure by:

- Restricting Kubernetes endpoint access. Remove Portainer access to Kubernetes endpoints for users who do not require it. A user without endpoint access cannot reach kubeClientMiddleware. - Auditing Kubernetes RBAC. Ensure the service account Portainer uses to proxy cluster requests carries least-privilege RBAC permissions — this limits the blast radius if the bypass is exploited.

Neither of these replaces the fix.

Affected Code

kubeClientMiddleware in api/http/handler/kubernetes/handler.go wrote the error response but did not return, allowing execution to continue with nil tokenData:

go // api/http/handler/kubernetes/handler.go (pre-fix — CE and EE) tokenData, err := security.RetrieveTokenData(r) if err != nil { httperror.WriteError(w, http.StatusForbidden, "permission denied to access the environment", err) // missing return — tokenData is nil, execution continues }

// tokenData.ID dereferenced on the next line: , ok := handler.KubernetesClientFactory.GetProxyKubeClient( strconv.Itoa(endpointID), strconv.Itoa(int(tokenData.ID))) The fix adds a single return after the WriteError call in both CE and EE:

go // post-fix if err != nil { httperror.WriteError(w, http.StatusForbidden, "permission denied to access the environment", err) return }

Impact - Kubernetes authorization bypass. A low-privileged Portainer user can reach Kubernetes API endpoints on environments their role does not permit, with the proxy client of the legitimate session used as the vehicle. - Cluster resource access. Depending on the service account permissions Portainer holds on the cluster, the attacker can read or modify namespaced resources — including pods, secrets, config maps, and deployments. - Potential for lateral movement. Kubernetes secrets readable through this path may contain credentials for other services within the cluster or the broader infrastructure.

Timeline - 2026-02-16: Fix merged to develop. - 2026-02-25: 2.39.0 released with fix. - 2026-05-07: 2.33.8 released with backport fix.

Other sources

Portainer Community Edition is a lightweight service delivery platform for containerized applications that can be used to manage Docker, Swarm, Kubernetes and ACI environments. From 2.33.0 to before 2.33., Portainer proxies requests to Kubernetes clusters through a middleware layer (kubeClientMiddleware) that validates the requesting user's token before forwarding traffic to the cluster. When security.RetrieveTokenData returned an error, the middleware wrote an HTTP 403 response but was missing a return statement — execution continued into the handler with a nil tokenData value. The Kubernetes endpoints sit behind Portainer's outer AuthenticatedAccess bouncer, so an attacker requires a valid Portainer session. However, a user whose secondary token validation fails in kubeClientMiddleware — for example a user without permission to access a given Kubernetes endpoint — would have their request forwarded to the cluster anyway, bypassing the authorization check. The same defect was present in both the CE and EE codebases. This vulnerability is fixed in 2.33.8.

— MITRE

Affected Software

2 affected componentsFixes available
go/github.com/portainer/portainer>=2.33.0<2.33.8
2.33.8
Portainer Portainer>=2.33.0<2.33.8

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 2.33.8
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.33.8
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.39.0
  4. Compensating control

    Audit Kubernetes RBAC and ensure the service account Portainer uses to proxy cluster requests carries least-privilege RBAC permissions to limit blast radius if the bypass is exploited.

  5. Compensating control

    Restrict Kubernetes endpoint access in Portainer: remove Portainer access to Kubernetes endpoints for users who do not require it.

Event History

May 14, 2026
Advisory Published
via GitHub·04:24 PM
Data Sourced
via GitHub·04:24 PM
DescriptionSeverityWeaknessAffected Software
May 28, 2026
CVE Published
via MITRE·09:01 PM
Data Sourced
via MITRE·09:01 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:16 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-44882?

CVE-2026-44882 has a high severity level due to potential unauthorized access to Kubernetes clusters.

2

What versions are affected by CVE-2026-44882?

CVE-2026-44882 affects Portainer versions from 2.33.0 to 2.33.8 inclusive.

3

How do I fix CVE-2026-44882?

To fix CVE-2026-44882, upgrade to Portainer version 2.33.8 or later.

4

What is the main issue with CVE-2026-44882?

CVE-2026-44882 allows for improper token handling, leading to potential unauthorized kubeClient access.

5

Is there a workaround for CVE-2026-44882 before upgrading?

No official workarounds for CVE-2026-44882 are recommended; upgrading is the only mitigation.

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