Critical
Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-3177
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 11:45 UTC · Revision 1
Source evidence
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.
osv:CVE-2021-3177
Complete source record
{
"id": "937cd58660436f06b961ab2d07586be5daa9bee12393f38db24a2654db4e8ebd",
"url": "https://osv.dev/vulnerability/CVE-2021-3177",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-3177",
"summary": "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.",
"evidence": "osv:CVE-2021-3177",
"products": [],
"severity": "critical",
"structured": {
"id": "CVE-2021-3177",
"aliases": [
"BIT-libpython-2021-3177",
"BIT-python-2021-3177",
"BIT-python-min-2021-3177",
"CVE-2021-3177",
"PSF-2021-3"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/python/cpython",
"type": "GIT",
"events": [
{
"introduced": "5c4568a05a0a62b5947c55f68f9f2ecfb90a4f12"
},
{
"last_affected": "c0a9afe2ac1820409e6173bd1893ebee2cf50270"
},
{
"introduced": "1bf9cc509326bc42cd8cb1650eb9bf64550d817e"
},
{
"last_affected": "13c94747c74437e594b7fc242ff7da668e81887c"
},
{
"introduced": "fa919fdf2583bdfead1df00e842f24f30b2a34bf"
},
{
"last_affected": "6503f05dd59e26a9986bdea097b3da9b3546f45b"
},
{
"introduced": "9cf6752276e6fcfd0c23fdb064ad27f448aaaf75"
},
{
"last_affected": "1e5d33e9b9b8631b36f061103a30208b206fd03a"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:python:python:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "3.6.0"
},
{
"last_affected": "3.6.12"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:python:python:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "3.7.0"
},
{
"last_affected": "3.7.9"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:python:python:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "3.8.0"
},
{
"last_affected": "3.8.7"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:python:python:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "3.9.0"
},
{
"last_affected": "3.9.1"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-3177.json"
}
}
],
"modified": "2026-10-20T10:54:40.569282426Z",
"provider": "osv",
"references": [
"https://cert-portal.siemens.com/productcert/html/ssa-398330.html",
"https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772%40%3Cdev.mina.apache.org%3E",
"https://lists.debian.org/debian-lts-announce/2023/05/msg00024.html",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRHOCQYX3QLDGDQGTWQAUUT2GGIZCZUO/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CCFZMVRQUKCBQIG5F2CBVADK63NFSE4A/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FONHJIOZOFD7CD35KZL6SVBUTMBPGZGA/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FPE7SMXYUIWPOIZV4DQYXODRXMFX3C5E/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HCQTCSP6SCVIYNIRUJC5X7YBVUHPLSC4/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MGSV6BJQLRQ6RKVUXK7JGU7TP4QFGQXC/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MP572OLHMS7MZO4KUPSCIMSZIA5IZZ62/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NODWHDIFBQE5RU5PUWUVE47JOT5VCMJ2/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NQPARTLNSFQVMMQHPNBFOCOZOO3TMQNA/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NXSMBHES3ANXXS2RSO5G6Q24BR4B2PWK/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/V6XJAULOS5JVB2L67NCKKMJ5NTKZJBSD/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Y4KSYYWMGAKOA2JVCQA422OINT6CKQ7O/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YDTZVGSXQ7HR7OCGSUHTRNTMBG43OMKU/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Z7GZV74KM72O2PEJN2C4XP3V5Q5MZUOO/",
"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://security.gentoo.org/glsa/202101-18",
"https://security.netapp.com/advisory/ntap-20210226-0003/",
"https://bugs.python.org/issue42938",
"https://github.com/python/cpython/pull/24239",
"https://python-security.readthedocs.io/vuln/ctypes-buffer-overflow-pycarg_repr.html",
"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"
],
"provider_metadata": {
"unresolved_ranges": [
{
"cpes": [
"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*"
],
"vendor_product": "debian:debian_linux",
"extracted_events": [
{
"range": [
{
"introduced": "9.0"
},
{
"last_affected": "9.0"
}
],
"source": "CPE_STRING"
}
]
},
{
"cpes": [
"cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*",
"cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*"
],
"vendor_product": "fedoraproject:fedora",
"extracted_events": [
{
"range": [
{
"introduced": "32"
},
{
"last_affected": "32"
},
{
"introduced": "33"
},
{
"last_affected": "33"
}
],
"source": "CPE_STRING"
}
]
},
{
"cpes": [
"cpe:2.3:a:oracle:communications_cloud_native_core_network_function_cloud_native_environment:22.2.0:*:*:*:*:*:*:*"
],
"vendor_product": "oracle:communications_cloud_native_core_network_function_cloud_native_environment",
"extracted_events": [
{
"range": [
{
"introduced": "22.2.0"
},
{
"last_affected": "22.2.0"
}
],
"source": "CPE_STRING"
}
]
},
{
"cpes": [
"cpe:2.3:a:oracle:communications_offline_mediation_controller:12.0.0.3.0:*:*:*:*:*:*:*"
],
"vendor_product": "oracle:communications_offline_mediation_controller",
"extracted_events": [
{
"range": [
{
"introduced": "12.0.0.3.0"
},
{
"last_affected": "12.0.0.3.0"
}
],
"source": "CPE_STRING"
}
]
},
{
"cpes": [
"cpe:2.3:a:oracle:communications_pricing_design_center:12.0.0.3.0:*:*:*:*:*:*:*"
],
"vendor_product": "oracle:communications_pricing_design_center",
"extracted_events": [
{
"range": [
{
"introduced": "12.0.0.3.0"
},
{
"last_affected": "12.0.0.3.0"
}
],
"source": "CPE_STRING"
}
]
},
{
"cpes": [
"cpe:2.3:a:oracle:enterprise_manager_ops_center:12.4.0.0:*:*:*:*:*:*:*"
],
"vendor_product": "oracle:enterprise_manager_ops_center",
"extracted_events": [
{
"range": [
{
"introduced": "12.4.0.0"
},
{
"last_affected": "12.4.0.0"
}
],
"source": "CPE_STRING"
}
]
},
{
"cpes": [
"cpe:2.3:a:oracle:zfs_storage_appliance_kit:8.8:*:*:*:*:*:*:*"
],
"vendor_product": "oracle:zfs_storage_appliance_kit",
"extracted_events": [
{
"range": [
{
"introduced": "8.8"
},
{
"last_affected": "8.8"
}
],
"source": "CPE_STRING"
}
]
}
]
}
},
"related_cves": [
{
"value": "CVE-2021-3177",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 385862,
"published_at": "2021-01-19T06:15:12.967+00:00"
}