CVE-2021-21284: moby Access to remapped root allows privilege escalation to real root
Impact When using --userns-remap, if the root user in the remapped namespace has access to the host filesystem they can modify files under /var/lib/docker/ that cause writing files with extended privileges. Patches Versions 20.10.3 and 19.03.15 contain patches that prevent privilege escalation from remapped user. Credits Maintainers would like to thank Alex Chapman for discovering the vulnerability;
Published Jan 31, 2024 · Updated Jun 10, 2024
Affected packages
github.com/moby/moby
- Ecosystem
- Go
- Affected
- < 19.3.15
- Fixed in
- 19.3.15
- Check
go list -m github.com/moby/moby
github.com/moby/moby
- Ecosystem
- Go
- Affected
- >= 20.10.0-beta1, < 20.10.3
- Fixed in
- 20.10.3
- Check
go list -m github.com/moby/moby
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
When using --userns-remap, if the root user in the remapped namespace has access to the host filesystem they can modify files under /var/lib/docker/<remapping> that cause writing files with extended privileges.
Patches
Versions 20.10.3 and 19.03.15 contain patches that prevent privilege escalation from remapped user.
Credits
Maintainers would like to thank Alex Chapman for discovering the vulnerability; @awprice, @nathanburrell, @raulgomis, @chris-walz, @erin-jensby, @bassmatt, @mark-adams, @dbaxa for working on it and Zac Ellis for responsibly disclosing it to [email protected]
Credited to ajxchapman, awprice, nathanburrell, raulgomis, chris-walz, mark-adams, dbaxa, cpuguy83, neersighted.
References
- https://github.com/moby/moby/security/advisories/GHSA-7452-xqpj-6rpc
- https://nvd.nist.gov/vuln/detail/CVE-2021-21284
- https://github.com/moby/moby/commit/64bd4485b3a66a597c02c95f5776395e540b2c7c
- https://docs.docker.com/engine/release-notes/#20103
- https://github.com/moby/moby/releases/tag/v19.03.15
- https://github.com/moby/moby/releases/tag/v20.10.3
- https://security.gentoo.org/glsa/202107-23
- https://www.debian.org/security/2021/dsa-4865
- https://security.netapp.com/advisory/ntap-20210226-0005
- https://github.com/advisories/GHSA-7452-xqpj-6rpc
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-41567
Docker: `PUT /containers/{id}/archive` executes container binary on the host
high7.2No fixMay 18, 2026CVE-2026-41568
Docker: Race condition in docker cp allows creation of arbitrary empty files on the host via symlink swap
medium6.1No fixMay 18, 2026CVE-2026-42306
Docker: Race condition in docker cp allows bind mount redirection to host path
high7.2No fixMay 18, 2026CVE-2026-33997
Moby has an Off-by-one error in its plugin privilege validation
medium6.8No fixMar 27, 2026CVE-2026-34040
Moby has AuthZ plugin bypass when provided oversized request bodies
high8.8Mar 27, 2026CVE-2024-36620
NULL Pointer Dereference on moby image history
medium6.5Nov 29, 2024
