All vulnerabilities

Servers and applications

GHSA-m2rf-p268-843w

Stack update lets users take over and overwrite stacks on environments they cannot access

Severity
High 7.1
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
Incorrect authorization (CWE-863)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Change data · Slow it down
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N
Sources
Project advisories (GitHub)

Description

Portainer lets users with stack-management rights update an existing stack through the stack update API, which takes the stack's numeric ID and an endpointId environment parameter. The handler loaded the stack by ID and then overwrote the stack's persisted environment with the request-supplied value before running any authorization. The environment access check and the stack ownership (ResourceControl) check therefore evaluated against the caller's environment rather than the environment the stack actually belongs to. Any authenticated standard user with stack-management rights on one environment could target a stack on an environment they cannot access.

For Compose and Swarm stacks the attacker also creates a stack with the same name on their own environment, which supplies a matching ownership record that satisfies the second check. For Kubernetes stacks no such stack is needed.

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

Workarounds

Administrators who cannot immediately upgrade can reduce exposure by:

  • Limit who can manage stacks. Remove stack-management permissions from standard users on environments where they are not needed. The attack requires stack-management rights on at least one environment.
  • Audit stack ownership. Look for stacks whose recorded environment differs from the environment they were created on, or whose last updater is not the user or team that owns them.
  • Review access to environments. Confirm that standard users and teams only have access to the environments they require.
Workarounds as given by portainer/portainer's security advisory.

Affected software

SoftwareAffected versions
PortainerServers and applications · github:portainer/portainer
  • From 2.5.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