All vulnerabilities

Servers and applications

GHSA-7pww-qg5m-5vpv

Git stack redeploy exposes stored environment variables of stacks on environments the user cannot access

Severity
Medium 6.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
Authorization bypass through a user-controlled key (IDOR) (CWE-639)
Attack
Over the network · Only under certain conditions · Needs a user account · No user action needed
Attacker can
Read data · Change some data · Slow it down
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:L/VA:L/SC:N/SI:N/SA:N
Sources
Project advisories (GitHub)

Description

PUT /api/stacks/{id}/git/redeploy applied the caller-supplied endpointId query parameter to the stored stack before authorizing the environment and looking up the stack's resource control. A standard user with access to one environment could use this to act on a Git-based stack that belongs to a different environment, and to re-associate that stack with their own environment persistently.

On Portainer 2.41.0 and later the same request also disclosed the stack's stored environment variables (Env) in the response, because omitted Env values were retained and returned. On 2.39.x and 2.40.x the stored Env was overwritten rather than returned, so only the cross-environment rebinding applies.

The attack is performed over the network with low complexity and needs no user interaction. The attacker needs a standard account with stack-management rights on one environment and the name and numeric ID of the target stack; no access to the target environment is required, and the same-name stack…

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

Workarounds

None for the API behaviour. Until you can upgrade, limit stack-management rights on environments to users you trust, and avoid sharing Git Sources more widely than needed.

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