Severity by source
AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N
Local low-complexity attack needing a privileged root parent using _uid (PR:H); the crossed privilege boundary gives S:C with high confidentiality/integrity impact and no availability effect.
AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
Primary rating from Vendor (https://github.com/amoffat/sh).
CVSS VectorVendor: https://github.com/amoffat/sh
Lifecycle Timeline
3DescriptionCVE.org
Impact
The _uid option performed an incomplete privilege drop on Linux/Unix-like systems.
When sh was run from a process with elevated privileges, such as root, and a command was launched with _uid=<unprivileged user>, 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.
This 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.
Patches
Upgrade to version >= 2.2.4
Workarounds
Avoid using _uid when the user represents a less-privileged user.
Articles & Coverage 1
AnalysisAI
Privilege escalation via incomplete privilege drop in the Python 'sh' subprocess library (versions < 2.2.4): when a root/privileged process launches a command with the _uid option, the child changes UID and primary GID but fails to clear the parent's supplementary groups via setgroups(). Any subprocess expected to run unprivileged can therefore retain sensitive parent groups (root, docker, disk, shadow, sudo), reading or writing resources those groups grant. No public exploit identified at time of analysis and it is not in CISA KEV; the fix is confirmed in release 2.2.4.
Technical ContextAI
The 'sh' library (pkg:pip/sh) is a popular Python convenience wrapper that runs external commands as fluent function calls. Its _uid option is meant to launch a child with a reduced identity. On Linux/Unix a full privilege drop requires three syscalls in order: setgroups() to clear supplementary groups, setgid() for the primary GID, then setuid() for the UID. This flaw is CWE-273 (Improper Check for Dropped Privileges): sh set the UID and primary GID but omitted the setgroups() call, so the inherited supplementary group list persisted. Because groups like docker, disk, shadow, and sudo confer powerful host access independent of UID, the residual membership defeats the intended sandbox. The 2.2.4 release notes describe fixing a regression where the correct gid was not set on the launched process.
RemediationAI
Vendor-released patch: 2.2.4 - upgrade the sh dependency to version >= 2.2.4 (pip install --upgrade 'sh>=2.2.4') as the primary fix, per GHSA-q38v-wp89-2w55. If upgrading is not immediately possible, apply the vendor workaround of avoiding _uid when the target user is meant to be less-privileged; instead drop privileges yourself before invoking sh (e.g. call os.initgroups()/os.setgroups([]) then setgid/setuid, or launch via a wrapper that fully clears groups), which removes reliance on the broken path at the cost of extra glue logic. Additionally, minimize the supplementary groups of the privileged parent process (do not run it as a member of docker, disk, shadow, or sudo) so a leaked group list carries no dangerous privileges - the trade-off is that legitimate parent functionality needing those groups must be redesigned.
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac
Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post
Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten
Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build
Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config
Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per
Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l
Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c
Vasion Print (formerly PrinterLogic) Virtual Appliance Host prior to version 25.2.169 and Application prior to version 2
Same weakness CWE-273 – Improper Check for Dropped Privileges
View allSame technique Information Disclosure
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| SUSE Linux Enterprise Desktop 15 SP7 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP7 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP7 | Affected |
| SUSE Linux Enterprise Server 15 SP7 | Affected |
| SUSE Linux Enterprise Server 16.0 | Affected |
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| openSUSE Leap 16.0 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP4 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP4 | Affected |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP5 | Affected |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Affected |
| SUSE Manager Proxy 4.3 | Affected |
| SUSE Manager Retail Branch Server 4.3 | Affected |
| SUSE Manager Server 4.3 | Affected |
| SUSE Linux Enterprise Desktop 15 SP4 | Affected |
| SUSE Linux Enterprise Desktop 15 SP5 | Affected |
| SUSE Linux Enterprise Desktop 15 SP6 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP6 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-61127
GHSA-q38v-wp89-2w55