PT-2021-2441 · Python+9 · Python+9

Matthias Kaiser

·

Published

2021-01-19

·

Updated

2026-05-18

·

CVE-2021-3177

CVSS v2.0

10

Critical

VectorAV:N/AC:L/Au:N/C:C/I:C/A:C
Name of the Vulnerable Software and Affected Versions: Python versions 3.x through 3.9.1
Description: The issue is related to a buffer overflow in the PyCArg repr function in ctypes/callproc.c, which may lead to remote code execution in certain Python applications that accept floating-point numbers as untrusted input. This occurs because sprintf is used unsafely. The vulnerability can be exploited when handling untrusted floating-point numbers in handlers that call C functions using the ctypes mechanism.
Recommendations: For Python versions 3.x through 3.9.1, update to a newer version that contains a fix for this issue, such as Python 3.7.10 or 3.6.13. For Python 3.8 and 3.9, wait for the release of the updated versions, which are currently in the release candidate stage. As a temporary workaround, consider restricting the use of the ctypes mechanism to minimize the risk of exploitation. Avoid using the c double.from param function with untrusted input until the issue is resolved.

Exploit

Fix

RCE

Buffer Overflow

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

ALSA-2021:1761
ALSA-2021:1879
ALT-PU-2021-1412
ALT-PU-2021-2420
ALT-PU-2021-2478
ALT-PU-2021-2653
ALT-PU-2024-3474
BDU:2021-01781
BIT-LIBPYTHON-2021-3177
BIT-PYTHON-2021-3177
BIT-PYTHON-MIN-2021-3177
CESA-2021_1633
CESA-2021_1761
CESA-2021_1879
CESA-2022_5235
CLEANSTART-2026-BM51903
CLEANSTART-2026-SY44974
CVE-2021-3177
DLA-2619-1
DLA-2919-1
DLA-3432-1
MGASA-2021-0064
OESA-2021-1036
OESA-2021-1066
OPENSUSE-SU-2021:0270-1
OPENSUSE-SU-2021:0331-1
OPENSUSE-SU-2021_0270-1
OPENSUSE-SU-2021_0331-1
OPENSUSE-SU-2024:11202-1
OPENSUSE-SU-2024:11283-1
OPENSUSE-SU-2024:11284-1
OPENSUSE-SU-2024:11285-1
OPENSUSE-SU-2024:11286-1
OPENSUSE-SU-2024:12089-1
OPENSUSE-SU-2024:12910-1
OPENSUSE-SU-2024:14109-1
OPENSUSE-SU-2024:14434-1
OPENSUSE-SU-2025:15713-1
PSF-2021-3
RHSA-2021:1633
RHSA-2021:1761
RHSA-2021:1879
RHSA-2021:3252
RHSA-2021:3254
RHSA-2021_1633
RHSA-2021_1761
RHSA-2021_1879
RHSA-2022:5235
RHSA-2022_5235
RLSA-2021:1761
RLSA-2021:1879
ROSA-SA-2023-2203
ROSA-SA-2025-2646
ROSA-SA-2025-2873
SUSE-FU-2022:0444-1
SUSE-FU-2022:0445-1
SUSE-SU-2021:0355-1
SUSE-SU-2021:0428-1
SUSE-SU-2021:0432-1
SUSE-SU-2021:0529-1
USN-4754-1
USN-4754-2
USN-4754-3
USN-4754-4
USN-4754-5
USN-6891-1

Affected Products

Alt Linux
Almalinux
Astra Linux
Centos
Linuxmint
Python
Red Hat
Rocky Linux
Suse
Ubuntu