Skip to content
Fencer Vulns
critical 9.8

CVE-2021-3177 in the critical feed json

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 Pyt…

published 2021-01-19 5 y ago modified 2026-10-14 26 d ago also BIT-libpython-2021-3177 , BIT-python-2021-3177 , BIT-python-min-2021-3177 , EUVD-2021-26520

cvss
9.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
24.0%
EPSS 24.0% chance of exploitation in 30 days, percentile 97%
public exploits
0
none known

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.

Patch / fix

  • bitnami libpython 3.6.13, 3.7.10, 3.8.8, 3.9.2
  • bitnami python 3.6.13, 3.7.10, 3.8.8, 3.9.2
  • bitnami python-min 3.6.13, 3.7.10, 3.8.8, 3.9.2
  • Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP V3.1.5
  • Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP V3.1.5
  • Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP V3.1.5
  • python2.7 Debian 11 2.7.18-2
  • python3.9 Debian 11 3.9.1-3

debian advisories DEBIAN-CVE-2021-3177

  • python2.7 Ubuntu 16.04 LTS 2.7.12-1ubuntu0~16.04.18
  • python2.7 Ubuntu 18.04 LTS 2.7.17-1~18.04ubuntu1.6
  • python2.7 Ubuntu 20.04 LTS 2.7.18-1~20.04.1
  • python3.5 Ubuntu 16.04 LTS 3.5.2-2ubuntu0~16.04.13
  • python3.6 Ubuntu 18.04 LTS 3.6.9-1~18.04ubuntu1.4
  • python3.7 Ubuntu 18.04 LTS 3.7.5-2~18.04.4
  • python3.8 Ubuntu 18.04 LTS 3.8.0-3~18.04.1
  • python3.8 Ubuntu 20.04 LTS 3.8.5-1~20.04.2

ubuntu advisories UBUNTU-CVE-2021-3177

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • python27-babel RHEL 3 SOFTWARE_COLLECTIONS 0.9.6-10.el7
  • python27-python RHEL 3 SOFTWARE_COLLECTIONS 2.7.18-3.el7
  • python27-tkinter RHEL 3 SOFTWARE_COLLECTIONS 2.7.18-3.el7
  • python27-python-libs RHEL 3 SOFTWARE_COLLECTIONS 2.7.18-3.el7
  • python27-python-test RHEL 3 SOFTWARE_COLLECTIONS 2.7.18-3.el7
  • python27-python-babel RHEL 3 SOFTWARE_COLLECTIONS 0.9.6-10.el7
  • python27-python-tools RHEL 3 SOFTWARE_COLLECTIONS 2.7.18-3.el7
  • python27-python-jinja2 RHEL 3 SOFTWARE_COLLECTIONS 2.6-16.el7

red hat advisories RHSA-2021:3252RHSA-2021:3254RHSA-2021:1633RHSA-2022:5235RHSA-2021:1761RHSA-2021:1879

  • python3 SLE Module for Basesystem 15 SP2 3.6.12-3.75.1
  • python3-core SLE Module for Development Tools 15 SP2, SLE Module for Basesystem 15 SP2 3.6.12-3.75.1
  • python SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES for SAP 12 SP3 +14 more 2.7.17-28.64.1
  • python-base SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES for SAP 12 SP3 +15 more 2.7.17-28.64.1
  • python36 SLES for SAP 12 SP5, SLES 12 SP5 3.6.12-4.33.3
  • python36-core SLES for SAP 12 SP5, SLES 12 SP5 3.6.12-4.33.1
  • python SLES for SAP 15 SP1, SLES for SAP 15, SLES 15-LTSS +13 more 2.7.17-7.52.2
  • python-base SLES for SAP 15 SP1, SLES for SAP 15, SLES 15-LTSS +12 more 2.7.17-7.52.2

