Buffer overflow in Python - CVE-2021-3177

 

Buffer overflow in Python - CVE-2021-3177

Published: January 19, 2021 / Updated: July 20, 2022


Vulnerability identifier: #VU49973
CSH Severity: High
CVSS v4: 9.3 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2021-3177
CWE-ID: CWE-119
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to execute arbitrary code on the target system.

The vulnerability exists due to a boundary within the PyCArg_repr in _ctypes/callproc.c. A remote attacker can pass specially crafted input to the Python applications that accept floating-point numbers as untrusted input, trigger memory corruption and execute arbitrary code on the target system.

Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.


Affected software

Python
Amazon Linux AMI
Arch Linux
Gentoo Linux
Oracle Linux
Red Hat Enterprise Linux for Scientific Computing
CentOS
Red Hat Enterprise Linux for x86_64
Red Hat Enterprise Linux for ARM 64
Red Hat Enterprise Linux for IBM z Systems
Red Hat Enterprise Linux for Power, little endian
Anolis OS
Ubuntu
openEuler
Fedora
cflinuxfs3
XtremIO X2
Cloud Pak for Security (CP4S)
Red Hat OpenShift Jaeger
Spectrum Discover
Red Hat Advanced Cluster Management for Kubernetes
IBM Security Guardium Insights
IBM Robotic Process Automation
python3 (Red Hat package)
python3.7-minimal (Ubuntu package)
python3.11 (Ubuntu package)
python3.11-minimal (Ubuntu package)
python3.8 (Ubuntu package)
python3.8-minimal (Ubuntu package)
python3.9 (Ubuntu package)
python3.9-minimal (Ubuntu package)
python3.6 (Ubuntu package)
python3.6-minimal (Ubuntu package)
python3.7 (Ubuntu package)
python3.5 (Ubuntu package)
python3.5-minimal (Ubuntu package)
python38-wcwidth
python38-PyMySQL
python38-pluggy
python38-Cython
python38-wheel
python38-wheel-wheel
python38-markupsafe
python38-asn1crypto
python38-atomicwrites
python38-scipy
python38-pysocks
python38-py
python38-six
python38-cffi
python38-numpy
python38-numpy-f2py
python38-numpy-doc
python38-urllib3
python38-pyparsing
python38-babel
python2.7-minimal (Ubuntu package)
python2.7 (Ubuntu package)
python27
python2.7
python38-cryptography
python38-psycopg2-tests
python38-psycopg2-doc
python38-psycopg2
python38-idna
python38-jinja2
python38-pycparser
python38-requests
python38-chardet
python3.4 (Ubuntu package)
python3.4-minimal (Ubuntu package)
python36
python3.6
python3
python3-debug
python3-devel
python3-debuginfo
python3-debugsource
python3-help
python37
python3.7
mingw-python3
python3.8
python38-test
python38-rpm-macros
python38-tkinter
python38-libs
python38-idle
python38-devel
python38-debug
python38
python39
python3.9
python3.10
python3.10 (Ubuntu package)
python3.10-minimal (Ubuntu package)
python38-ply
python3.12 (Ubuntu package)
python3.12-minimal (Ubuntu package)
python38-lxml
python38-pytest
python38-mod_wsgi
python38-pyyaml
python38-psutil
python38-more-itertools
python38-packaging
python38-attrs
python38-pip-wheel
python38-pip
python38-setuptools
python38-setuptools-wheel
python38-pytz
Red Hat OpenShift Container Platform
Oracle Communications Pricing Design Center
Oracle Communications Offline Mediation Controller
Oracle Enterprise Manager Ops Center
CF Deployment
Oracle Communications Cloud Native Core Network Function Cloud Native Environment
Web Terminal
Junos Space Security Director
Contrail Networking
OpenShift Virtualization
Dell EMC Unity XT Operating Environment (OE)
Dell EMC Unity VSA Operating Environment (OE)
Dell EMC Unity Operating Environment (OE)
RecoverPoint for VMs

How to mitigate CVE-2021-3177

Install update from vendor's website.

