# CVE-2024-4032: Incorrect IPv4 and IPv6 private ranges

> Incorrect IP address classification in Python's ipaddress module may allow attackers to bypass security checks relying on private or global IP status.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Jun 2024
- **Updated:** 3 Nov 2025
- **Also known as:** ALPINE-CVE-2024-4032, ALSA-2024:4766, ALSA-2024:4779, AZL-42772, AZL-42811, BELL-CVE-2024-4032, BIT-libpython-2024-4032, BIT-python-2024-4032, BIT-python-min-2024-4032, CLEANSTART-2026-XR93772, CLSA-2024-1727374287, CLSA-2024-1728403634, CLSA-2024-1728404424, CLSA-2026-1778880543, CLSA-2026-1778932682, DEBIAN-CVE-2024-4032, GHSA-mh6q-v4mp-2cc7, PSF-2024-5, RHSA-2024:4766, RHSA-2024:4779, RHSA-2024:6030, RHSA-2024:7417, SUSE-SU-2024:2254-1, SUSE-SU-2024:2414-1, SUSE-SU-2024:2959-1, UBUNTU-CVE-2024-4032, USN-6941-1, openSUSE-SU-2024:14078-1, openSUSE-SU-2024:14079-1, openSUSE-SU-2024:14083-1

## What is CVE-2024-4032?

CVE-2024-4032 is a high-severity vulnerability in CPython, published on 17 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The “ipaddress” module contained incorrect information about whether certain IPv4 and IPv6 addresses were designated as “globally reachable” or “private”. This affected the is_private and is_global 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.

Weakness: CWE-697 (Incorrect Comparison)

## Which versions are affected by CVE-2024-4032?

3 open source packages ship an affected version, including libpython, python and python-min.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.4 |
| `python` | Bitnami | All versions | 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.4 |
| `python-min` | Bitnami | All versions | 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.4 |
| `python-unversioned-command` | AlmaLinux:9 | All versions | 3.9.18-3.el9_4.3 |
| `python3` | AlmaLinux:9 | All versions | 3.9.18-3.el9_4.3 |
| `python3-debug` | AlmaLinux:9 | All versions | 3.9.18-3.el9_4.3 |
| `python3-devel` | AlmaLinux:9 | All versions | 3.9.18-3.el9_4.3 |
| `python3-idle` | AlmaLinux:9 | All versions | 3.9.18-3.el9_4.3 |
| `python3-libs` | AlmaLinux:9 | All versions | 3.9.18-3.el9_4.3 |
| `python3-test` | AlmaLinux:9 | All versions | 3.9.18-3.el9_4.3 |
| `python3-tkinter` | AlmaLinux:9 | All versions | 3.9.18-3.el9_4.3 |
| `python3.11` | AlmaLinux:9 | All versions | 3.11.7-1.el9_4.3 |
| `python3.11-debug` | AlmaLinux:9 | All versions | 3.11.7-1.el9_4.3 |
| `python3.11-devel` | AlmaLinux:9 | All versions | 3.11.7-1.el9_4.3 |
| `python3.11-idle` | AlmaLinux:9 | All versions | 3.11.7-1.el9_4.3 |
| `python3.11-libs` | AlmaLinux:9 | All versions | 3.11.7-1.el9_4.3 |
| `python3.11-test` | AlmaLinux:9 | All versions | 3.11.7-1.el9_4.3 |
| `python3.11-tkinter` | AlmaLinux:9 | All versions | 3.11.7-1.el9_4.3 |
| `python-unversioned-command` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.18-3.el9_4.3 |
| `python3-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.18-3.el9_4.3 |
| `python3-tkinter` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.18-3.el9_4.3 |
| `python3.11` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.7-1.el9_4.3 |
| `python3.11-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.7-1.el9_4.3 |
| `python3.11-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.7-1.el9_4.3 |
| `python3.11-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.7-1.el9_4.3 |
| `python3.11-libs` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.7-1.el9_4.3 |
| `python3.11-tkinter` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.7-1.el9_4.3 |
| `python3.9-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.18-3.el9_4.3 |
| `python3.9-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.18-3.el9_4.3 |
| `python3` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.18-3.el9_4.3 |
| `python3-libs` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.18-3.el9_4.3 |
| `python3.9` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.18-3.el9_4.3 |
| `python3.9-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.18-3.el9_4.3 |
| `python3.9-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.18-3.el9_4.3 |
| `python3` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.18-3.el9_4.3 |
| `python3-debug` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.18-3.el9_4.3 |
| `python3-idle` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.18-3.el9_4.3 |
| `python3-test` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.18-3.el9_4.3 |
| `python3-tkinter` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.18-3.el9_4.3 |
| `python3.11` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.11.7-1.el9_4.3 |

## How do I fix CVE-2024-4032?

Upgrade libpython to a fixed version for your release line: 3.8.20, 3.9.20, 3.10.15 or 3.11.10.

## Is CVE-2024-4032 being exploited?

There is no known exploitation of CVE-2024-4032 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-4032 and fix it if it is affected.

What it is: CVE-2024-4032 is a high-severity vulnerability in CPython, published on 17 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-4032 in the wild and no public exploit code.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.4
- python (Bitnami): affected all versions; fixed in 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.4
- python-min (Bitnami): affected all versions; fixed in 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-4032/ (Markdown: https://insights.sbomify.com/CVE-2024-4032/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-4032
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-4032
- OSV: https://osv.dev/vulnerability/CVE-2024-4032

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-4032/
Summaries are generated and may contain mistakes; the official description above is the record.
