CVE-2021-3177
Critical 9.8 CVSS 3.1
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.
Description as published by the source, in English.
Key facts
- Published
- 2021-01-19
- Last modified
- 2026-10-14
- Assigned by
- cve@mitre.org
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H- Scored by
- nvd@nist.gov (NVD Primary)
- Probability of exploitation
-
23.3 %
higher than 98 %
of all known vulnerabilities
EPSS, next 30 days, model v2026.06.15 - Fix available
- Yes, see references
Affected products
| Vendor | Product | Versions | Status |
|---|---|---|---|
| Debian | Debian Linux | 9.0 | Affected |
| Fedoraproject | Fedora | 32 | Affected |
| Fedoraproject | Fedora | 33 | Affected |
| Netapp | Active Iq Unified Manager | all versions listed | Affected |
| Netapp | Ontap Select Deploy Administration Utility | all versions listed | Affected |
| Oracle | Communications Cloud Native Core Network Function Cloud Native Environment | 22.2.0 | Affected |
| Oracle | Communications Offline Mediation Controller | 12.0.0.3.0 | Affected |
| Oracle | Communications Pricing Design Center | 12.0.0.3.0 | Affected |
| Oracle | Enterprise Manager Ops Center | 12.4.0.0 | Affected |
| Oracle | Zfs Storage Appliance Kit | 8.8 | Affected |
| Python | Python | ≥ 3.6.0, ≤ 3.6.12 | Affected |
| Python | Python | ≥ 3.7.0, ≤ 3.7.9 | Affected |
| Python | Python | ≥ 3.8.0, ≤ 3.8.7 | Affected |
| Python | Python | ≥ 3.9.0, ≤ 3.9.1 | Affected |
Weakness type
-
CWE-120: Buffer Copy without Checking Size of Input
The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer.
References
- https://bugs.python.org/issue42938
- https://github.com/python/cpython/pull/24239
- https://lists.debian.org/debian-lts-announce/2021/04/msg00005.html
- https://lists.debian.org/debian-lts-announce/2022/02/msg00013.html
- https://news.ycombinator.com/item?id=26185005
- https://python-security.readthedocs.io/vuln/ctypes-buffer-overflow-pycarg_repr.html
- https://security.gentoo.org/glsa/202101-18
- https://security.netapp.com/advisory/ntap-20210226-0003/
- https://www.oracle.com//security-alerts/cpujul2021.html
- https://www.oracle.com/security-alerts/cpujan2022.html
- https://www.oracle.com/security-alerts/cpujul2022.html
- https://www.oracle.com/security-alerts/cpuoct2021.html
- https://bugs.python.org/issue42938
- https://github.com/python/cpython/pull/24239
- https://lists.debian.org/debian-lts-announce/2021/04/msg00005.html
- https://lists.debian.org/debian-lts-announce/2022/02/msg00013.html
- https://news.ycombinator.com/item?id=26185005
- https://python-security.readthedocs.io/vuln/ctypes-buffer-overflow-pycarg_repr.html
- https://security.gentoo.org/glsa/202101-18
- https://security.netapp.com/advisory/ntap-20210226-0003/
Does this affect you?
A vulnerability matters only if you run the product, in an affected version, somewhere an attacker can reach.