suse advisories SUSE-SU-2021:0529-1SUSE-SU-2021:0432-1SUSE-SU-2021:0428-1SUSE-SU-2021:0355-1

  • python315 openSUSE Tumbleweed 3.15.0~a1-1.1
  • python314 openSUSE Tumbleweed 3.14.0~a1-1.1
  • python313 openSUSE Tumbleweed 3.13.0~b3-1.1
  • python openSUSE Tumbleweed 2.7.18-8.1
  • python310 openSUSE Tumbleweed 3.10.0rc1-4.2
  • python36 openSUSE Tumbleweed 3.6.15-1.1
  • python38 openSUSE Tumbleweed 3.8.12-1.2
  • python39 openSUSE Tumbleweed 3.9.7-2.1

opensuse advisories openSUSE-SU-2025:15713-1openSUSE-SU-2024:14434-1openSUSE-SU-2024:14109-1openSUSE-SU-2024:11202-1openSUSE-SU-2024:11283-1openSUSE-SU-2024:11284-1

  • python38-ply AlmaLinux 8 3.11-10.module_el8.6.0+2778+cd494b30
  • python38-six AlmaLinux 8 1.12.0-10.module_el8.6.0+2778+cd494b30
  • python38-cffi AlmaLinux 8 1.13.2-3.module_el8.6.0+2778+cd494b30
  • python38-idna AlmaLinux 8 2.8-6.module_el8.6.0+2778+cd494b30
  • python38-pytz AlmaLinux 8 2019.3-3.module_el8.6.0+2778+cd494b30
  • python38-scipy AlmaLinux 8 1.3.1-4.module_el8.6.0+2778+cd494b30
  • python38-Cython AlmaLinux 8 0.29.14-4.module_el8.6.0+2778+cd494b30
  • python38-chardet AlmaLinux 8 3.0.4-19.module_el8.6.0+2778+cd494b30

almalinux advisories ALSA-2021:1879ALSA-2021:1761

  • pytz Rocky Linux 8 2019.3-3.module+el8.4.0+570+c2eaf144
  • babel Rocky Linux 8 2.7.0-10.module+el8.4.0+570+c2eaf144
  • numpy Rocky Linux 8 1.17.3-5.module+el8.4.0+570+c2eaf144
  • scipy Rocky Linux 8 1.3.1-4.module+el8.5.0+672+ab6eb015
  • scipy Rocky Linux 8 1.3.1-4.module+el8.4.0+570+c2eaf144
  • Cython Rocky Linux 8 0.29.14-4.module+el8.4.0+570+c2eaf144
  • PyYAML Rocky Linux 8 5.3.1-1.module+el8.4.0+570+c2eaf144
  • mod_wsgi Rocky Linux 8 4.6.8-3.module+el8.4.0+570+c2eaf144

rocky linux advisories RLSA-2021:1879RLSA-2021:1761

  • python2 Alpine 3.15, Alpine 3.14 2.7.18-r1
  • python3 Alpine 3.10 3.7.7-r2
  • python3 Alpine 3.11 3.8.2-r2
  • python3 Alpine 3.12 3.8.5-r1
  • python3 Alpine 3.13 3.8.7-r1
  • python3 Alpine 3.24, Alpine 3.23, Alpine 3.22 +8 more 3.8.7-r2

alpine advisories ALPINE-CVE-2021-3177

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • python Arch Linux 3.9.2-1

arch linux advisories AVG-1465

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-3177 updated cvss 5.9

