{"id":"PYSEC-2026-3540","summary":"sh _uid does not drop supplementary groups (incomplete privilege drop)","details":"### Impact\nThe `_uid` option performed an incomplete privilege drop on Linux/Unix-like systems.\n\nWhen `sh` was run from a process with elevated privileges, such as root, and a command was launched with `_uid=\u003cunprivileged user\u003e`, the child process changed its UID and primary GID but did not reset its supplementary groups. As a result, the child process could retain the parent process’s supplementary groups, potentially including privileged groups such as root, docker, disk, shadow, or sudo.\n\nThis could allow a subprocess that was expected to run with reduced privileges to access files or resources available to the original process’s supplementary groups. Users are impacted if they rely on `_uid` as a privilege boundary when launching commands from a privileged parent process.\n\n### Patches\nUpgrade to version \u003e= 2.2.4\n\n### Workarounds\nAvoid using `_uid` when the user represents a less-privileged user.","aliases":["CVE-2026-54552","GHSA-q38v-wp89-2w55"],"modified":"2026-07-23T15:00:23.844332272Z","published":"2026-07-23T11:41:46.915478Z","references":[{"type":"WEB","url":"https://github.com/amoffat/sh/security/advisories/GHSA-q38v-wp89-2w55"},{"type":"PACKAGE","url":"https://github.com/amoffat/sh"},{"type":"WEB","url":"https://github.com/amoffat/sh/releases/tag/2.2.4"},{"type":"PACKAGE","url":"https://pypi.org/project/sh"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-q38v-wp89-2w55"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54552"}],"affected":[{"package":{"name":"sh","ecosystem":"PyPI","purl":"pkg:pypi/sh"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.4"}]}],"versions":["0.01","0.106","0.107","0.108","1.0","1.01","1.02","1.03","1.04","1.05","1.06","1.07","1.08","1.09","1.10","1.11","1.12.0","1.12.1","1.12.10","1.12.11","1.12.12","1.12.13","1.12.14","1.12.2","1.12.3","1.12.4","1.12.5","1.12.6","1.12.7","1.12.8","1.12.9","1.13.0","1.13.1","1.14.0","1.14.1","1.14.2","1.14.3","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.1.0","2.2.0","2.2.1","2.2.2","2.2.3"],"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/sh/PYSEC-2026-3540.yaml"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N"}]}