Executive brief
Portainer is a management platform for Docker and Kubernetes environments. A security flaw allowed sensitive login tokens to be passed in web addresses (URLs), which are often recorded in server logs, browser history, and shared links. If an attacker obtains one of these leaked tokens, they can take full control of the victim's account, potentially allowing them to manipulate or shut down critical container infrastructure.
Technical details
Portainer's authentication middleware (specifically in `api/http/security/bouncer.go`) was configured to accept JWT bearer tokens via the `?token=` URL query parameter. Because URLs are frequently logged by reverse proxies, stored in browser history, and transmitted in `Referer` headers during outbound navigation, these sensitive tokens could be intercepted by unauthorized parties. An attacker who obtains a leaked JWT can achieve full account takeover for the duration of the token's validity. The vulnerability was particularly prevalent in features using WebSockets, such as container console (exec) and shell attaches. The fix removes query-parameter token acceptance in favor of the `Authorization` header and HttpOnly cookies.
Affected products
- Portainer Portainer >= 2.33.0, < 2.33.8; >= 2.39.0, < 2.39.2; >= 2.40.0, < 2.41.0
Timeline
- 2026-03-06: disclosed: Reported via GitHub Security Advisory by scanpwn
- 2026-04-14: patched: Fix merged to develop branch
- 2026-04-29: advisory: Version 2.41.0 released
- 2026-05-07: advisory: LTS versions 2.39.2 and 2.33.8 released