python: Stack-based buffer overflow in PyCArg_repr in _ctypes/callproc.c

  • Red Hat Enterprise Linux 5 python Red Hat Enterprise Linux 6 python, tkinter, python-libs, python-test, python-tools Red Hat Enterprise Linux 7 python3, python3-idle, python3-libs, python3-test, python3-tkinter
    affected: no fix planned “Out of support scope”
  • Red Hat Enterprise Linux 9 python2.7
    affected: no fix available
  • Red Hat Enterprise Linux AppStream (v. 8) python3-idle 3.6.8-37.el8, python3-test 3.6.8-37.el8, platform-python 3.6.8-37.el8, python3-tkinter 3.6.8-37.el8, babel 2.5.1-9.module+el8.1.0+3111+de3f2d8e, pytz 2019.3-3.module+el8.4.0+8888+89bc7e79, +152 more
    fixed: vendor fix RHSA-2021:1761
  • Red Hat Enterprise Linux BaseOS (v. 8) python3 3.6.8-37.el8, python3-libs 3.6.8-37.el8, python3-test 3.6.8-37.el8, platform-python 3.6.8-37.el8
    fixed: vendor fix RHSA-2021:1633
  • 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) tkinter 2.7.5-92.el7_9, python-test 2.7.5-92.el7_9, python-tools 2.7.5-92.el7_9 Red Hat Enterprise Linux ComputeNode Optional (v. 7) tkinter 2.7.5-92.el7_9, python-test 2.7.5-92.el7_9, python-tools 2.7.5-92.el7_9 Red Hat Enterprise Linux Server (v. 7) python 2.7.5-92.el7_9, python-libs 2.7.5-92.el7_9 Red Hat Enterprise Linux Server Optional (v. 7) tkinter 2.7.5-92.el7_9, python-test 2.7.5-92.el7_9, python-tools 2.7.5-92.el7_9 Red Hat Enterprise Linux Workstation (v. 7) python 2.7.5-92.el7_9, python-libs 2.7.5-92.el7_9
    +1 more products
    Red Hat Enterprise Linux Workstation Optional (v. 7) tkinter 2.7.5-92.el7_9, python-test 2.7.5-92.el7_9, python-tools 2.7.5-92.el7_9
    fixed: vendor fix RHSA-2022:5235
  • 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-tkinter 2.7.18-3.el7, rh-python38-babel 2.7.0-12.el7, rh-python38-python 3.8.11-2.el7, python27-python-jinja2 2.6-16.el7, +18 more 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-tkinter 2.7.18-3.el7, rh-python38-babel 2.7.0-12.el7, rh-python38-python 3.8.11-2.el7, python27-python-jinja2 2.6-16.el7, +18 more 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-tkinter 2.7.18-3.el7, rh-python38-babel 2.7.0-12.el7, rh-python38-python 3.8.11-2.el7, python27-python-jinja2 2.6-16.el7, +18 more
    fixed: vendor fix RHSA-2021:3252
  • Red Hat Enterprise Linux 8 numpy, scipy, PyYAML, mod_wsgi, python36, python39, +71 more Red Hat Enterprise Linux 9 python3, python3.9, python3-idle, python3-libs, python3-test, python3-tkinter, +1 more
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

cisa ICSA-23-348-10 updated cvss 9.8

Siemens SIMATIC S7-1500

  • Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0) >= 3.1.0, < 3.1.5 Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0) >= 3.1.0, < 3.1.5 Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) >= 3.1.0, < 3.1.5 Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AC0) >= 3.1.0, < 3.1.5 Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP (6AG1518-4AX00-4AC0) >= 3.1.0, < 3.1.5
    affected: fixed in V3.1.5, mitigation support.industry.siemens.com

Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf

CISA SSVC

Exploitation
Proof of concept is public
Automatable
yes
Technical impact
total
Assessed
10 mo ago

Exploit prediction

24.00% chance of exploitation in the next 30 days, higher than 97% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • bugs.python.org https://bugs.python.org/issue42938 referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CISA ADP 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CNA 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD 2.0 7.5 AV:N/AC:L/Au:N/C:P/I:P/A:P
OSV 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
bitnami libpython
<3.6.13
>=3.7.0, <3.7.10
>=3.8.0, <3.8.8
>=3.9.0, <3.9.2
3.6.13
3.7.10
3.8.8
3.9.2
bitnami python
<3.6.13
>=3.7.0, <3.7.10
>=3.8.0, <3.8.8
>=3.9.0, <3.9.2
3.6.13
3.7.10
3.8.8
3.9.2
bitnami python-min
<3.6.13
>=3.7.0, <3.7.10
>=3.8.0, <3.8.8
>=3.9.0, <3.9.2
3.6.13
3.7.10
3.8.8
3.9.2

Affected products

  • Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP
  • Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP
  • Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP

Classification

Weakness
  • CWE-120 Buffer Copy without Checking Size of Input

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.

CPEs and fixed versions use Anchore's correction of NVD's data: Improve version ranges to indicate fix.