CVE-2021-29921: In Python before 3,9,5, the ipaddress library mishandles leading zero characters in the octets of an IP address string.

CVE-2021-29921 affects 6 listed versions of Python in the Dawnsentry catalogue.

9.8CVSS critical
None knownexploitation
7%EPSS (next 30 days)
6 May 2021published

Affected products and versions

The versions in the Dawnsentry catalogue this CVE affects, judged from the vendor's own advisory where there is one, otherwise from the CVE record and NVD, as each version's own page says.

Python

6 of 250 listed versions are affected. Fixed in 3.8.12. The newest release, 3.15.2, is not affected.

3.8.11 3.8.10 3.8.9 3.8.8 3.8.7 3.8.6

What it is

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.

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (NVD)

Published by MITRE on 6 May 2021. Last changed 8 October 2026.

Sources

Check one version you run: look CVE-2021-29921 up, or pick a product and version in the quick lookup.

Updated 2 December 2026.