CVE-2026-54552: Sh Sh _uid Does Not Drop Vulnerability

HIGH
Advisory Identifier: GHSA-q38v-wp89-2w55
CVSS 7.9
CWE-273
Published
Advisory Summary

CVE-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.

CVE-2026-54552 at a Glance

CVE Identifier CVE-2026-54552
GHSA Identifier GHSA-q38v-wp89-2w55
Severity HIGH
CVSS v3.1 Base Score 7.9
CWE Classification CWE-273: Improper Check for Dropped Privileges
Affected Product Sh
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (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.

sh fixed: 2.2.4
pip install sh>=2.2.4
Verify Direct and Transitive Dependencies

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

### 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.

CVE-2026-54552 Affected Sh Versions

1 component(s)
Fixed Versions:
2.2.4
Product / Package Ecosystem Affected Versions Fixed Version
sh
PyPI
< 2.2.4
2.2.4

References

Frequently Asked Questions

What is CVE-2026-54552?
CVE-2026-54552 is a security vulnerability in Sh involving sh _uid does not drop supplementary groups (incomplete privilege drop) under CWE-273: Improper Check for Dropped Privileges.
Which Sh versions are affected?
Affected versions include releases prior to 2.2.4 across affected packages: sh.
What version fixes CVE-2026-54552?
Upgrading to 2.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sh affected?
Yes, sh is affected in releases prior to 2.2.4. Upgrade your dependency to 2.2.4 or later.
What is the CVSS score of CVE-2026-54552?
CVE-2026-54552 has a CVSS v3.1 base score of 7.9 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2026-54552?
CVE-2026-54552 is classified under CWE-273: Improper Check for Dropped Privileges (The product attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded.).
How can I check PyPI dependencies for CVE-2026-54552?
Run the dependency tree command: 'pip show sh'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}