BIT-libpython-2021-3177: Buffer Overflow

Published Jan 19, 2021
·
Updated

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.

Affected Software

1 affected component
Python Software Foundation Python<=3.9.1

Event History

Jan 19, 2021
CVE Published
via OSV·06:15 AM
Data Sourced
via OSV·06:15 AM
DescriptionSeverity

Frequently Asked Questions

1

Which deployments are most exposed?

Python applications that accept floating-point values from untrusted sources are the relevant exposure scenario, particularly where those values reach ctypes handling.

2

What does exploitation require?

The described attack is network-reachable, requires no privileges or user interaction, and can be triggered with an untrusted floating-point input. A 1e300 argument passed to c_double.from_param is given as an example.

3

How can I determine whether a system is affected?

Check whether it uses Python 3.x through 3.9.1. Then identify application paths where untrusted floating-point input may be passed to c_double.from_param or related ctypes processing.

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