PSF-2024-5: Incorrect IPv4 and IPv6 private ranges
The “ipaddress” module contained incorrect information about whether certain IPv4 and IPv6 addresses were designated as “globally reachable” or “private”. This affected the isprivate and isglobal properties of the ipaddress.IPv4Address, ipaddress.IPv4Network, ipaddress.IPv6Address, and ipaddress.IPv6Network classes, where values wouldn’t be returned in accordance with the latest information from the IANA Special-Purpose Address Registries.
CPython 3.12.4 and 3.13.0a6 contain updated information from these registries and thus have the intended behavior.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
CPythonto a version that resolves this vulnerability.Fixed in 3.12.4 - Upgrade
Upgrade
CPythonto a version that resolves this vulnerability.Fixed in 3.13.0a6
Event History
Frequently Asked Questions
Which CPython releases have the corrected address-classification data?
CPython 3.12.4 and 3.13.0a6 contain updated IANA Special-Purpose Address Registry information and provide the intended is_private and is_global behavior.
What functionality should be reviewed for impact?
Review code that relies on is_private or is_global from ipaddress.IPv4Address, ipaddress.IPv4Network, ipaddress.IPv6Address, or ipaddress.IPv6Network, particularly where those results drive access control, routing, filtering, or trust decisions.
How can I determine whether an application is affected?
Identify whether it uses the affected ipaddress classes and their is_private or is_global properties. Then check whether its decisions depend on classifications for addresses whose IANA Special-Purpose Registry status was not reflected by the installed CPython version.