Summary
A flaw in Portainer's environment-level "Disable bind mounts for non-administrators" control allows non-admin users to bypass mount restrictions by using the HostConfig.Mounts field instead of the legacy HostConfig.Binds array when creating containers.
In affected versions, any authenticated user with container-creation rights on a restricted Docker environment can still bind arbitrary host paths into their containers, undermining host isolation and access control policies.
Affected context
This vulnerability affects Portainer Community Edition deployments managing Docker environments where:
- The environment-level setting "Disable bind mounts for non-administrators" is enabled, and
- Non-admin users are allowed to create containers through Portainer's Docker API proxy.
The issue arises specifically in the container-create path, where only HostConfig.Binds was inspected for restricted bind mounts, while equivalent bind-typed entries supplied via HostConfig.Mounts were not subject to the same authorization checks.
Exploit preconditions
- Attack surface: Portainer's Docker environment container-create API, accessed via the Portainer UI or API.
- Required access: Authenticated Portainer user with permissions to create containers on a Docker environment where bind mounts are supposed to be disabled for non-admins.
- Trigger point: Submitting a container creation request that includes bind-typed entries in HostConfig.Mounts instead of (or in addition to) HostConfig.Binds.
- Why exploitation is possible: The authorization logic only evaluated HostConfig.Binds for disallowed bind mounts and neglected to apply equivalent checks to HostConfig.Mounts, leaving a pathway for non-admins to achieve the same effect through a different but semantically equivalent configuration field.
Why this happens
At its core, this issue is an authorization logic flaw where security checks are applied inconsistently across equivalent configuration paths.
The Portainer proxy enforced the "Disable bind mounts for non-administrators" policy only against the legacy HostConfig.Binds array and failed to treat HostConfig.Mounts as an equivalent source of bind mount requests.
This maps to CWE-863: Incorrect Authorization, where authorization is either incomplete or not enforced on all relevant resources or code paths.
Instead of centralizing policy enforcement around the abstract concept of "host bind mounts," the logic was tightly coupled to a specific field, allowing policy bypass whenever the same capability was expressed via an alternate, but functionally identical, data structure.
Potential impact
- Non-admin users may mount arbitrary host filesystem paths into their containers.
- Access to sensitive host files such as configuration files, secrets, logs, or application data.
- Potential credential theft or access to Docker daemon-related artifacts stored on the host.
- Lateral movement or privilege escalation by abusing data obtained from the host filesystem.
- Weakening of isolation guarantees assumed by administrators when configuring Portainer restrictions.
General mitigation guidance
Mitigations generally focus on making authorization checks capability-centric rather than field-centric and tightening host access:
- Apply authorization logic to all API fields and code paths that can result in host bind mounts, including both HostConfig.Binds and HostConfig.Mounts, as well as any future equivalents.
- Centralize policy decisions around "what can this user do?" (e.g., "may use host bind mounts at all?") instead of checking only specific legacy structures.
- Treat host filesystem access as a privileged operation and limit which roles or teams can create containers with any form of host mounts.
- Use least-privilege role design in Portainer, ensuring that non-admin roles only have container-creation permissions in environments where such access is acceptable even if isolation controls were to fail.
- Complement application-level policies with Docker and host-level hardening (e.g., limiting which paths the Docker daemon may mount, and separating sensitive data into restricted locations).
How teams detect issues like this
Detection efforts can focus on both configuration and behavioral signals:
- Configuration review: Manually or with tooling, inspect Portainer's container creation proxy code or configuration to ensure all mount-related fields undergo the same authorization checks.
- Static analysis: Use static analysis or policy-as-code tools to flag authorization checks that are narrowly tied to a single field (e.g., checks against HostConfig.Binds only) rather than generalized capability checks.
- Audit logging: Enable and monitor Portainer and Docker daemon logs for non-admin users creating containers with host mounts, particularly via HostConfig.Mounts; treat unexpected host path mounts as indicators of abuse.
- Runtime policies: Employ container security platforms or admission controllers that enforce policies on container specifications (such as disallowing hostPath/bind mounts for non-privileged users) independently of Portainer's internal controls.

