shadow-utils 4.20.4 fixes a local newgidmap/newuidmap bug that could overwrite the first five bytes of a root-owned file
- The
newgidmap fd:Npath checked that a caller-supplied directory file descriptor was on procfs, then openedsetgroupsrelative to it as root and wrotedeny\n. Maintainer Alejandro Colomar, posting the original report from Dickson Wu of Certik, says an unprivileged user in their own user and mount namespace could arrange for that write to land on a different root-owned file while still passing the device check. - Mapping the caller's own GID was enough to reach the write, so no subgid entry was required. The reporter described a fixed five-byte write at offset 0 and called it a local integrity or denial-of-service issue rather than code execution.
- The 4.20.4 release, published Nov 22 after a one-week embargo, uses
openat2(2)so the helper will not follow symlinks or bind mounts, and it drops thefd:Ninterface. The same change applies tonewuidmap. - The advisories do not assign a CVE. Action: upgrade shadow-utils to 4.20.4, or apply the maintainer's patches to 4.20.3, and prefer distro packages once they ship.
Sources: oss-security: Alejandro Colomar, shadow 4.20.4 and newgidmap security fix (Nov 22, 2026) · shadow-maint/shadow release 4.20.4 (Nov 22, 2026)