BIT-libpython-2021-29921: Critical severity Python Software Foundation Python vulnerability

Published May 6, 2021
·
Updated

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

1 affected component
Python Software Foundation Python<3.9.5

Event History

May 6, 2021
CVE Published
via OSV·01:15 PM
Data Sourced
via OSV·01:15 PM
DescriptionSeverity

Frequently Asked Questions

1

Who is exposed to this issue?

Applications using Python's ipaddress library for IP-address-based access control are exposed if they process address strings containing octets with leading zero characters. The affected Python versions are before 3.9.5.

2

What does an attacker need to exploit it?

An attacker needs to provide an IP address string with leading zero characters in one or more octets to an affected application. Exploitation depends on the application's access-control logic relying on ipaddress parsing.

3

Are default Python installations affected?

The vulnerable behavior is in the ipaddress library in Python versions before 3.9.5. Impact requires an application to use that library in IP-address-based access-control decisions.

4

What should be done if patching is not immediately possible?

The provided information does not specify a workaround. Prioritize reviewing and protecting IP-address-based access-control paths that accept address strings with leading-zero octets until affected Python versions can be updated.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203