Description
An issue was found in CPython 3.12.0 `subprocess` module on POSIX platforms. The issue was fixed in CPython 3.12.1 and does not affect other stable releases.
When using the `extra_groups=` parameter with an empty list as a value (ie `extra_groups=[]`) the logic regressed to not call `setgroups(0, NULL)` before calling `exec()`, thus not dropping the original processes' groups before starting the new process. There is no issue when the parameter isn't used or when any value is used besides an empty list.
This issue only impacts CPython processes run with sufficient privilege to make the `setgroups` system call (typically `root`).
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Python Software Foundation | CPython | < 3.12.1, 3.13.0a1 – < 3.13.0a3 | 3.12.1 |
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.
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 22.04 LTS | python3.10 | 3.10.12-1~22.04.4 | USN-6891-1 |
| Ubuntu 20.04 LTS | python3.8 | 3.8.10-0ubuntu1~20.04.10 | USN-6891-1 |
Show 5 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 22.04 LTS | python3.11 | 3.11.0~rc1-1~22.04.1~esm1 | USN-6891-1 |
| Ubuntu Pro 20.04 LTS | python3.9 | 3.9.5-3ubuntu0~20.04.1+esm2 | USN-6891-1 |
| Ubuntu Pro 18.04 LTS | python3.6 | 3.6.9-1~18.04ubuntu1.13+esm2 | USN-6891-1 |
| Ubuntu Pro 18.04 LTS | python3.7 | 3.7.5-2ubuntu1~18.04.2+esm3 | USN-6891-1 |
| Ubuntu Pro 18.04 LTS | python3.8 | 3.8.0-3ubuntu1~18.04.2+esm2 | USN-6891-1 |
| Ubuntu Pro 16.04 LTS | python3.5 | 3.5.2-2ubuntu0~16.04.13+esm13 | USN-6891-1 |
| Ubuntu Pro 14.04 LTS | python3.5 | 3.5.2-2ubuntu0~16.04.4~14.04.1+esm1 | USN-6891-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python312 | 3.12.1-1.1 | openSUSE-SU-2024:13511-1 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | python3 | 3.12.3-1 | — |
Advisories 3
- USN-6891-1 python3.5, python3.6, python3.7, python3.8, python3.9, python3.10, python3.11, python3.12 vulnerabilities Ubuntu Security Notices (USN) · Oct 8, 2026
- openSUSE-SU-2024:13511-1 python312-3.12.1-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2024-0869 Oracle Communications: Mehrere Schwachstellen BSI CERT-Bund (WID) · Sep 10, 2025
References
- https://github.com/python/cpython/issues/112334 issue-tracking
- https://mail.python.org/archives/list/security-announce@python.org/thread/AUL7QFHBLILGISS7U63B47AYSSGJJQZD/ vendor-advisory
- https://github.com/python/cpython/commit/9fe7655c6ce0b8e9adc229daf681b6d30e6b1610 patch
- https://github.com/python/cpython/commit/10e9bb13b8dcaa414645b9bd10718d8f7179e82b patch
- https://github.com/python/cpython/commit/85bbfa8a4bbdbb61a3a84fbd7cb29a4096ab8a06 patch