See how shadow compares to other vendors in security performance
Hi Alexander, Date: 2026-11-24 18:29:43+0100 From: Solar Designer <solar () openwall com>
On Sun, Nov 22, 2026 at 10:22:56PM +0100, Alejandro Colomar wrote: I've released publicly shadow-4.20.4 a moment ago. Below are the details about the security issues (from the previous email, to linux-distros@).
The release is available at <https://github.com/shadow-maint/shadow/releases/tag/4.20.4>. Thanks! Looks like this is CVE-2026-135901:
https://bugzilla.redhat.com/showbug.cgi?id=2583156 Thanks! Quoting from there: CVE-2026-135901 shadow-utils: shadow-utils: newgidmap and newuidmap improperly validate file descriptor location, allowing local file corruption via bind mount
OSIDB Bzimport 2026-11-24 11:34:55 UTC
The newgidmap and newuidmap helper utilities accept a directory file descriptor identifying a target process's /proc/<pid>/ directory, and validate that this descriptor refers to the procfs filesystem by comparing device numbers (stdev/strdev) against a known procfs path. After this check, the utilities open a file (for example "setgroups") by name relative to that directory descriptor and write privileged uid/gid mapping data to it.
An unprivileged local user can defeat this validation using Linux user and mount namespaces: by bind-mounting an arbitrary, attacker-chosen file over the expected child path inside a procfs directory they hold a descriptor to, the device-number check (which only inspects the directory itself) still passes, while the subsequent open-by-name resolves through the bind mount to the attacker's chosen file instead of the intended procfs file. This redirects the helper's privileged write, resulting in the first five bytes of the attacker-chosen file being overwritten with the fixed content "deny\n".
This was reported publicly, with a working proof of concept demonstrating the primitive against a SUID-root build of newgidmap, and fixed upstream in shadow 4.20.4 by using openat2(2) with RESOLVENOXDEV for path resolution and by removing the affected "fd:N" argument form entirely. I guess "reported publicly" refers to: I guess the same.
Report, affected lines, a suggested fix (fstat the opened setgroups FD, or openat2 with RESOLVENOXDEV) and the PoC are here:
<https://gist.github.com/DicksonWu654/cdad661068d6a50da475aac57a9f07f2>
Happy to test a fix or answer questions whenever it's useful.
Best, Dickson which didn't appear to draw any attention before the release. Yup; I was a bit confused by the report coming encrypted but having a link to a public github page with the report. We kept it embargoed because
1) The issue wasn't too critical, so even if some people might have found that, I don't think they could do much harm.
2) There were some chances that nobody had found that link. Hopefully, the reporter didn't share that link with other people.
3) If we went public before having a fix, we'd have given that link more publicity.
Have a lovely night! Alex Alexander -- <https://www.alejandro-colomar.es>
shadow: Security fix for newgidmap
shadow-utils (aka shadow) 4.4 through 4.17.0 establishes a default /etc/subuid behavior (e.g., uid 100000 through 165535 for the first user account) that can realistically conflict with the uids of users defined on locally administered networks, potentially leading to account takeover, e.g., by leveraging newuidmap for access to an NFS home directory (or same-host resources in the case of remote logins by these local network users). NOTE: it may also be argued that system administrators should not have assigned uids, within local networks, that are within the range that can occur in /etc/subuid.
The newgidmap and newuidmap helper utilities accept a directory file descriptor identifying a target process's /proc/<pid>/ directory, and validate that this descriptor refers to the procfs filesystem by comparing device numbers (stdev/strdev) against a known procfs path. After this check, the utilities open a file (for example "setgroups") by name relative to that directory descriptor and write privileged uid/gid mapping data to it.
An unprivileged local user can defeat this validation using Linux user and mount namespaces: by bind-mounting an arbitrary, attacker-chosen file over the expected child path inside a procfs directory they hold a descriptor to, the device-number check (which only inspects the directory itself) still passes, while the subsequent open-by-name resolves through the bind mount to the attacker's chosen file instead of the intended procfs file. This redirects the helper's privileged write, resulting in the first five bytes of the attacker-chosen file being overwritten with the fixed content "deny\n".
This was reported publicly, with a working proof of concept demonstrating the primitive against a SUID-root build of newgidmap, and fixed upstream in shadow 4.20.4 by using openat2(2) with RESOLVENOXDEV for path resolution and by removing the affected "fd:N" argument form entirely.
Hi!
I've released publicly shadow-4.20.4 a moment ago. Below are the details about the security issues (from the previous email, to linux-distros@).
The release is available at <https://github.com/shadow-maint/shadow/releases/tag/4.20.4>.
Have a lovely night! Alex Date: 2026-11-14 23:23:41+0100 From: Alejandro Colomar <alx () kernel org>
Hi!
Below goes the original bug report. Date: Fri, 6 Nov 2026 20:43:45 -0500 From: Dickson Wu <dickson.wu () certik com> To: alx () kernel org, ipedrosa () redhat com, serge () hallyn com Subject: Security report: newgidmap (encrypted) Message-ID: <CAFaZ9eqJ18S7PsVj5Rj9wustfU2eNZrGqXp4AJD1+yROc1u3Q () mail gmail com>
Hi Alejandro, Iker and Serge,
I'm reporting a local issue in newgidmap, following SECURITY.md (encrypted to the three keys listed there).
newgidmap fd:N checks that the passed directory FD is on the procfs device, then opens "setgroups" relative to it with ORDWR as root and writes "deny\n". An unprivileged user can, inside their own user and mount namespace, bind-mount a root-owned file over setgroups under a task directory of the host procfs and pass that directory FD back to newgidmap. The device check passes because the directory itself is still on procfs, and the first five bytes of the target file become "deny\n". Mapping the caller's own GID is enough to reach writesetgroups(), so no subgid entry is needed, and the later gidmap failure doesn't undo the write.
I reproduced it on the 4.20.3 release with the helper installed SUID root and a disposable root-owned 0600 file: the first five bytes changed and the rest of the file, owner and mode stayed the same, while a fresh-procfs control was rejected and left its file untouched. getpid.c and newgidmap.c are the same on current master. It's a fixed five-byte write at offset 0, so I'd call it a local integrity/DoS issue rather than code execution.
Report, affected lines, a suggested fix (fstat the opened setgroups FD, or openat2 with RESOLVENOXDEV) and the PoC are here:
<https://gist.github.com/DicksonWu654/cdad661068d6a50da475aac57a9f07f2>
Happy to test a fix or answer questions whenever it's useful.
Best, Dickson We worked on this patch set of two patches (sent as replies to this mail), which applies on top of the 4.20.3 release to fix the bug. If you need help backporting it to older versions, let me know (but I think it should be relatively easy).
Let's use an embargo of 1 week, so let's disclose on 2026-11-22.
I haven't encrypted this patch set, since we've already been discussing it unencrypted, and it's also not critical.
Have a lovely night! Alex
Serge E. Hallyn (2): lib/idmapping.c, src/newidmap.c: Use openat2(2) for safety src/new[gu]idmap.c: Drop fd:N
lib/Makefile.am | 2 ++ lib/atoi/getnum.c | 1 - lib/atoi/getnum.h | 9 --------- lib/fs/open/open.c | 48 +++++++++++++++++++++++++++++++++++++++++++++ lib/fs/open/open.h | 16 +++++++++++++++ lib/getpid.c | 32 ------------------------------ lib/idmapping.c | 3 ++- lib/prototypes.h | 1 - man/newgidmap.1.xml | 11 ----------- man/newuidmap.1.xml | 11 ----------- src/newgidmap.c | 20 +++++++------------ src/newuidmap.c | 17 ++++------------ 12 files changed, 79 insertions(+), 92 deletions(-) create mode 100644 lib/fs/open/open.c create mode 100644 lib/fs/open/open.h
-- 2.55.0 -- <https://www.alejandro-colomar.es>
On 03/06/2025 06:05, Solar Designer wrote: With the PID range reduced from the default of 4M down to 2K, PID reuse is quick even with simple fork(). I am getting frequent unixchkpwd coredumps (without password hashes in them, which is as expected without inotify), but none of them are getting ACLs set for read by the user (unexpected - I thought I'd win this easier race once in a while), e.g.: I admit I didn't look very closely at the specifics of this bug but maybe you could use a setpid() technique like this one?
""" newgrp: fix potential string injection
Since newgrp is setuid-root, any write() system calls it does in order to print error messages will be done as the root user.
Unprivileged users can get newgrp to print essentially arbitrary strings to any open file in this way by passing those strings as argv[0] when calling execve(). For example: $ setpid 31000 $ readlink /proc/self 31001
This is not a vulnerability in newgrp; it is a bug in the Linux kernel.
However, this type of bug is not new [1] and it makes sense to try to mitigate these types of bugs in userspace where possible.
[1]: https://lwn.net/Articles/476947/ """
https://github.com/shadow-maint/shadow/commit/9df4801e0b65073cc8a9031b22a73532ef7fdc2c
Vegard