# CVE-2023-6507: Groups not dropped before running subprocess when using empty 'extra_groups' parameter

- Severity: Medium 6.1 (CVSS:3.1, scored by PSF) `CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.34%, higher than 72% of CVEs (2026-12-02)
- Published: 2023-12-08T18:20:49.583Z
- Modified: 2026-09-10T16:01:48.362Z
- Also known as: PSF-2023-12, BIT-LIBPYTHON-2023-6507, BIT-PYTHON-2023-6507, BIT-PYTHON-MIN-2023-6507, PSF-CVE-2023-6507
- Weaknesses: CWE-269
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: PSF

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

(As written by CVE List.)

## Affected

- Python Software Foundation CPython: before 3.12.1; from 3.13.0a1 before 3.13.0a3
- python cpython: 3.13.0; 3.12.0
- https://github.com/python/cpython: from 124af17b6e49f0f22fbe646fb57800393235d704 before 9fe7655c6ce0b8e9adc229daf681b6d30e6b1610; before 10e9bb13b8dcaa414645b9bd10718d8f7179e82b; before 85bbfa8a4bbdbb61a3a84fbd7cb29a4096ab8a06; from 124af17b6e49f0f22fbe646fb57800393235d704 before 85bbfa8a4bbdbb61a3a84fbd7cb29a4096ab8a06; before 9fe7655c6ce0b8e9adc229daf681b6d30e6b1610
- python python: 3.12.0; 3.13.0
- libpython (Bitnami): from 3.12.0 before 3.12.1
- python (Bitnami): from 3.12.0 before 3.12.1
- python-min (Bitnami): from 3.12.0 before 3.12.1

## Every score

- PSF: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N`
- NVD: CVSS:3.1 4.9 Medium `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://github.com/python/cpython/issues/112334> (fix, issue-tracking, patch, report)
- <https://mail.python.org/archives/list/security-announce@python.org/thread/AUL7QFHBLILGISS7U63B47AYSSGJJQZD/> (advisory, third-party-advisory, vendor-advisory)
- <https://github.com/python/cpython/commit/9fe7655c6ce0b8e9adc229daf681b6d30e6b1610> (fix, patch, web)
- <https://github.com/python/cpython/commit/10e9bb13b8dcaa414645b9bd10718d8f7179e82b> (fix, patch, web)
- <https://github.com/python/cpython/commit/85bbfa8a4bbdbb61a3a84fbd7cb29a4096ab8a06> (fix, patch, web)
- <https://www.cve.org/CVERecord?id=CVE-2023-6507> (advisory)
- <https://github.com/python/cpython/pull/112617> (fix)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-6507> (web)

## Sources

- CVE List: [CVE-2023-6507](https://www.cve.org/CVERecord?id=CVE-2023-6507), CVE Terms of Use, modified 2026-07-31
- Python Software Foundation: [PSF-2023-12](https://osv.dev/vulnerability/PSF-2023-12), CC-BY-4.0, modified 2026-07-31
- Python Software Foundation: [PSF-CVE-2023-6507](https://osv.dev/vulnerability/PSF-CVE-2023-6507), CC-BY-4.0, modified 2026-04-09
- NVD: [CVE-2023-6507](https://nvd.nist.gov/vuln/detail/CVE-2023-6507), Public domain, modified 2026-07-31
- Bitnami Vulnerability Database: [BIT-LIBPYTHON-2023-6507](https://osv.dev/vulnerability/BIT-LIBPYTHON-2023-6507), Apache-2.0, modified 2026-09-10
- Bitnami Vulnerability Database: [BIT-PYTHON-2023-6507](https://osv.dev/vulnerability/BIT-PYTHON-2023-6507), Apache-2.0, modified 2026-09-10
- Bitnami Vulnerability Database: [BIT-PYTHON-MIN-2023-6507](https://osv.dev/vulnerability/BIT-PYTHON-MIN-2023-6507), Apache-2.0, modified 2026-09-10

---

Page: https://cve.day/CVE-2023-6507 · Whole record: https://cve.day/CVE-2023-6507.json · Rebuilt by cve.day 2026-11-25T22:58:31.164Z
