CVE-2023-6507: Groups not dropped before running subprocess when using empty 'extra_groups' parameter
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 extragroups= parameter with an empty list as a value (ie extragroups=[]) 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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/python2.7to a version that resolves this vulnerability.Fixed in 2.7.18-8+deb11u1 - Upgrade
Upgrade
debian/python3.11to a version that resolves this vulnerability.Fixed in 3.11.2-6+deb12u5Fixed in 3.11.2-6+deb12u3 - Upgrade
Upgrade
debian/python3.12to a version that resolves this vulnerability.Fixed in 3.12.10-1 - Upgrade
Upgrade
debian/python3.9to a version that resolves this vulnerability.Fixed in 3.9.2-1Fixed in 3.9.2-1+deb11u3 - Upgrade
Upgrade
CPython 3.12.0 subprocess module (POSIX)to a version that resolves this vulnerability.Fixed in 3.12.1
Event History
Frequently Asked Questions
What is the severity of CVE-2023-6507?
CVE-2023-6507 has been classified with a medium severity due to its potential impact on POSIX systems using Python 3.12.0.
How do I fix CVE-2023-6507?
To fix CVE-2023-6507, upgrade to CPython version 3.12.1 or later, as it addresses the vulnerability.
Which versions of Python are affected by CVE-2023-6507?
CVE-2023-6507 specifically affects Python 3.12.0 and does not impact previous stable releases.
Is CVE-2023-6507 relevant for Python 2.7?
CVE-2023-6507 does not affect Python 2.7, as it is specific to CPython 3.12.0.
What specific issue does CVE-2023-6507 address?
CVE-2023-6507 addresses a regression in the 'subprocess' module when an empty list is passed to the 'extra_groups=' parameter.