Shadow Package Vulnerability Fixed in 4.20.4 Release
A vulnerability in the shadow package's newgidmap utility allows local users to modify the setgroups file without requiring subgid entries. A patch was released in shadow-4.20.4.
LinuxWebOperating systemsEmailKey points
- A vulnerability in the shadow package's newgidmap utility allows unprivileged users to modify the setgroups file under specific conditions.
- The vulnerability was confirmed in the 4.20.3 release of the software and was fixed in shadow-4.20.4.
- The issue is classified as a local integrity or denial-of-service problem, not code execution.
A security flaw was discovered in the newgidmap utility, which is part of the shadow package. This flaw allows unprivileged users to change the setgroups file under certain conditions. The vulnerability occurs when an unprivileged user mounts a root-owned file over setgroups within a task directory on the host's procfs. The user can then pass the directory's file descriptor to newgidmap, potentially enabling unauthorized modifications to the file. Since the directory is still on the procfs device, the device check in newgidmap passes. Exploitation does not require a subgid entry, as mapping their own GID is enough. The flaw was verified in the 4.20.3 version of the software, using a SUID root helper and a temporary root-owned file. The file's owner and permissions remain unchanged, but the first five bytes can be altered. The issue is categorized as a local integrity or denial-of-service problem, not code execution. A fix was developed to address the flaw and was included in the shadow-4.20.4 release. The patch applies to the 4.20.3 version and resolves the issue. The patch set includes two modifications and was sent for review by the maintainers. Dickson Wu provided a proof of concept along with a suggested fix using fstat or openat2 with RESOLVE_NO_XDEV. The vulnerability was reported by Dickson Wu to the shadow project's maintainers. It affects versions of the newgidmap utility before 4.20.4. The flaw was publicly disclosed on 2026-11-22, after a one-week embargo. The patch set was not encrypted, as the discussion had already occurred in an unencrypted format. The patch set includes changes to several files, such as lib/idmapping.c and src/newidmap.c. It also modifies lib/Makefile.am and other related files. The patch set was created by Alejandro Colomar and Serge E. Hallyn. The vulnerability was reported to the maintainers on 2026-11-06. The affected files include get_pid.c, newgidmap.c, and newuidmap.c. The flaw was confirmed to exist in the 4.20.3 version. The fix involves using openat2(2) to prevent unintended file operations. The vulnerability was revealed through the public release of shadow-4.20.4. It is considered a local issue that does not require remote access. The affected product is the shadow package, specifically the newgidmap utility.
What to do
- Update to the shadow-4.20.4 release to address the vulnerability.
- Review the patch set changes to lib/idmapping.c, src/newidmap.c, lib/Makefile.am, and other related files.
- Check for affected files including get_pid.c, newgidmap.c, and newuidmap.c.
Original report
“Re: [PATCH v7 0/2] shadow: Security fix for newgidmap(1)”
Posted by Alejandro Colomar on Nov 22 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
Also reported by
- oss-security: Re: Re: [PATCH v7 0/2] shadow: Security fix for newgidmap(1)
- oss-security: Re: Re: [PATCH v7 0/2] shadow: Security fix for newgidmap(1)
- oss-security: Re: [PATCH v7 0/2] shadow: Security fix for newgidmap(1)
- Debian issues Roundcube fix bundle as CVE identifiers remain pending
- Ghostscript Flaw "Upload2Shell" Lets Attackers Hijack WordPress, Webmail and Print Servers
- Debian Issues Security Update for Roundcube
- TastyIgniter Media Manager upload path traversal (CVE-2026-69181) allows admin-authenticated file writes outside media/uploads
- GHSA-7wwv-x6mc-pxqx / CVE-2026-69179 — TastyIgniter allows Remote Code Execution (RCE) via Unrestricted file upload in Media Manager