CVE-2021-29921

Summary

CVECVE-2021-29921
StatePUBLISHED
Assignermitre
Source PriorityCVE Program / NVD first with legacy fallback
Published2021-05-06 13:15:12 UTC
Updated2026-10-08 22:17:09 UTC
DescriptionIn 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.

Risk And Classification

Primary CVSS: v3.1 9.8 CRITICAL from [email protected]

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

Problem Types: NVD-CWE-Other | n/a


VersionSourceTypeScoreSeverityVector
3.1[email protected]Primary9.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
2.0[email protected]Primary7.5AV:N/AC:L/Au:N/C:P/I:P/A:P

CVSS v3.1 Breakdown

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

CVSS v2.0 Breakdown

Access Vector
Network
Access Complexity
Low
Authentication
None
Confidentiality
Partial
Integrity
Partial
Availability
Partial

AV:N/AC:L/Au:N/C:P/I:P/A:P

NVD Known Affected Configurations (CPE 2.3)

TypeVendorProductVersionUpdateEditionLanguage
Application Python Python All All All All

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Na N/a affected n/a Not specified

References

ReferenceSourceLinkTags
Oracle Critical Patch Update Advisory - April 2022 af854a3a-2127-422b-91ae-364da2661108 www.oracle.com Patch, Third Party Advisory
ipaddress leading zeros in IPv4 address — Python Security 0.0 documentation af854a3a-2127-422b-91ae-364da2661108 python-security.readthedocs.io Vendor Advisory
Oracle Critical Patch Update Advisory - October 2021 af854a3a-2127-422b-91ae-364da2661108 www.oracle.com Patch, Third Party Advisory
Issue 36384: [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal - Python tracker af854a3a-2127-422b-91ae-364da2661108 bugs.python.org Issue Tracking, Patch, Vendor Advisory
Oracle Critical Patch Update Advisory - July 2021 af854a3a-2127-422b-91ae-364da2661108 www.oracle.com Patch, Third Party Advisory
sickcodes (sickcodes) · GitHub af854a3a-2127-422b-91ae-364da2661108 github.com Third Party Advisory
lists.debian.org/debian-lts-announce/2024/12/msg00000.html af854a3a-2127-422b-91ae-364da2661108 lists.debian.org
CVE-2021-29921 - python stdlib "ipaddress" - Improper Input Validation of octal literals in python 3.8.0 thru v3.10 results in indeterminate SSRF & RFI vulnerabilities. - "ipaddress leading zeros in IPv4 address" - Sick Codes - Security Research, Hardware & Software Hacking, Consulting, Linux, IoT, Cloud, Embedded, Arch, Tweaks & Tips! af854a3a-2127-422b-91ae-364da2661108 sick.codes Exploit, Third Party Advisory
cpython/3.8.0a4.rst at 63298930fb531ba2bb4f23bc3b915dbf1e17e9e1 · python/cpython · GitHub af854a3a-2127-422b-91ae-364da2661108 github.com Third Party Advisory
ipaddress — IPv4/IPv6 manipulation library — Python 3.9.4 documentation af854a3a-2127-422b-91ae-364da2661108 docs.python.org Vendor Advisory
Oracle Critical Patch Update Advisory - January 2022 af854a3a-2127-422b-91ae-364da2661108 www.oracle.com Patch, Third Party Advisory
Oracle Critical Patch Update Advisory - July 2022 af854a3a-2127-422b-91ae-364da2661108 www.oracle.com
bpo-36384: Leading zeros in IPv4 addresses are no longer tolerated by tiran · Pull Request #25099 · python/cpython · GitHub af854a3a-2127-422b-91ae-364da2661108 github.com Patch, Third Party Advisory
Python, PyPy3: Multiple Vulnerabilities (GLSA 202305-02) — Gentoo security af854a3a-2127-422b-91ae-364da2661108 security.gentoo.org
security/SICK-2021-014.md at master · sickcodes/security · GitHub af854a3a-2127-422b-91ae-364da2661108 github.com Exploit, Third Party Advisory
CVE-2021-29921 Python Vulnerability in NetApp Products | NetApp Product Security af854a3a-2127-422b-91ae-364da2661108 security.netapp.com Third Party Advisory
bpo-36384: Remove check for leading zeroes in IPv4 addresses by TV4Fun · Pull Request #12577 · python/cpython · GitHub af854a3a-2127-422b-91ae-364da2661108 github.com Patch, Third Party Advisory
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Legacy QID Mappings

  • 159466 Oracle Enterprise Linux Security Update for python39:3.9 and python39-devel:3.9 (ELSA-2021-4160)
  • 159467 Oracle Enterprise Linux Security Update for python38:3.8 and python38-devel:3.8 (ELSA-2021-4162)
  • 198392 Ubuntu Security Notification for Python vulnerability (USN-4973-1)
  • 198529 Ubuntu Security Notification for Python Vulnerability (USN-4973-2)
  • 239580 Red Hat Update for rh-python38 (RHSA-2021:3254)
  • 239841 Red Hat Update for python39:3.9 and python39-devel:3.9 (RHSA-2021:4160)
  • 239845 Red Hat Update for python38:3.8 and python38-devel:3.8 (RHSA-2021:4162)
  • 296068 Oracle Solaris 11.4 Support Repository Update (SRU) 34.94.4 Missing (CPUAPR2021)
  • 356244 Amazon Linux Security Advisory for python38 : ALASPYTHON3.8-2023-009
  • 375538 Python3 RFI/SSRF Vulnerability
  • 502021 Alpine Linux Security Update for python3
  • 504347 Alpine Linux Security Update for python3
  • 672336 EulerOS Security Update for python-pip (EulerOS-SA-2022-2740)
  • 672356 EulerOS Security Update for python-pip (EulerOS-SA-2022-2775)
  • 672442 EulerOS Security Update for python-pip (EulerOS-SA-2022-2854)
  • 672444 EulerOS Security Update for python-pip (EulerOS-SA-2022-2828)
  • 710714 Gentoo Linux Python, PyPy3 Multiple Vulnerabilities (GLSA 202305-02)
  • 751095 OpenSUSE Security Update for python39 (openSUSE-SU-2021:2940-1)
  • 940526 AlmaLinux Security Update for python38:3.8 and python38-devel:3.8 (ALSA-2021:4162)
  • 940559 AlmaLinux Security Update for python39:3.9 and python39-devel:3.9 (ALSA-2021:4160)
  • 960239 Rocky Linux Security Update for python39:3.9 and python39-devel:3.9 (RLSA-2021:4160)
  • 960342 Rocky Linux Security Update for python38:3.8 and python38-devel:3.8 (RLSA-2021:4162)

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report