An issue was discovered in shadow 4.5. newgidmap (in shadow-utils) is setuid and allows an unprivileged user to be placed in a user namespace where setgroups(2) is permitted. This allows an attacker to remove themselves from a supplementary group, which may allow access to certain filesystem paths if the administrator has used "group blacklisting" (e.g., chmod g-rwx) to restrict access to paths. This flaw effectively reverts a security feature in the kernel (in particular, the /proc/self/setgroups knob) to prevent this sort of privilege escalation. Bug report: https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1729357 Upstream patch: https://github.com/shadow-maint/shadow/pull/97
Created shadow-utils tracking bugs for this issue: Affects: fedora-all [bug 1546242]
There is an ongoing effort upstream to make newgidmap more configurable and let the administrator choose which users can use setgroups(2) in the user namespace. https://github.com/shadow-maint/shadow/pull/99
Statement: This issue did not affect the versions of shadow-utils as shipped with Red Hat Enterprise Linux 5, 6 and 7 as they did not provide newgidmap program.