CVE-2021-29921 json
In Python before 3,9,5, the ipaddress library mishandles leading zero characters in the octets of an IP address string.
published 5y ago modified last mo. also BIT-libpython-2021-29921 , BIT-python-2021-29921 , BIT-python-min-2021-29921 , EUVD-2021-16395
- cvss
- 9.8
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 6.8%
- EPSS 6.8% chance of exploitation in 30 days, percentile 94%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- bitnami libpython 3.8.12, 3.9.5
- bitnami python 3.8.12, 3.9.5
- bitnami python-min 3.8.12, 3.9.5
- python python 3.8.12, 3.9.5
- pypy3 Debian 14, Debian 13, Debian 12 7.3.8+dfsg-1
debian advisories DEBIAN-CVE-2021-29921
- python3.8 Ubuntu 20.04 LTS 3.8.10-0ubuntu1~20.04.1
- python3.9 Ubuntu 20.04 LTS 3.9.5-3~20.04.1
- python3.8 Ubuntu Pro 18.04 LTS 3.8.0-3ubuntu1~18.04.2+esm2
ubuntu advisories UBUNTU-CVE-2021-29921
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- pytz RHEL 8 2019.3-3.module+el8.4.0+8888+89bc7e79
- babel RHEL 8 2.7.0-11.module+el8.5.0+11015+9c1c7c42
- numpy RHEL 8 1.17.3-6.module+el8.5.0+12205+a865257a
- scipy RHEL 8 1.3.1-4.module+el8.4.0+8888+89bc7e79
- Cython RHEL 8 0.29.14-4.module+el8.4.0+8888+89bc7e79
- pytest RHEL 8 4.6.6-3.module+el8.4.0+8888+89bc7e79
- PyYAML RHEL 8 5.4.1-1.module+el8.5.0+10721+14d8e0d5
- mod_wsgi RHEL 8 4.6.8-3.module+el8.4.0+8888+89bc7e79
red hat advisories RHSA-2021:4162RHSA-2021:3254RHSA-2021:4160
- python39 SLE Module for Basesystem 15 SP3 3.9.6-4.3.4
- python39-core SLE Module for Development Tools 15 SP3, SLE Module for Basesystem 15 SP3 3.9.6-4.3.3
suse advisories SUSE-SU-2021:2940-1
- python39 openSUSE Tumbleweed 3.9.7-2.1
opensuse advisories openSUSE-SU-2024:11286-1
- python38-py AlmaLinux 8 1.8.0-8.module_el8.6.0+2778+cd494b30
- python38-ply AlmaLinux 8 3.11-10.module_el8.6.0+2778+cd494b30
- python38-six AlmaLinux 8 1.12.0-10.module_el8.6.0+2778+cd494b30
- python38-cffi AlmaLinux 8 1.13.2-3.module_el8.6.0+2778+cd494b30
- python38-idna AlmaLinux 8 2.8-6.module_el8.6.0+2778+cd494b30
- python38-pytz AlmaLinux 8 2019.3-3.module_el8.6.0+2778+cd494b30
- python38-attrs AlmaLinux 8 19.3.0-3.module_el8.6.0+2778+cd494b30
- python38-babel AlmaLinux 8 2.7.0-11.module_el8.6.0+2778+cd494b30
almalinux advisories ALSA-2021:4162ALSA-2021:4160
- pytz Rocky Linux 8 2019.3-3.module+el8.4.0+570+c2eaf144
- babel Rocky Linux 8 2.7.0-11.module+el8.5.0+672+ab6eb015
- numpy Rocky Linux 8 1.17.3-6.module+el8.5.0+672+ab6eb015
- scipy Rocky Linux 8 1.3.1-4.module+el8.5.0+672+ab6eb015
- scipy Rocky Linux 8 1.3.1-4.module+el8.4.0+570+c2eaf144
- Cython Rocky Linux 8 0.29.14-4.module+el8.4.0+570+c2eaf144
- pytest Rocky Linux 8 4.6.6-3.module+el8.4.0+570+c2eaf144
- PyYAML Rocky Linux 8 5.4.1-1.module+el8.5.0+672+ab6eb015
rocky linux advisories RLSA-2021:4162RLSA-2021:4160
- python3 Alpine 3.24, Alpine 3.23, Alpine 3.22 +7 more 3.9.5-r0
alpine advisories ALPINE-CVE-2021-29921
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- python Arch Linux 3.9.5-1
arch linux advisories AVG-1913
- github.com/python/cpython#12577 pull request
- github.com/python/cpython#25099 pull request
- oracle.com//security-alerts/cpujul2021.html advisory
- bugs.python.org/issue36384 advisory
- oracle.com/security-alerts/cpuoct2021.html advisory
- oracle.com/security-alerts/cpujan2022.html advisory
- oracle.com/security-alerts/cpuapr2022.html advisory
Is CVE-2021-29921 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-29921 updated cvss 9.1
python-ipaddress: Improper input validation of octal strings
-
Red Hat CodeReady Linux Builder (v. 8) pytest 4.6.6-3.module+el8.4.0+8888+89bc7e79, pytest 6.0.2-2.module+el8.4.0+9822+20bf1249, Cython 0.29.21-5.module+el8.4.0+9822+20bf1249, pybind11 2.6.1-2.module+el8.4.0+9822+20bf1249, python-py 1.8.0-8.module+el8.4.0+8888+89bc7e79, python-py 1.10.0-1.module+el8.4.0+9822+20bf1249, +34 more Red Hat Enterprise Linux AppStream (v. 8) pytz 2019.3-3.module+el8.4.0+8888+89bc7e79, scipy 1.3.1-4.module+el8.4.0+8888+89bc7e79, scipy 1.5.4-3.module+el8.4.0+9822+20bf1249, babel 2.7.0-11.module+el8.5.0+11015+9c1c7c42, numpy 1.17.3-6.module+el8.5.0+12205+a865257a, numpy 1.19.4-3.module+el8.5.0+12204+54860423, +114 morefixed: vendor fix RHSA-2021:4162
-
Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) rh-python38-babel 2.7.0-12.el7, rh-python38-python 3.8.11-2.el7, rh-python38-python-lxml 4.4.1-7.el7, rh-python38-python-pip 19.3.1-2.el7, rh-python38-python-idle 3.8.11-2.el7, rh-python38-python-libs 3.8.11-2.el7, +9 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) rh-python38-babel 2.7.0-12.el7, rh-python38-python 3.8.11-2.el7, rh-python38-python-lxml 4.4.1-7.el7, rh-python38-python-pip 19.3.1-2.el7, rh-python38-python-idle 3.8.11-2.el7, rh-python38-python-libs 3.8.11-2.el7, +9 more Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) rh-python38-babel 2.7.0-12.el7, rh-python38-python 3.8.11-2.el7, rh-python38-python-lxml 4.4.1-7.el7, rh-python38-python-pip 19.3.1-2.el7, rh-python38-python-idle 3.8.11-2.el7, rh-python38-python-libs 3.8.11-2.el7, +9 morefixed: vendor fix RHSA-2021:3254
-
Red Hat Enterprise Linux 7 python-pip, python3-pip, python-ipaddress Red Hat Enterprise Linux 8 scipy, python36, python-nose, python-wheel, python3-bson, python3-nose, +21 more Red Hat Software Collections rh-python36-python, python27-python-pip, rh-python36-python-libs, rh-python36-python-test, rh-python36-python-tools, rh-python36-python-tkinternot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- total
- Assessed
- last mo.
Exploit prediction
6.76% chance of exploitation in the next 30 days, higher than 94% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- sick.codes https://sick.codes/sick-2021-014 referenced PoC, tagged "exploit" by a source, unverified
- github.com https://github.com/sickcodes/security/blob/master/advisories/SICK-2021-014.md referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
| OSV | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| bitnami | libpython | >=3.8.0, <3.8.12 >=3.9.0, <3.9.5 |
3.8.12 3.9.5 |
| bitnami | python | >=3.8.0, <3.8.12 >=3.9.0, <3.9.5 |
3.8.12 3.9.5 |
| bitnami | python-min | >=3.8.0, <3.8.12 >=3.9.0, <3.9.5 |
3.8.12 3.9.5 |
References
-
github.com
/python/cpython/pull/12577
patch, third-party-advisory, advisory
-
github.com
/python/cpython/pull/25099
patch, third-party-advisory, advisory
-
oracle.com
//security-alerts/cpujul2021.html
patch, third-party-advisory, advisory
-
bugs.python.org
/issue36384
issue-tracking, patch, vendor-advisory, advisory
-
oracle.com
/security-alerts/cpuoct2021.html
patch, third-party-advisory, advisory
-
oracle.com
/security-alerts/cpujan2022.html
patch, third-party-advisory, advisory
-
oracle.com
/security-alerts/cpuapr2022.html
patch, third-party-advisory, advisory
-
sick.codes
/sick-2021-014
exploit, third-party-advisory, advisory
-
github.com
/sickcodes/security/blob/master/advisories/SICK-2021-014.md
exploit, third-party-advisory, advisory
-
security.gentoo.org
/glsa/202305-02
vendor-advisory, web
-
docs.python.org
/3/library/ipaddress.html
vendor-advisory, advisory
-
python-security.readthedocs.io
/vuln/ipaddress-ipv4-leading-zeros.html
vendor-advisory, advisory
-
github.com
/sickcodes
third-party-advisory, advisory
-
github.com
/python/cpython/blob/63298930fb531ba2bb4f23bc3b915dbf1e17e9e1/Misc/NEWS.d/3.8.0a4.rst
third-party-advisory, advisory
-
security.netapp.com
/advisory/ntap-20210622-0003/
third-party-advisory, advisory
-
oracle.com
/security-alerts/cpujul2022.html
web
-
lists.debian.org
/debian-lts-announce/2024/12/msg00000.html
web
-
nvd.nist.gov
/vuln/detail/CVE-2021-29921
web
Sources
- CVE List CVE-2021-29921
- NVD CVE-2021-29921
- OSV BIT-libpython-2021-29921
- OSV BIT-python-2021-29921
- OSV BIT-python-min-2021-29921
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.