cflinuxfs3 - update to 0.227.0
Cloud Pak for Security (CP4S) - update to 1.8.0.0
Red Hat OpenShift Jaeger - addressed in versions 1.17.9, 1.20.4
Spectrum Discover - addressed in versions 2.0.3.5, 2.0.4.2
Red Hat Advanced Cluster Management for Kubernetes - update to 2.3.12
IBM Security Guardium Insights - update to 3.0
python3 (Red Hat package) - update to 3.6.8-37.el8
Red Hat OpenShift Container Platform - update to 3.11.784
CF Deployment - update to 16.7.0
python3.7-minimal (Ubuntu package) - addressed in versions Ubuntu Pro, 3.7.5-2~18.04.4
python3.11 (Ubuntu package) - addressed in versions Ubuntu Pro, 3.11.6-3ubuntu0.1
python3.11-minimal (Ubuntu package) - addressed in versions Ubuntu Pro, 3.11.6-3ubuntu0.1
python3.8 (Ubuntu package) - addressed in versions Ubuntu Pro, 3.8.0-3~18.04.1, 3.8.5-1~20.04.2, 3.8.6-1ubuntu0.2, 3.8.10-0ubuntu1~20.04.10
python3.8-minimal (Ubuntu package) - addressed in versions Ubuntu Pro, 3.8.0-3~18.04.1, 3.8.5-1~20.04.2, 3.8.6-1ubuntu0.2, 3.8.10-0ubuntu1~20.04.10
python3.9 (Ubuntu package) - update to Ubuntu Pro
python3.9-minimal (Ubuntu package) - update to Ubuntu Pro
python3.6 (Ubuntu package) - addressed in versions Ubuntu Pro, 3.6.9-1~18.04ubuntu1.4
python3.6-minimal (Ubuntu package) - addressed in versions Ubuntu Pro, 3.6.9-1~18.04ubuntu1.4
python3.7 (Ubuntu package) - addressed in versions Ubuntu Pro, 3.7.5-2~18.04.4
python3.5 (Ubuntu package) - addressed in versions Ubuntu Pro (Infra-only), 3.5.2-2ubuntu0~16.04.13
python3.5-minimal (Ubuntu package) - addressed in versions Ubuntu Pro, 3.5.2-2ubuntu0~16.04.13
python38-wcwidth - update to 0.1.7-16
python38-PyMySQL - update to 0.10.1-1
python38-pluggy - update to 0.13.0-3
python38-Cython - update to 0.29.14-4
python38-wheel - update to 0.33.6-6
python38-wheel-wheel - update to 0.33.6-6
python38-markupsafe - update to 1.1.1-6
python38-asn1crypto - update to 1.2.0-3
Web Terminal - update to 1.3
python38-atomicwrites - update to 1.3.0-8
python38-scipy - update to 1.3.1-4
python38-pysocks - update to 1.7.1-4
python38-py - update to 1.8.0-8
python38-six - update to 1.12.0-10
python38-cffi - update to 1.13.2-3
python38-numpy - update to 1.17.3-6
python38-numpy-f2py - update to 1.17.3-6
python38-numpy-doc - update to 1.17.3-6
python38-urllib3 - update to 1.25.7-5
python38-pyparsing - update to 2.4.5-3
OpenShift Virtualization - addressed in versions 2.6.6, 4.8.0
python38-babel - update to 2.7.0-11
python2.7-minimal (Ubuntu package) - addressed in versions 2.7.6-8ubuntu0.6+esm8, 2.7.12-1ubuntu0~16.04.14, 2.7.12-1ubuntu0~16.04.16, 2.7.12-1ubuntu0~16.04.18, 2.7.17-1~18.04ubuntu1.3, 2.7.17-1~18.04ubuntu1.5, 2.7.17-1~18.04ubuntu1.6, 2.7.17-1~18.04ubuntu1.7, 2.7.18-1~20.04.1, 2.7.68ubuntu0.6+esm10
python2.7 (Ubuntu package) - addressed in versions 2.7.6-8ubuntu0.6+esm8, 2.7.12-1ubuntu0~16.04.14, 2.7.12-1ubuntu0~16.04.16, 2.7.12-1ubuntu0~16.04.18, 2.7.17-1~18.04ubuntu1.3, 2.7.17-1~18.04ubuntu1.5, 2.7.17-1~18.04ubuntu1.6, 2.7.17-1~18.04ubuntu1.7, 2.7.18-1~20.04.1, 2.7.68ubuntu0.6+esm10
python27 - update to 2.7.18-8.fc32
python2.7 - update to 2.7.18-8.fc33
python38-cryptography - update to 2.8-3
python38-psycopg2-tests - update to 2.8.4-4
python38-psycopg2-doc - update to 2.8.4-4
python38-psycopg2 - update to 2.8.4-4
python38-idna - update to 2.8-6
python38-jinja2 - update to 2.10.3-5
python38-pycparser - update to 2.19-3
python38-requests - update to 2.22.0-9
python38-chardet - update to 3.0.4-19
python3.4 (Ubuntu package) - update to 3.4.3-1ubuntu1~14.04.7+esm10
python3.4-minimal (Ubuntu package) - update to 3.4.3-1ubuntu1~14.04.7+esm10
python36 - update to 3.6.13-1.fc32
python3.6 - addressed in versions 3.6.13-1.fc33, 3.6.13-1.fc34, 3.6.13-1.fc35
python3 - addressed in versions 3.7.9-6, 3.7.9-8
python3-debug - addressed in versions 3.7.9-6, 3.7.9-8
python3-devel - addressed in versions 3.7.9-6, 3.7.9-8
python3-debuginfo - addressed in versions 3.7.9-6, 3.7.9-8
python3-debugsource - addressed in versions 3.7.9-6, 3.7.9-8
python3-help - addressed in versions 3.7.9-6, 3.7.9-8
python37 - update to 3.7.10-1.fc32
python3.7 - update to 3.7.10-1.fc33
mingw-python3 - addressed in versions 3.8.3-8.fc32, 3.9.1-2.fc33
python3 - update to 3.8.7-2.fc32
python3.8 - update to 3.8.7-2.fc33
python38-test - update to 3.8.12-1.0.1
python38-rpm-macros - update to 3.8.12-1.0.1
python38-tkinter - update to 3.8.12-1.0.1
python38-libs - update to 3.8.12-1.0.1
python38-idle - update to 3.8.12-1.0.1
python38-devel - update to 3.8.12-1.0.1
python38-debug - update to 3.8.12-1.0.1
python38 - update to 3.8.12-1.0.1
python39 - update to 3.9.1-2.fc32
python3.9 - update to 3.9.1-2.fc33
python3.10 - addressed in versions 3.10.0~a5-1.fc32, 3.10.0~a5-1.fc33
python3.10 (Ubuntu package) - update to 3.10.12-1~22.04.4
python3.10-minimal (Ubuntu package) - update to 3.10.12-1~22.04.4
python38-ply - update to 3.11-10
python3.12 (Ubuntu package) - update to 3.12.0-1ubuntu0.1
python3.12-minimal (Ubuntu package) - update to 3.12.0-1ubuntu0.1
python38-lxml - update to 4.4.1-7
python38-pytest - update to 4.6.6-3
python38-mod_wsgi - update to 4.6.8-3
Dell EMC Unity XT Operating Environment (OE) - update to 5.1.2.0.5.007
Dell EMC Unity VSA Operating Environment (OE) - update to 5.1.2.0.5.007
Dell EMC Unity Operating Environment (OE) - update to 5.1.2.0.5.007
python38-pyyaml - update to 5.4.1-1
python38-psutil - update to 5.6.4-4
RecoverPoint for VMs - update to 6.0.SP1.P1
XtremIO X2 - update to 6.4.1-11
python38-more-itertools - update to 7.2.0-5
python38-packaging - update to 19.2-3
python38-attrs - update to 19.3.0-3
python38-pip-wheel - update to 19.3.1-5
python38-pip - update to 19.3.1-5
IBM Robotic Process Automation - update to 21.0.5
Junos Space Security Director - update to 24.1R3
python38-setuptools - update to 41.6.0-5
python38-setuptools-wheel - update to 41.6.0-5
Contrail Networking - update to 2011.L5
python38-pytz - update to 2019.3-3

External References

Related Security Bulletins