What’s Vulnerable › Vulnerabilities
CVE-2024-3219: Pure-Python fallback of socket.socketpair() doesn’t authenticate peer connection
- Severity: medium (CVSS 5.1 v4.0)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.2% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2024-07-29 · updated 2026-06-17
- Weakness: CWE-306
Description
The “socket” module provides a pure-Python fallback to the socket.socketpair() function for platforms that don’t support AF_UNIX, such as Windows. This pure-Python implementation uses AF_INET or AF_INET6 to create a local connected pair of sockets. The connection between the two sockets was not verified before passing the two sockets back to the user, which leaves the server socket vulnerable to a connection race from a malicious local peer. Platforms that support AF_UNIX such as Linux and macOS are not affected by this vulnerability. Versions prior to CPython 3.5 are not affected due to the vulnerable API not being included.
Affected products
- Python: before 3.8.20; from 3.9.0 before 3.9.20; from 3.10.0 before 3.10.15; from 3.11.0 before 3.11.10; from 3.12.0 before 3.12.5; from 3.13.0a1 before 3.13.0rc1 — fixed in 3.10.15, 3.11.10, 3.12.5, 3.13.0rc1, 3.8.20, 3.9.20
How to fix
Upgrade to a fixed version: Python 3.10.15, 3.11.10, 3.12.5, 3.13.0rc1. Check the vendor advisory for mitigations.
References
- http://www.openwall.com/lists/oss-security/2024/07/29/3
- https://github.com/python/cpython/commit/06fa244666ec6335a3b9bf2367e31b42b9a89b20
- https://github.com/python/cpython/commit/0b65c8bf5367625673eafb92f85046a1b31259f2
- https://github.com/python/cpython/commit/220e31adeaaa8436c9ff234cba1398bc49e2bb6c
- https://github.com/python/cpython/commit/2621a8a40ba4b2c68ca564671b7daa5da80a4508
- https://github.com/python/cpython/commit/31302f5fc24eecd693f0c8aaba7c2840b09b594d
- https://github.com/python/cpython/commit/3f5d9d12c74787fbf3f5891835c85cc15526c86d
- https://github.com/python/cpython/commit/5df322e91a40909e6904bbdbc0c3a6b6a9eead39
- https://github.com/python/cpython/commit/5f90abaa786f994db3907fc31e2ee00ea2cf0929
- https://github.com/python/cpython/commit/78df1043dbdce5c989600616f9f87b4ee72944e5
- https://github.com/python/cpython/commit/b252317956b7fc035bb3774ef6a177e227f9fc54
- https://github.com/python/cpython/commit/c21a36112a0028d7ac3cf8f480e0dc88dba5922c
Get alerted when CVE-2024-3219 or the next vulnerability affects your stack