Privilege escalationin Python CPython.
No public exploit found; not on exploited lists.
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`).
- Upgrade CPython to 3.12.1, 3.13.0a3 or later, whichever matches your release line.
Affected and fixed versions
From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.
From first report to first attacks
- 4 Dec 2023CVE ID reserved by PSF.
- 8 Dec 2023Published in the CVE List.
- 31 Jul 2026CVE record last updated.
Attack code anyone can find
Exploit maturity: No public exploit found. CISA assessment (SSVC): exploitation none.
Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.
Report a link
Nothing on this page links to exploit code right now. To report anything else, write to the contact point in the legal notice.
Other CPython vulnerabilities
Same weakness: Improper privilege management
- github.com issue-tracking
- mail.python.org vendor-advisory
- github.com patch
- github.com patch
- github.com patch
Patchminder. CVE-2023-6507: Privilege escalation in Python CPython. https://patchminder.com/cve/cve-2023-6507/ (accessed 5 December 2026).