CVE-2021-21284: privilege escalation in Moby
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 security@docker.com
Other sources
Docker could allow a remote authenticated attacker to gain elevated privileges on the system, caused by a flaw when using the --userns-remap option. By sending a specially-crafted request, an authenticated attacker could exploit this vulnerability to gain elevated privileges as root on the system.
In Docker before versions 9.03.15, 20.10.3 there is a vulnerability involving the --userns-remap option in which access to remapped root allows privilege escalation to real root. 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. Versions 20.10.3 and 19.03.15 contain patches that prevent privilege escalation from remapped user.
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the vulnerability ID for this Docker vulnerability?
The vulnerability ID for this Docker vulnerability is CVE-2021-21284.
What versions of Docker are affected by this vulnerability?
Versions before 9.03.15 and 20.10.3 of Docker are affected by this vulnerability.
What is the impact of this vulnerability?
This vulnerability allows privilege escalation to real root if the root user in the remapped namespace has access to the host filesystem.
How can I fix this vulnerability?
To fix this vulnerability, update Docker to version 9.03.15 or 20.10.3.
Where can I find more information about this vulnerability?
More information about this vulnerability can be found in the following references: [GitHub Advisory](https://github.com/moby/moby/security/advisories/GHSA-7452-xqpj-6rpc), [GitHub Commit 1](https://github.com/moby/moby/commit/1342c51d5e809d2994e6f7e490c8d2b3b12c28ae), [GitHub Commit 2](https://github.com/moby/moby/commit/5eff67a2c294b7e72607e0949ebc0de21710e4d3).