BIT-python-2024-4032: 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 exposure?
Review code that relies on is_private or is_global from IPv4Address, IPv4Network, IPv6Address, or IPv6Network to make security or access-control decisions. The issue affects classifications for certain IPv4 and IPv6 addresses.