All vulnerabilities

Servers and applications

GHSA-6c57-xm2f-23fg

WebSocket attach and exec let users open a shell in containers they cannot access

Severity
Medium 6.5
Published
19 Nov 2026
Last changed
19 Nov 2026
Added to UpHeron
19 Nov 2026
Fixed in
2.39.9, 2.45.4, 3.1.0
Weakness
Improper authorization (CWE-285)Authorization bypass through a user-controlled key (IDOR) (CWE-639)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Read some data · Change some data · Slow it down
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:H/SI:H/SA:H
Sources
Project advisories (GitHub)

Description

Portainer exposes interactive container streams over a WebSocket API: GET /api/websocket/attach attaches to a running container's stdin/stdout/stderr, and GET /api/websocket/exec starts an exec session inside a container. Both handlers authorise only at the environment level — they confirm the caller may operate on the environment, then hijack a raw connection straight to the Docker socket — and never apply the per-container resource-control (ownership) check that the equivalent Docker HTTP proxy routes enforce. Any authenticated user holding the lowest-privilege Standard user role, with access to an environment, can therefore obtain an interactive root session in any container in that environment, including containers owned by other users or teams and protected by resource controls.

On the attach path the target container is identified by an ID validated only as a hexadecimal string with no minimum length, and Docker resolves ID prefixes, so a caller who does not already know a…

From portainer/portainer's security advisory. Shortened; the full text is there.

Workarounds

Administrators who cannot immediately upgrade can reduce exposure by:

  • Treating environment access as full container access. Grant access to an environment only to users you would trust with every container in it; the WebSocket attach and exec paths currently ignore per-container ownership.
  • Separating untrusted tenants into distinct environments. Do not co-locate mutually-untrusting users or teams in a single environment — put them behind separate endpoints so there are no foreign containers to reach.
  • Auditing attach and exec activity.
Workarounds as given by portainer/portainer's security advisory.

Affected software

SoftwareAffected versions
PortainerServers and applications · github:portainer/portainer
  • From 2.39.0 before 2.39.9
  • From 2.40.0 before 2.45.4
  • From 3.0.0 before 3.1.0

About Portainer

Open source software to manage Docker, docker swarm and Kubernetes

From Wikidata, CC0 1.0.
Docker Hub pulls
1,590,442,292Docker Hub, 15 Nov 2026
GitHub stars
38,831GitHub, 15 Nov 2026
Forks
2,940GitHub, 15 Nov 2026
Latest release
2.45.3GitHub, 15 Nov 2026
Released
21 Oct 2026GitHub
License
ZlibGitHub
First published on GitHub
19 May 2016GitHub

References