Python 3.x through 3.9.1 has a buffer overflow in PyCArg_repr in _ctypes/callproc.c…
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 12 fixed, 4 without a fix
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA and Red Hat. Impact type from CWE-120 and the CVSS impact.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | — | all versions | — | No fix listed | CNA |
- — Vendor— Affected all versions Fixed in — No fix listed CNA
CPE configurations NVD · 12
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:python:python:*:*:*:*:*:*:*:* | 3.6.0 – 3.6.12; 3.7.0 – 3.7.9; 3.8.0 – 3.8.7; 3.9.0 – 3.9.1 | Vulnerable | python-pillow |
| cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:* | 32 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* | 33 | Vulnerable | Fedoraproject |
| cpe:2.3:a:netapp:active_iq_unified_manager:-:*:*:*:*:vmware_vsphere:*:* | not specified by NVD | Vulnerable | NetApp |
| cpe:2.3:a:netapp:active_iq_unified_manager:-:*:*:*:*:windows:*:* | not specified by NVD | Vulnerable | NetApp |
| cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:* | not specified by NVD | Vulnerable | NetApp |
| cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* | 9.0 | Vulnerable | Debian |
| cpe:2.3:a:oracle:communications_cloud_native_core_network_function_cloud_native_environment:22.2.0:*:*:*:*:*:*:* | 22.2.0 | Vulnerable | Oracle |
| cpe:2.3:a:oracle:communications_offline_mediation_controller:12.0.0.3.0:*:*:*:*:*:*:* | 12.0.0.3.0 | Vulnerable | Oracle |
| cpe:2.3:a:oracle:communications_pricing_design_center:12.0.0.3.0:*:*:*:*:*:*:* | 12.0.0.3.0 | Vulnerable | Oracle |
- cpe:2.3:a:python:python:*:*:*:*:*:*:*:* Versions 3.6.0 – 3.6.12; 3.7.0 – 3.7.9; 3.8.0 – 3.8.7; 3.9.0 – 3.9.1 Vulnerable ·python-pillow
- cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:* Versions 32 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* Versions 33 Vulnerable ·Fedoraproject
- cpe:2.3:a:netapp:active_iq_unified_manager:-:*:*:*:*:vmware_vsphere:*:* Versions not specified by NVD Vulnerable ·NetApp
- cpe:2.3:a:netapp:active_iq_unified_manager:-:*:*:*:*:windows:*:* Versions not specified by NVD Vulnerable ·NetApp
- cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:* Versions not specified by NVD Vulnerable ·NetApp
- cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian
- cpe:2.3:a:oracle:communications_cloud_native_core_network_function_cloud_native_environment:22.2.0:*:*:*:*:*:*:* Versions 22.2.0 Vulnerable ·Oracle
- cpe:2.3:a:oracle:communications_offline_mediation_controller:12.0.0.3.0:*:*:*:*:*:*:* Versions 12.0.0.3.0 Vulnerable ·Oracle
- cpe:2.3:a:oracle:communications_pricing_design_center:12.0.0.3.0:*:*:*:*:*:*:* Versions 12.0.0.3.0 Vulnerable ·Oracle
Remediation
Red Hat 6 advisories
- RHSA-2022:5235 Released 2022-06-28 · Red Hat rating Moderatepython security update
- Red Hat Enterprise Linux Client (v. 7) python-2.7.5-92.el7_9, python-libs-2.7.5-92.el7_9
- Red Hat Enterprise Linux Client Optional (v. 7) python-debug-2.7.5-92.el7_9, python-devel-2.7.5-92.el7_9, python-test-2.7.5-92.el7_9 +2
- Red Hat Enterprise Linux ComputeNode Optional (v. 7) python-debug-2.7.5-92.el7_9, python-test-2.7.5-92.el7_9, python-tools-2.7.5-92.el7_9 +1
- Red Hat Enterprise Linux Server (v. 7) python-2.7.5-92.el7_9, python-devel-2.7.5-92.el7_9, python-libs-2.7.5-92.el7_9 +1
- Red Hat Enterprise Linux Server Optional (v. 7) python-debug-2.7.5-92.el7_9, python-test-2.7.5-92.el7_9, python-tools-2.7.5-92.el7_9 +1
- Red Hat Enterprise Linux Workstation (v. 7) python-2.7.5-92.el7_9, python-devel-2.7.5-92.el7_9, python-libs-2.7.5-92.el7_9
- Red Hat Enterprise Linux Workstation Optional (v. 7) python-debug-2.7.5-92.el7_9, python-test-2.7.5-92.el7_9, python-tools-2.7.5-92.el7_9 +1
- RHSA-2021:3252 Released 2021-08-24 · Red Hat rating Moderatepython27 security update
- Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) python27-babel-0.9.6-10.el7, python27-python-2.7.18-3.el7, python27-python-babel-0.9.6-10.el7 +8
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) python27-babel-0.9.6-10.el7, python27-python-2.7.18-3.el7, python27-python-babel-0.9.6-10.el7 +8
- Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) python27-babel-0.9.6-10.el7, python27-python-2.7.18-3.el7, python27-python-babel-0.9.6-10.el7 +8
- RHSA-2021:3254 Released 2021-08-24 · Red Hat rating Moderaterh-python38 security, bug fix, and enhancement update
- Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) rh-python38-babel-2.7.0-12.el7, rh-python38-python-3.8.11-2.el7, rh-python38-python-babel-2.7.0-12.el7 +14
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) rh-python38-babel-2.7.0-12.el7, rh-python38-python-3.8.11-2.el7, rh-python38-python-babel-2.7.0-12.el7 +14
- Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) rh-python38-babel-2.7.0-12.el7, rh-python38-python-3.8.11-2.el7, rh-python38-python-babel-2.7.0-12.el7 +14
Show 3 more Red Hat advisories
- RHSA-2021:1633 Released 2021-05-18 · Red Hat rating Moderatepython3 security update
- Red Hat Enterprise Linux AppStream (v. 8) platform-python-3.6.8-37.el8, platform-python-debug-3.6.8-37.el8, platform-python-devel-3.6.8-37.el8 +3
- Red Hat Enterprise Linux BaseOS (v. 8) platform-python-3.6.8-37.el8, python3-3.6.8-37.el8, python3-libs-3.6.8-37.el8 +1
- RHSA-2021:1879 Released 2021-05-18 · Red Hat rating Moderatepython38:3.8 security update
- Red Hat Enterprise Linux AppStream (v. 8) Cython-0.29.14-4.module+el8.4.0+8888+89bc7e79.src::python38:3.8, PyYAML-5.3.1-1.module+el8.4.0+8888+89bc7e79.src::python38:3.8, babel-2.7.0-10.module+el8.4.0+8888+89bc7e79.src::python38:3.8 +47
- RHSA-2021:1761 Released 2021-05-18 · Red Hat rating Moderatepython27:2.7 security and bug fix update
- Red Hat Enterprise Linux AppStream (v. 8) Cython-0.28.1-7.module+el8.1.0+3111+de3f2d8e.src::python27:2.7, PyYAML-3.12-16.module+el8.1.0+3111+de3f2d8e.src::python27:2.7, babel-2.5.1-9.module+el8.1.0+3111+de3f2d8e.noarch::python27:2.7 +47
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 5 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 9 | Affected | No fix yet |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2021:1633, RHSA-2021:1761, RHSA-2021:1879 |
| Red Hat Enterprise Linux BaseOS (v. 8) | Fixed | RHSA-2021:1633 |
| Red Hat Enterprise Linux Client (v. 7) | Fixed | RHSA-2022:5235 |
| Red Hat Enterprise Linux Client Optional (v. 7) | Fixed | RHSA-2022:5235 |
| Red Hat Enterprise Linux ComputeNode Optional (v. 7) | Fixed | RHSA-2022:5235 |
| Red Hat Enterprise Linux Server (v. 7) | Fixed | RHSA-2022:5235 |
| Red Hat Enterprise Linux Server Optional (v. 7) | Fixed | RHSA-2022:5235 |
| Red Hat Enterprise Linux Workstation (v. 7) | Fixed | RHSA-2022:5235 |
| Red Hat Enterprise Linux Workstation Optional (v. 7) | Fixed | RHSA-2022:5235 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) | Fixed | RHSA-2021:3252, RHSA-2021:3254 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) | Fixed | RHSA-2021:3252, RHSA-2021:3254 |
| Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) | Fixed | RHSA-2021:3252, RHSA-2021:3254 |
Not affected: 2 products
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
Timeline
- 2026-10-02 Threatist record created from CVE-2021-3177
- 2026-10-03 Alias added: GHSA-hc96-xw56-vfwh
References
Exploit 1
Patch 6
- 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/cpuoct2021.html
- https://www.oracle.com/security-alerts/cpujan2022.html
- https://www.oracle.com/security-alerts/cpujul2022.html
Advisory 19
- FEDORA-2021-faf88b9499
- FEDORA-2021-cc3ff94cfc
- GLSA-202101-18
- FEDORA-2021-e3a5a74610
- FEDORA-2021-ced31f3f0c
- FEDORA-2021-42ba9feb47
- FEDORA-2021-076a2dccba
- FEDORA-2021-851c6e4e2d
- FEDORA-2021-66547ff92d
- FEDORA-2021-17668e344a
- FEDORA-2021-d5cde50865
- FEDORA-2021-7547ad987f
- FEDORA-2021-f4fd9372c7
- FEDORA-2021-3352c1c802
- FEDORA-2021-907f3bacae
- [debian-lts-announce] 20210405 [SECURITY] [DLA 2619-1] python3.5 security update
- https://news.ycombinator.com/item?id=26185005
- https://security.netapp.com/advisory/ntap-20210226-0003/
- [debian-lts-announce] 20220212 [SECURITY] [DLA 2919-1] python2.7 security update
Sources
- CVE-2021-3177 · CVE Program
- CVE-2021-3177 · NVD
- FIRST EPSS
- GHSA-hc96-xw56-vfwh · GitHub Advisory Database · CC BY 4.0
- CVE-2021-3177 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences