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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| amoffat | sh | < 2.2.4 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-sh | 2.4.0-1 | — |
| Debian 13 | python-sh | No fix yet | — |
| Debian 12 | python-sh | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | python-sh | No fix yet | — |
| Ubuntu 26.04 LTS | python-sh | No fix yet | — |
| Ubuntu 24.04 LTS | python-sh | No fix yet | — |
| Ubuntu 22.04 LTS | python-sh | No fix yet | — |
| Ubuntu 20.04 LTS | python-sh | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 18.04 LTS | python-sh | No fix yet | — |
| Ubuntu 16.04 LTS | python-sh | No fix yet | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP6 | python-sh | 2.0.4-150400.9.6.1 | SUSE-SU-2026:3422-1 |
| SLES 15 SP5 | python-sh | 2.0.4-150400.9.6.1 | SUSE-SU-2026:3422-1 |
| SLES 15 SP4 | python-sh | 2.0.4-150400.9.6.1 | SUSE-SU-2026:3422-1 |
| SLES 3 | python-sh | 2.0.4-150400.9.6.1 | SUSE-SU-2026:3422-1 |
Show 7 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 16.0 | python-sh | 2.2.2-160000.3.1 | SUSE-SU-2026:23134-1, SUSE-SU-2026:23112-1 |
| SLES for SAP 15 SP6 | python-sh | 2.0.4-150400.9.6.1 | SUSE-SU-2026:3422-1 |
| SLES for SAP 15 SP5 | python-sh | 2.0.4-150400.9.6.1 | SUSE-SU-2026:3422-1 |
| SLES for SAP 15 SP4 | python-sh | 2.0.4-150400.9.6.1 | SUSE-SU-2026:3422-1 |
| SLES 16.0 | python-sh | 2.2.2-160000.3.1 | SUSE-SU-2026:23134-1, SUSE-SU-2026:23112-1 |
| SLE HPC 15 SP5 | python-sh | 2.0.4-150400.9.6.1 | SUSE-SU-2026:3422-1 |
| SLE HPC 15 SP4 | python-sh | 2.0.4-150400.9.6.1 | SUSE-SU-2026:3422-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-sh | 2.3.0-1.1 | openSUSE-SU-2026:11372-1 |
| openSUSE Leap 16.0 | python-sh | 2.2.2-160000.3.1 | openSUSE-SU-2026:21516-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | sh | < 2.2.4 | 2.2.4 | GHSA-q38v-wp89-2w55 |
Advisories 5
- SUSE-SU-2026:23112-1 Security update for python-sh SUSE / openSUSE Security Updates · Aug 14, 2026
- SUSE-SU-2026:23134-1 Security update for python-sh SUSE / openSUSE Security Updates · Aug 14, 2026
- openSUSE-SU-2026:21516-1 Security update for python-sh SUSE / openSUSE Security Updates · Aug 5, 2026
- SUSE-SU-2026:3422-1 Security update for python-sh SUSE / openSUSE Security Updates · Jul 30, 2026
- openSUSE-SU-2026:11372-1 python313-sh-2.3.0-1.1 on GA media SUSE / openSUSE Security Updates · Jul 25, 2026