freenode
Security & Cryptography

Shadow 4.20.4 fixes local file corruption in newuidmap and newgidmap

CVE-2026-135901 let an unprivileged user redirect a privileged five-byte write through a bind mount in user and mount namespaces.

Shadow 4.20.4 closes CVE-2026-135901, a local integrity flaw in the setuid-root helpers newuidmap and newgidmap. An unprivileged user could overwrite the first five bytes of a chosen file with the fixed string "deny\n", without changing the rest of the file, its owner, or its mode. Maintainer Alejandro Colomar published the release on 22 November 2026. Solar Designer later matched the issue to the CVE on the oss-security list.

The helpers accept a directory file descriptor meant to identify a process's procfs entry and check only that the directory itself sits on procfs. They then open a child name such as setgroups relative to that descriptor and write mapping data as root. Dickson Wu of CertiK reported that, inside a user and mount namespace, an attacker can bind-mount an arbitrary file over that child name. The directory check still passes, but the open follows the mount and the privileged write lands on the attacker's file. Mapping the caller's own group is enough to reach the write, and a later mapping failure does not undo it. Wu reproduced it against the 4.20.3 setuid build and described it as local integrity and denial of service, not code execution.

The 4.20.4 fix resolves those paths with openat2 and RESOLVE_NO_XDEV, which refuses to cross a mount point, and drops the affected fd:N argument form entirely.