# CVE-2021-3177: ctypes: Buffer overflow in PyCArg_repr

- Severity: Critical 9.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 24.0%, higher than 97% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-01-19T00:00:00.000Z
- Modified: 2026-10-14T10:17:38.433Z
- Also known as: PSF-2021-3, BIT-LIBPYTHON-2021-3177, BIT-PYTHON-2021-3177, BIT-PYTHON-MIN-2021-3177
- Weaknesses: CWE-120
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: mitre

## 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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- https://github.com/python/cpython: before 34df10a9a16b38d54421eeeaf73ec89828563be7; before 916610ef90a0d0761f08747f7b0905541f0977c7; before c347cbe694743cee120457aa6626712f7799a932; before d9b8f138b7df3b455b54653ca59f491b4840d6fa; before ece5dfd403dac211f8d3c72701fe7ba7b7aa5b5f
- 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
- fedoraproject fedora: 32; 33
- netapp active_iq_unified_manager: no versions given
- netapp ontap_select_deploy_administration_utility: no versions given
- 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
- 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
- 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
- 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

## Every score

- CISA-ADP: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://bugs.python.org/issue42938> (exploit, advisory, issue-tracking, patch, report, vendor-advisory)
- <https://github.com/python/cpython/pull/24239> (advisory, patch, third-party-advisory)
- <https://python-security.readthedocs.io/vuln/ctypes-buffer-overflow-pycarg_repr.html> (advisory, patch, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MGSV6BJQLRQ6RKVUXK7JGU7TP4QFGQXC/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NQPARTLNSFQVMMQHPNBFOCOZOO3TMQNA/> (vendor-advisory, web)
- <https://security.gentoo.org/glsa/202101-18> (advisory, third-party-advisory, vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Z7GZV74KM72O2PEJN2C4XP3V5Q5MZUOO/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CCFZMVRQUKCBQIG5F2CBVADK63NFSE4A/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRHOCQYX3QLDGDQGTWQAUUT2GGIZCZUO/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NXSMBHES3ANXXS2RSO5G6Q24BR4B2PWK/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/V6XJAULOS5JVB2L67NCKKMJ5NTKZJBSD/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YDTZVGSXQ7HR7OCGSUHTRNTMBG43OMKU/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Y4KSYYWMGAKOA2JVCQA422OINT6CKQ7O/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FPE7SMXYUIWPOIZV4DQYXODRXMFX3C5E/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HCQTCSP6SCVIYNIRUJC5X7YBVUHPLSC4/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NODWHDIFBQE5RU5PUWUVE47JOT5VCMJ2/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MP572OLHMS7MZO4KUPSCIMSZIA5IZZ62/> (vendor-advisory, web)
- <https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772%40%3Cdev.mina.apache.org%3E> (mailing-list, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FONHJIOZOFD7CD35KZL6SVBUTMBPGZGA/> (vendor-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2021/04/msg00005.html> (advisory, mailing-list, third-party-advisory)
- <https://www.oracle.com//security-alerts/cpujul2021.html> (advisory, patch, third-party-advisory)
- <https://news.ycombinator.com/item?id=26185005> (advisory, third-party-advisory)
- <https://security.netapp.com/advisory/ntap-20210226-0003/> (advisory, third-party-advisory)
- <https://www.oracle.com/security-alerts/cpuoct2021.html> (advisory, patch, third-party-advisory)
- <https://www.oracle.com/security-alerts/cpujan2022.html> (advisory, patch, third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2022/02/msg00013.html> (advisory, mailing-list, third-party-advisory)
- <https://www.oracle.com/security-alerts/cpujul2022.html> (advisory, patch, third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2023/05/msg00024.html> (mailing-list, web)
- <https://cert-portal.siemens.com/productcert/html/ssa-398330.html>
- <https://access.redhat.com/security/cve/cve-2021-3177> (advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-3177> (web)

## Sources

- CVE List: [CVE-2021-3177](https://www.cve.org/CVERecord?id=CVE-2021-3177), CVE Terms of Use, modified 2026-10-14
- Python Software Foundation: [PSF-2021-3](https://osv.dev/vulnerability/PSF-2021-3), CC-BY-4.0, modified 2025-10-09
- NVD: [CVE-2021-3177](https://nvd.nist.gov/vuln/detail/CVE-2021-3177), Public domain, modified 2026-10-14
- Bitnami Vulnerability Database: [BIT-LIBPYTHON-2021-3177](https://osv.dev/vulnerability/BIT-LIBPYTHON-2021-3177), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-PYTHON-2021-3177](https://osv.dev/vulnerability/BIT-PYTHON-2021-3177), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-PYTHON-MIN-2021-3177](https://osv.dev/vulnerability/BIT-PYTHON-MIN-2021-3177), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-3177 · Whole record: https://cve.day/CVE-2021-3177.json · Rebuilt by cve.day 2026-11-25T22:57:59.507Z
