Sanaan Fayaz Wani

portainer/portainer

GHSA-jmr9-98g4-2phv

Non-admin bind-mount restriction bypass via Docker local-driver volumes and automatic Git redeploy (incomplete fix of CVE-2026-44849 and CVE-2026-44850)

GHSA-jmr9-98g4-2phv

9.4

Critical

CVSS 4.0 base

  1. 2026-10-08Published by the maintainer

What to do

If you run 2.40.0 to before 2.45.2, upgrade to 2.45.2 or later.
If you run 2.39.0 and later, no fixed version is listed in the advisory.

Anyone who can reach it over the network, with a low-privilege account and no user interaction, can read and change sensitive data and make it unavailable, and other systems are affected too.Read from the CVSS 4.0 vector

CVSS 4.0 metrics

To exploit it

Attack vector
Network
Attack complexity
Low
Attack requirements
None
Privileges required
Low
User interaction
None

What it gets

Confidentiality
High
Integrity
High
Availability
High

Other systems

Confidentiality
High
Integrity
High
Availability
High

Open this vector in the FIRST calculator ↗

Weakness
CWE-284 Improper Access Control
CVE
not assigned
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

My analysis of this finding: root cause, the vulnerable code, the impact and the fix, in the site’s format. The official advisory of record is linked above.

Affected versions

Package Ecosystem Vulnerable Fixed in
github.com/portainer/portainer go >= 2.40.0, < 2.45.2 2.45.2
github.com/portainer/portainer go >= 2.39.0 n/a

Summary

Portainer lets administrators disable bind mounts for regular users through the AllowBindMountsForRegularUsers endpoint security setting. The container creation proxy enforces that setting, but it only understands one of the two ways Docker can create a bind mount. A regular user can smuggle a host bind mount past the check by describing it as a Type: "volume" mount whose local driver config requests type=bind, mounting any path from the Docker host into their container. This is the same class of bypass that was fixed for Swarm services but never carried over to plain container creation.

Where it lives

The container creation decorator parses an intentionally narrow view of the request body. In api/http/proxy/factory/docker/containers.go, the Mounts entries are reduced to a single field:

Mounts      []struct {    Type string `json:"Type"`} `json:"Mounts"`

The bugmounts are parsed down to the Type field only

and the enforcement loop only rejects the mount when that field is the literal string bind:

if !securitySettings.AllowBindMountsForRegularUsers && len(partialContainer.HostConfig.Mounts) > 0 {    for _, mount := range partialContainer.HostConfig.Mounts {        if mount.Type == "bind" {            return forbiddenResponse, ErrBindMountsForbidden

The bugonly rejects mounts literally typed bind

VolumeOptions.DriverConfig.Options is never parsed, so a mount declared as Type: "volume" sails through. The sibling code for Swarm services, in api/http/proxy/factory/docker/services.go, already knows about this trick. Its partialServiceSpec parses the nested struct and checks it explicitly:

VolumeOptions *struct {
    DriverConfig *struct {
        Options map[string]string `json:"Options"`
    } `json:"DriverConfig"`
} `json:"VolumeOptions"`
...
if mount.VolumeOptions != nil && mount.VolumeOptions.DriverConfig != nil {
    if mount.VolumeOptions.DriverConfig.Options["type"] == "bind" {

The fix existed in one path and was simply absent in the other.

Impact

A regular Portainer user with endpoint access, on an endpoint where bind mounts are supposed to be forbidden, posts a container create request whose mount is Type: "volume" with DriverConfig.Options of type=bind, device=/, o=bind. Docker’s local volume driver turns that into a bind mount of the host root into the container. I confirmed this against v2.42.0: a container reading /hostroot/etc/shadow returned the real host file.

root:*:20535:0:99999:7:::
daemon:*:20535:0:99999:7:::
bin:*:20535:0:99999:7:::

From there the user has full read and write access to the host filesystem, including /root/.ssh, the Docker socket, and everything else, which is a complete escape of the restriction and of the container boundary. The affected range covers >= 2.33.0 through 2.42.0, every then current release.

Fix

Teach the container path the same thing the service path already knows. Extend the Mounts struct with the VolumeOptions.DriverConfig.Options map and reject any mount whose Options["type"] is bind, in addition to the existing Type == "bind" check. The same validation belongs in the Docker Compose stack path so stacks cannot reintroduce the bypass.

The record

Weakness
CWE-284 Improper Access Control
Affected
portainer 2.40.0 to before 2.45.2fixed in 2.45.2portainer 2.39.0 and laterno fix listed
Disclosure
2026-10-08 Published
Advisory
GHSA-jmr9-98g4-2phv

About this writeup

Sanaan Fayaz Wani (GitHub sfwani) reported this vulnerability to the portainer maintainers under coordinated disclosure and is credited as a reporter in GHSA-jmr9-98g4-2phv, published 2026-10-08.

All published findings: advisory index.