CVE-2021-29921: Input Validation
A flaw was found in python-ipaddress. Improper input validation of octal strings in stdlib ipaddress allows unauthenticated remote attackers to perform indeterminate SSRF, RFI, and LFI attacks on many programs that rely on Python stdlib ipaddress. The highest threat from this vulnerability is to data integrity and system availability.
Other sources
Improper input validation of octal strings in Python 3.8.0 thru v3.10 stdlib ipaddress allows unauthenticated remote attackers to perform indeterminate SSRF, RFI, and LFI attacks on many programs that rely on Python stdlib ipaddress. IP address octects are left stripped instead of evaluated as valid IP addresses. For example, an attacker submitting an IP address to a web application that relies on stdlib ipaddress, could cause SSRF via inputting octal input data; An attacker can submit exploitable IP addresses if the octet is 3 digits, with the minimum exploitable octect being 08 (Denial of Service) and the maximum exploitable octet is 099. For example, an attacker can submit 010.8.8.8, which is 8.8.8.8, yet Python ipaddress builtin will evaluate this as 10.8.8.8.
References:
https://bugs.python.org/issue36384#msg392423
— Red Hat
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 Software
Remediation
Patch Available
Patch Available
Patch Available
Patch Available
Patch Available
Patch Available
Patch Available
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is the vulnerability ID?
The vulnerability ID is CVE-2021-29921.
What is the severity of CVE-2021-29921?
The severity of CVE-2021-29921 is critical.
How does CVE-2021-29921 affect Python before version 3.9.5?
CVE-2021-29921 allows unauthenticated remote attackers to perform SSRF, RFI, and LFI attacks on programs that rely on Python stdlib ipaddress.
How can I fix CVE-2021-29921?
To fix CVE-2021-29921, update to Python version 3.9.5 or later.
Where can I find more information about CVE-2021-29921?
You can find more information about CVE-2021-29921 at the following references: [CVE-2021-29921](https://www.cve.org/CVERecord?id=CVE-2021-29921), [NVD](https://nvd.nist.gov/vuln/detail/CVE-2021-29921), [Python Security](https://python-security.readthedocs.io/vuln/ipaddress-ipv4-leading-zeros.html), [Red Hat Bugzilla](https://bugzilla.redhat.com/show_bug.cgi?id=1957458), [Red Hat Security Advisory](https://access.redhat.com/errata/RHSA-2021:4160).