9.8critical
ctypes: Buffer overflow in PyCArg_repr
- Severity
- 9.8critical CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 24.0% (higher than 97% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- PSF-2021-3BIT-LIBPYTHON-2021-3177BIT-PYTHON-2021-3177BIT-PYTHON-MIN-2021-3177
Description
Python 3.x through 3.9.1 has a buffer overflow in PyCArg_repr 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 c_double.from_param. This occurs because sprintf is used unsafely.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| https://github.com/python/cpython | before 34df10a9a16b38d54421eeeaf73ec89828563be7, before 916610ef90a0d0761f08747f7b0905541f0977c7, before c347cbe694743cee120457aa6626712f7799a932, before d9b8f138b7df3b455b54653ca59f491b4840d6fa, before ece5dfd403dac211f8d3c72701fe7ba7b7aa5b5f | Python Software Foundation |
| python python | from 3.6.0 up to 3.6.12, from 3.7.0 up to 3.7.9, from 3.8.0 up to 3.8.7, from 3.9.0 up to 3.9.1 | NVD |
| fedoraproject fedora | 32, 33 | NVD |
| netapp active_iq_unified_manager | Not specified | NVD |
| netapp ontap_select_deploy_administration_utility | Not specified | NVD |
| debian debian_linux | 9.0 | NVD |
| oracle communications_cloud_native_core_network_function_cloud_native_environment | 22.2.0 | NVD |
| oracle communications_offline_mediation_controller | 12.0.0.3.0 | NVD |
| oracle communications_pricing_design_center | 12.0.0.3.0 | NVD |
| oracle enterprise_manager_ops_center | 12.4.0.0 | NVD |
| oracle zfs_storage_appliance_kit | 8.8 | NVD |
| libpython (Bitnami) | before 3.6.13, from 3.7.0 before 3.7.10, from 3.8.0 before 3.8.8, from 3.9.0 before 3.9.2 | Bitnami Vulnerability Database |
| python (Bitnami) | before 3.6.13, from 3.7.0 before 3.7.10, from 3.8.0 before 3.8.8, from 3.9.0 before 3.9.2 | Bitnami Vulnerability Database |
| python-min (Bitnami) | before 3.6.13, from 3.7.0 before 3.7.10, from 3.8.0 before 3.8.8, from 3.9.0 before 3.9.2 | Bitnami Vulnerability Database |
All scores
| CISA-ADP | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
| Bitnami Vulnerability Database | critical rating |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.
What each source says
CVE List
Python 3.x through 3.9.1 has a buffer overflow in PyCArg_repr 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 c_double.from_param. This occurs because sprintf is used unsafely.
NVD (es)
Python versiones 3.x hasta 3.9.1, presenta un desbordamiento de búfer en la función PyCArg_repr en el archivo _ctypes/callproc.c, que puede conllevar a una ejecución de código remota en determinadas aplicaciones de Python que aceptan números de punto flotante como entrada no confiable, como es demostrado por un argumento 1e300 para c_double.from_param. Esto ocurre porque sprintf es usado de manera no segura
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-3177 changed 2026-10-14 | CVE Terms of Use |
| Python Software Foundation | PSF-2021-3 changed 2025-10-09 | CC-BY-4.0 |
| NVD | CVE-2021-3177 changed 2026-10-14 | Public domain |
| Bitnami Vulnerability Database | BIT-LIBPYTHON-2021-3177 changed 2026-09-08 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-PYTHON-2021-3177 changed 2026-09-08 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-PYTHON-MIN-2021-3177 changed 2026-09-08 | Apache-2.0 |