Sceawere
Vulnerability Detail
CVE-2026-54552UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV
sh Incomplete Privilege Drop Vulnerability
Vulnerability Metadata
- Severity
- High
- Score / CVSS
- 7.9
- Creation Date
- 4h ago
- Vendor
- amoffat
- Product
- sh
- Attack Type
- CWE-273: Improper Check for Dropped Privileges
- Vector String
- CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N
- Attack Complexity
- LOW
Narrative and Response
Description
sh provides Python process launching. Prior to 2.2.4, the _uid option in sh.py performs an incomplete privilege drop on Linux and Unix-like systems. When sh runs from an elevated process and launches a command with _uid set to an unprivileged user, the child changes its UID but can retain the parent process's supplementary groups because the privilege-drop sequence does not fully establish the target user's UID, primary GID, and supplementary groups. The child can therefore retain access to files or resources granted to privileged groups such as root, docker, disk, shadow, or sudo, violating the expected _uid privilege boundary. This issue is fixed in version 2.2.4.
Executive Summary
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Technical Details
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mitigations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
References
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional Metadata
{
"score": "7.9",
"pubDate": "2026-08-18T18:18:23.147Z",
"pubdate": "2026-08-18T18:18:23.147Z",
"executiveSummary": "An incomplete privilege drop vulnerability exists in the Python sh library prior to version 2.2.4, specifically within the _uid option handling in sh.py on Linux and Unix-like systems. When an elevated parent process utilizes the library to execute a command with the _uid parameter set to an unprivileged user, the resulting child process fails to completely sanitize its security context.\nThe primary impact of this security flaw is unauthorized access to sensitive resources and privilege boundary violations. While the child process successfully alters its User ID (UID), it fails to properly reset its primary Group ID (GID) and retain only the target user's appropriate supplementary groups, thereby inheriting the privileged supplementary groups of the parent process.\nAffected systems include any environment utilizing sh versions prior to 2.2.4 for process execution across Linux and Unix-like operating systems. The risk implication is severe, as unprivileged execution contexts can retain membership in powerful groups such as root, docker, disk, shadow, or sudo.\nAn attacker capable of triggering command execution via the vulnerable _uid parameter can leverage the retained supplementary group memberships to interact with restricted system resources, read protected files, or escalate privileges within the local host environment.",
"technicalDetails": "The root cause of the vulnerability resides in the privilege-drop implementation logic located within sh.py. When invoking subprocesses with the _uid option, the library performs a partial credential adjustment on Linux and Unix-like operating systems, updating the UID of the child process without fully establishing the complete privilege context expected for the target user.\nSpecifically, the privilege-drop sequence fails to comprehensively reset the primary Group ID and drop the full set of supplementary group IDs inherited from the elevated parent process. Under standard operating system security models, changing the UID via system calls like setuid does not automatically clear supplementary groups unless explicitly managed via complementary calls such as setgid and initgroups or setgroups.\nThe attack flow proceeds as follows: First, a privileged parent process initializes a command execution using the sh library, specifying the _uid parameter to drop privileges to an unprivileged target user. Second, the child process spawns and executes the requested command, initiating the vulnerable privilege-drop sequence in sh.py. Third, the operating system kernel updates the UID of the child process to match the requested unprivileged user. Fourth, because the library implementation omits the full supplementary group sanitization routine, the child process retains the supplementary groups of the elevated parent process.\nAs a result of this payload behavior, the child process operates with a mismatched security context: an unprivileged UID combined with privileged group memberships (e.g., root, docker, disk, shadow, sudo). Post-exploitation impact includes the ability to bypass intended access controls, read sensitive system files restricted to administrative groups, or interact with powerful system daemons accessible only to specific privileged groups, violating the expected _uid privilege boundary."
}