CVE-2023-6507 json
Groups not dropped before running subprocess when using empty 'extra_groups' parameter
published 2023-12-08 2 y ago modified 2026-09-10 59 d ago also BIT-libpython-2023-6507 , BIT-python-2023-6507 , BIT-python-min-2023-6507 , EUVD-2023-58738
- cvss
- 6.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.3%
- EPSS 1.3% chance of exploitation in 30 days, percentile 71%
- public exploits
- 0
- none known
Summary
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`).
Patch / fix
- bitnami libpython 3.12.1
- bitnami python 3.12.1
- bitnami python-min 3.12.1
- Python Software Foundation CPython 3.12.1, 3.13.0a3
- python312 openSUSE Tumbleweed 3.12.1-1.1
opensuse advisories openSUSE-SU-2024:13511-1
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2023-6507 updated cvss 6.1
python: Improper privileges drop on subprocess module
-
Red Hat Enterprise Linux 6 python, tkinter, python-libs, python-test, python-tools Red Hat Enterprise Linux 7 python, python3, tkinter, python-libs, python-test, python-tools, +4 more Red Hat Enterprise Linux 8 numpy, scipy, PyYAML, python2, python3, mod_wsgi, +94 more Red Hat Enterprise Linux 9 python3, python3.9, python3.11, python3.12, python3-idle, python3-libs, +11 more Red Hat Enterprise Linux 10 python3.12not affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
1.34% chance of exploitation in the next 30 days, higher than 71% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 6.1 | CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N |
| NVD | 3.1 | 4.9 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N |
| OSV | 3.1 | 6.1 | CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| bitnami | libpython | >=3.12.0, <3.12.1 |
3.12.1 |
| bitnami | python | >=3.12.0, <3.12.1 |
3.12.1 |
| bitnami | python-min | >=3.12.0, <3.12.1 |
3.12.1 |
Affected products
- Python Software Foundation CPython
- python cpython
Classification
- Weakness
-
- CWE-269 Improper Privilege Management
References
-
github.com
/python/cpython/commit/9fe7655c6ce0b8e9adc229daf681b6d30e6b1610
patch, web
-
github.com
/python/cpython/commit/10e9bb13b8dcaa414645b9bd10718d8f7179e82b
patch, web
-
github.com
/python/cpython/commit/85bbfa8a4bbdbb61a3a84fbd7cb29a4096ab8a06
patch, web
-
github.com
/python/cpython/issues/112334
issue-tracking, patch
-
mail.python.org
/archives/list/security-announce@python.org/thread/AUL7QFHBLILGISS7U63B47AYSSGJJQZD/
vendor-advisory, third-party-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2023-6507
web
Sources
- CVE List CVE-2023-6507
- NVD CVE-2023-6507
- OSV BIT-libpython-2023-6507
- OSV BIT-python-2023-6507
- OSV BIT-python-min-2023-6507
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Improve version ranges to indicate fix.