# CVE-2021-29921: ipaddress leading zeros in IPv4 address

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 6.82%, higher than 94% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2021-05-06T00:00:00.000Z
- Modified: 2026-10-08T22:17:09.223Z
- Also known as: PSF-2021-2, BIT-LIBPYTHON-2021-29921, BIT-PYTHON-2021-29921, BIT-PYTHON-MIN-2021-29921
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: mitre

## Description

In Python before 3,9,5, the ipaddress library mishandles leading zero characters in the octets of an IP address string. This (in some situations) allows attackers to bypass access control that is based on IP addresses.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- https://github.com/python/cpython: before 03dd89d62413c4a92831ed1b36e2ae8983bcb2d4; before 5374fbc31446364bf5f12e5ab88c5493c35eaf04; before 60ce8f0be6354ad565393ab449d8de5d713f35bc
- python python: from 3.8.0 before 3.8.12; from 3.9.0 before 3.9.5
- oracle communications_cloud_native_core_automated_test_suite: 1.8.0
- oracle communications_cloud_native_core_binding_support_function: 1.11.0
- oracle communications_cloud_native_core_network_slice_selection_function: 1.8.0
- oracle graalvm: 20.3.2; 21.1.0
- oracle zfs_storage_appliance_kit: 8.8
- libpython (Bitnami): from 3.8.0 before 3.8.12; from 3.9.0 before 3.9.5
- python (Bitnami): from 3.8.0 before 3.8.12; from 3.9.0 before 3.9.5
- python-min (Bitnami): from 3.8.0 before 3.8.12; from 3.9.0 before 3.9.5

## Every score

- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://sick.codes/sick-2021-014> (exploit, advisory, third-party-advisory, web)
- <https://github.com/sickcodes/security/blob/master/advisories/SICK-2021-014.md> (exploit, advisory, third-party-advisory)
- <https://github.com/sickcodes> (advisory, third-party-advisory)
- <https://docs.python.org/3/library/ipaddress.html> (advisory, vendor-advisory)
- <https://github.com/python/cpython/blob/63298930fb531ba2bb4f23bc3b915dbf1e17e9e1/Misc/NEWS.d/3.8.0a4.rst> (advisory, third-party-advisory)
- <https://www.oracle.com//security-alerts/cpujul2021.html> (advisory, patch, third-party-advisory)
- <https://python-security.readthedocs.io/vuln/ipaddress-ipv4-leading-zeros.html> (advisory, vendor-advisory)
- <https://bugs.python.org/issue36384> (advisory, issue-tracking, patch, vendor-advisory)
- <https://github.com/python/cpython/pull/12577> (advisory, patch, third-party-advisory)
- <https://github.com/python/cpython/pull/25099> (advisory, patch, third-party-advisory)
- <https://security.netapp.com/advisory/ntap-20210622-0003/> (advisory, third-party-advisory)
- <https://www.oracle.com/security-alerts/cpuoct2021.html> (advisory, patch, third-party-advisory)
- <https://www.oracle.com/security-alerts/cpujan2022.html> (advisory, patch, third-party-advisory)
- <https://www.oracle.com/security-alerts/cpuapr2022.html> (advisory, patch, third-party-advisory)
- <https://www.oracle.com/security-alerts/cpujul2022.html> (web)
- <https://security.gentoo.org/glsa/202305-02> (vendor-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2024/12/msg00000.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-29921> (web)

## Sources

- CVE List: [CVE-2021-29921](https://www.cve.org/CVERecord?id=CVE-2021-29921), CVE Terms of Use, modified 2026-10-08
- Python Software Foundation: [PSF-2021-2](https://osv.dev/vulnerability/PSF-2021-2), CC-BY-4.0, modified 2025-10-09
- NVD: [CVE-2021-29921](https://nvd.nist.gov/vuln/detail/CVE-2021-29921), Public domain, modified 2026-10-08
- Bitnami Vulnerability Database: [BIT-LIBPYTHON-2021-29921](https://osv.dev/vulnerability/BIT-LIBPYTHON-2021-29921), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-PYTHON-2021-29921](https://osv.dev/vulnerability/BIT-PYTHON-2021-29921), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-PYTHON-MIN-2021-29921](https://osv.dev/vulnerability/BIT-PYTHON-MIN-2021-29921), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-29921 · Whole record: https://cve.day/CVE-2021-29921.json · Rebuilt by cve.day 2026-11-25T22:58:01.175Z
