Vulnerabilities in pkg:pypi/sh
PACKAGECVE-2026-54552 is a HIGH (CVSS 7.9) sh _uid does not drop vulnerability (CWE-273: Improper Check for Dropped Privileges) affecting Sh libraries in the PyPI ecosystem. The issue involves sh _uid does not drop supplementary groups (incomplete privilege drop). Remediation is available by upgrading affected packages to version 2.2.4.
pkg:pypi/sh
Vulnerability advisories affecting package pkg:pypi/sh. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-q38v-wp89-2w55 | CVE-2026-54552 | HIGH | sh _uid does not drop supplementary groups (incomplete privilege drop) |
CVE-2026-54552 at a Glance
Security Impact
CVSS: 7.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N).
How to Fix CVE-2026-54552
To remediate this vulnerability, upgrade all affected Sh dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install sh>=2.2.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show sh
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-54552, inspect your installed packages using pip:
pip show sh
Analyze the terminal output to locate any version of Sh in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.4), your application is affected.
Note: The pip show sh command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-273: Improper Check for Dropped Privileges, where the product attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded. In Sh, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-54552 Affected Sh Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sh
|
PyPI |
< 2.2.4
|
2.2.4
|
References
Frequently Asked Questions
What is CVE-2026-54552?
Which Sh versions are affected?
What version fixes CVE-2026-54552?
Is sh affected?
What is the CVSS score of CVE-2026-54552?
What CWE is associated with CVE-2026-54552?
How can I check PyPI dependencies for CVE-2026-54552?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q38v-wp89-2w55",
"modified" : "2026-07-17T18:41:38Z",
"published" : "2026-07-17T18:41:38Z",
"aliases" : [ "CVE-2026-54552" ],
"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=<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.\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 >= 2.2.4\n\n### Workarounds\nAvoid using `_uid` when the user represents a less-privileged user.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "sh"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.4"
} ]
} ]
} ],
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-273" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-17T18:41:38Z",
"nvd_published_at" : null
}
}