CVE-2021-29921
JSON

9.8critical

ipaddress leading zeros in IPv4 address

Severity
9.8critical CVSS:3.1 by NVD
Exploit likelihood
6.82% (higher than 94% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
PSF-2021-2BIT-LIBPYTHON-2021-29921BIT-PYTHON-2021-29921BIT-PYTHON-MIN-2021-29921

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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
https://github.com/python/cpythonbefore 03dd89d62413c4a92831ed1b36e2ae8983bcb2d4, before 5374fbc31446364bf5f12e5ab88c5493c35eaf04, before 60ce8f0be6354ad565393ab449d8de5d713f35bcPython Software Foundation
python pythonfrom 3.8.0 before 3.8.12, from 3.9.0 before 3.9.5NVD
oracle communications_cloud_native_core_automated_test_suite1.8.0NVD
oracle communications_cloud_native_core_binding_support_function1.11.0NVD
oracle communications_cloud_native_core_network_slice_selection_function1.8.0NVD
oracle graalvm20.3.2, 21.1.0NVD
oracle zfs_storage_appliance_kit8.8NVD
libpython (Bitnami)from 3.8.0 before 3.8.12, from 3.9.0 before 3.9.5Bitnami Vulnerability Database
python (Bitnami)from 3.8.0 before 3.8.12, from 3.9.0 before 3.9.5Bitnami Vulnerability Database
python-min (Bitnami)from 3.8.0 before 3.8.12, from 3.9.0 before 3.9.5Bitnami Vulnerability Database

All scores

NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.5high CVSS:2.0AV:N/AC:L/Au:N/C:P/I:P/A:P
Bitnami Vulnerability Databasecritical rating

Classification

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

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.

NVD (es)

En Python antes de la versiones 3,9,5, la biblioteca ipaddress maneja mal los caracteres cero iniciales en los octetos de una cadena de direcciones IP. Esto (en algunas situaciones) permite a los atacantes eludir el control de acceso que se basa en las direcciones IP

References

https://github.com/sickcodesadvisory, third-party-advisory
https://docs.python.org/3/library/ipaddress.htmladvisory, vendor-advisory
https://github.com/python/cpython/blob/63298930fb531ba2bb4f23bc3b915dbf1e17e9e1/Misc/NEWS.d/3.8.0a4.rstadvisory, third-party-advisory
https://sick.codes/sick-2021-014advisory, exploit, third-party-advisory, web
https://www.oracle.com//security-alerts/cpujul2021.htmladvisory, patch, third-party-advisory
https://github.com/sickcodes/security/blob/master/advisories/SICK-2021-014.mdadvisory, exploit, third-party-advisory
https://python-security.readthedocs.io/vuln/ipaddress-ipv4-leading-zeros.htmladvisory, vendor-advisory
https://bugs.python.org/issue36384advisory, issue-tracking, patch, vendor-advisory
https://github.com/python/cpython/pull/12577advisory, patch, third-party-advisory
https://github.com/python/cpython/pull/25099advisory, patch, third-party-advisory
https://security.netapp.com/advisory/ntap-20210622-0003/advisory, third-party-advisory
https://www.oracle.com/security-alerts/cpuoct2021.htmladvisory, patch, third-party-advisory

Sources

SourceRecordLicence
CVE ListCVE-2021-29921 changed 2026-10-08CVE Terms of Use
Python Software FoundationPSF-2021-2 changed 2025-10-09CC-BY-4.0
NVDCVE-2021-29921 changed 2026-10-08Public domain
Bitnami Vulnerability DatabaseBIT-LIBPYTHON-2021-29921 changed 2026-09-08Apache-2.0
Bitnami Vulnerability DatabaseBIT-PYTHON-2021-29921 changed 2026-09-08Apache-2.0
Bitnami Vulnerability DatabaseBIT-PYTHON-MIN-2021-29921 changed 2026-09-08Apache-2.0