CVE-2021-3177: Buffer Overflow

Published Jan 19, 2021
·
Updated

A flaw was found in python. A stack-based buffer overflow was discovered in the ctypes module provided within Python. Applications that use ctypes without carefully validating the input passed to it may be vulnerable to this flaw, which would allow an attacker to overflow a buffer on the stack and crash the application. The highest threat from this vulnerability is to system availability.

Other sources

Python 3.x through 3.9.1 has a buffer overflow in PyCArgrepr in ctypes/callproc.c, which may lead to remote code execution in certain Python applications that accept floating-point numbers as untrusted input, as demonstrated by a 1e300 argument to cdouble.fromparam. This occurs because sprintf is used unsafely.

Python 3.x through 3.9.1 has a buffer overflow in PyCArgrepr in ctypes/callproc.c, which may lead to remote code execution in certain Python applications that accept floating-point numbers as untrusted input.

Reference:

https://bugs.python.org/issue42938 https://github.com/python/cpython/pull/24239

Red Hat

Python is vulnerable to a buffer overflow, caused by improper bounds checking by the PyCArgrepr function in ctypes/callproc.c. By sending specially-crafted arguments to cdouble.fromparam, a remote attacker could overflow a buffer and execute arbitrary code on the system.

IBM

Affected Software

30 affected componentsFixes available
redhat/python<0:2.7.5-92.el7_9
0:2.7.5-92.el7_9
redhat/python3<0:3.6.8-37.el8
0:3.6.8-37.el8
redhat/python27-babel<0:0.9.6-10.el7
0:0.9.6-10.el7
redhat/python27-python<0:2.7.18-3.el7
0:2.7.18-3.el7
redhat/python27-python-jinja2<0:2.6-16.el7
0:2.6-16.el7
redhat/python27-python-pygments<0:1.5-5.el7
0:1.5-5.el7
redhat/rh-python38-babel<0:2.7.0-12.el7
0:2.7.0-12.el7
redhat/rh-python38-python<0:3.8.11-2.el7
0:3.8.11-2.el7
redhat/rh-python38-python-cryptography<0:2.8-5.el7
0:2.8-5.el7
redhat/rh-python38-python-jinja2<0:2.10.3-6.el7
0:2.10.3-6.el7
redhat/rh-python38-python-lxml<0:4.4.1-7.el7
0:4.4.1-7.el7
redhat/rh-python38-python-pip<0:19.3.1-2.el7
0:19.3.1-2.el7
redhat/rh-python38-python-urllib3<0:1.25.7-7.el7
0:1.25.7-7.el7
debian/python2.7
2.7.18-8+deb11u1
debian/python3.9
3.9.2-13.9.2-1+deb11u3
Python Python>=3.6.0<=3.6.12
Python Python>=3.7.0<=3.7.9
Python Python>=3.8.0<=3.8.7
Python Python>=3.9.0<=3.9.1
Fedoraproject Fedora=32
Fedoraproject Fedora=33
NetApp Active Iq Unified Manager Vmware Vsphere
NetApp Active Iq Unified Manager Windows
NetApp ONTAP Select Deploy administration utility
Debian Debian Linux=9.0
Oracle Communications Cloud Native Core Network Function Cloud Native Environment=22.2.0
Oracle Communications Offline Mediation Controller=12.0.0.3.0
Oracle Communications Pricing Design Center=12.0.0.3.0
Oracle Enterprise Manager Ops Center=12.4.0.0
Oracle ZFS Storage Appliance Kit=8.8

Event History

Jan 19, 2021
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via NVD·06:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 20, 2021
Data Sourced
via Red Hat·08:45 AM
DescriptionSeverityAffected Software
Jan 11, 2024
Data Sourced
via Launchpad·11:56 PM
Description
Aug 3, 2024
Data Sourced
via IBM·10:19 PM
DescriptionSeverityAffected Software
Sep 16, 2024
Data Sourced
via Ubuntu·02:31 AM
RemedyDescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2021-3177?

CVE-2021-3177 is a vulnerability in Python that allows an attacker to overflow a buffer on the stack and potentially execute arbitrary code.

2

What is the severity of CVE-2021-3177?

The severity of CVE-2021-3177 is critical with a CVSS score of 9.8.

3

Which versions of Python are affected by CVE-2021-3177?

Python versions 2.7.0 to 2.7.18, 3.6.0 to 3.6.12, 3.7.0 to 3.7.9, 3.8.0 to 3.8.7, and 3.9.0 to 3.9.1 are affected by CVE-2021-3177.

4

How can I fix CVE-2021-3177?

To fix CVE-2021-3177, upgrade to Python versions 2.7.19, 3.6.13, 3.7.10, 3.8.8, or 3.9.2 or later.

5

Are there any references for CVE-2021-3177?

Yes, you can find more information about CVE-2021-3177 at the following references: [Link 1](https://bugs.python.org/issue42938), [Link 2](https://github.com/python/cpython/pull/24239), [Link 3](https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=1918175).

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