cve.bz

CVE-2021-4189 Unchecked Return Value

5.3 mediumEPSS 3.6%Fix available

Medium (5.3). EPSS 3.6% estimated probability of exploitation activity in the next 30 days.

On this page
A flaw was found in Python, specifically in the FTP (File Transfer Protocol) client library in PASV (passive) mode. The issue is how the FTP client trusts the host from the PASV response by default. This flaw allows an attacker to set up a malicious FTP server that can trick FTP clients into connecting back to a given IP address and port. This vulnerability could lead to FTP client scanning ports, which otherwise would not have been possible.

Severity

CVSS 3.1

5.3 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
EPSS
3.6% (unchanged from 3.4% a week ago; 3.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 90th percentile. Scored 2026-11-15. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: partial, assessed 2025-06-25. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-252 Unchecked Return Value
OWASP Top 10
A10:2025 Mishandling of Exceptional Conditions
Published
Modified
Assigned by
redhat (CNA)
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-4189 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-4189?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-4189?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-4189 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Badge for a README or a site

CVE-2021-4189

An image that stays current: it is drawn from the data each time it is fetched (a host that proxies images, as GitHub does, may show its copy for a while). Markdown:

[![CVE-2021-4189](https://cve.bz/cve/badge/CVE-2021-4189.svg)](https://cve.bz/cve/CVE-2021-4189)

HTML:

<a href="https://cve.bz/cve/CVE-2021-4189"><img src="https://cve.bz/cve/badge/CVE-2021-4189.svg" alt="CVE-2021-4189"></a>

Affected

Versions

From the NVD's CPE matches.

ProductAffected
python:pythonfrom 3.6.0 before 3.6.14
python:pythonfrom 3.7.0 before 3.7.11
python:pythonfrom 3.8.0 before 3.8.9
python:pythonfrom 3.9.0 before 3.9.3
python:python3.10.0
debian:debian_linux10.0
debian:debian_linux11.0
redhat:enterprise_linux8.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9python2.72.7.13-2+deb9u6DLA-2919-1
Debian10python2.72.7.16-2+deb10u2DLA-3432-1
Debian10python3.73.7.3-2+deb10u5DLA-3477-1
Debian11python3.93.9.2-1+deb11u2DLA-3980-1
Debian12, 13, 14pypy37.3.5+dfsg-2DEBIAN-CVE-2021-4189
Ubuntu18.04:LTSpython2.72.7.17-1~18.04ubuntu1.7UBUNTU-CVE-2021-4189 USN-5342-1
Ubuntu18.04:LTSpython3.63.6.9-1~18.04ubuntu1.7UBUNTU-CVE-2021-4189 USN-5342-1
Ubuntu20.04:LTSpython3.83.8.10-0ubuntu1~20.04.10USN-6891-1
Ubuntu20.04:LTSpython3.83.8.10-0ubuntu1~20.04.4USN-5342-1
Ubuntu22.04:LTSpython3.103.10.12-1~22.04.16USN-8509-1
Ubuntu22.04:LTSpython3.103.10.12-1~22.04.4USN-6891-1
Ubuntu24.04:LTSpython3.123.12.3-1ubuntu0.15USN-8509-1
Ubuntu26.04:LTSpython3.143.14.4-1ubuntu0.1USN-8509-1
UbuntuPro:14.04:LTSpython2.72.7.6-8ubuntu0.6+esm12UBUNTU-CVE-2021-4189 USN-5342-2
UbuntuPro:14.04:LTSpython3.43.4.3-1ubuntu1~14.04.7+esm12UBUNTU-CVE-2021-4189 USN-5342-1
UbuntuPro:14.04:LTSpython3.53.5.2-2ubuntu0~16.04.4~14.04.1+esm1UBUNTU-CVE-2021-4189 USN-6891-1
UbuntuPro:16.04:LTSpython2.72.7.12-1ubuntu0~16.04.18+esm1UBUNTU-CVE-2021-4189 USN-5342-1
8 more for Ubuntu in the JSON and on Ubuntu's page.
Red Hatenterprise_linux:8::appstreamCython, python2-Cython, Cython-debugsource and 1 more0:0.28.1-7.module+el8.1.0+3111+de3f2d8eRHSA-2022:1821
Red Hatenterprise_linux:8::appstreamPyYAML, python2-pyyaml, PyYAML-debugsource and 1 more0:3.12-16.module+el8.1.0+3111+de3f2d8eRHSA-2022:1821
Red Hatenterprise_linux:8::appstreambabel, python2-babel0:2.5.1-10.module+el8.5.0+11014+88fc0d0bRHSA-2022:1821
Red Hatenterprise_linux:8::appstreamnumpy, python2-numpy, numpy-debugsource and 3 more1:1.14.2-16.module+el8.4.0+9406+221a4565RHSA-2022:1821
Red Hatenterprise_linux:8::appstreampytest, python2-pytest0:3.4.2-13.module+el8.1.0+3111+de3f2d8eRHSA-2022:1821
Red Hatenterprise_linux:8::appstreampython-PyMySQL, python2-PyMySQL0:0.8.0-10.module+el8.1.0+3111+de3f2d8eRHSA-2022:1821
Red Hatenterprise_linux:8::appstreampython-attrs, python2-attrs0:17.4.0-10.module+el8.1.0+3111+de3f2d8eRHSA-2022:1821
Red Hatenterprise_linux:8::appstreampython-backports, python2-backports0:1.0-16.module+el8.4.0+9193+f3daf6efRHSA-2022:1821
Red Hatenterprise_linux:8::appstreampython-backports-ssl_match_hostname, python2-backports-ssl_match_hostname0:3.5.0.1-12.module+el8.4.0+9193+f3daf6efRHSA-2022:1821
Red Hatenterprise_linux:8::appstreampython-chardet, python2-chardet0:3.0.4-10.module+el8.1.0+3111+de3f2d8eRHSA-2022:1821
Red Hatenterprise_linux:8::appstreampython-coverage, python2-coverage, python2-coverage-debuginfo and 1 more0:4.5.1-4.module+el8.1.0+3111+de3f2d8eRHSA-2022:1821
Red Hatenterprise_linux:8::appstreampython-dns, python2-dns0:1.15.0-10.module+el8.1.0+3111+de3f2d8eRHSA-2022:1821
40 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Basesystem 15 SP3, Linux Enterprise Module for Desktop Applications 15 SP3, Linux Enterprise Module for Python 2 15 SP3 and 1 morepython2.7.18-150000.38.1SUSE-SU-2022:1091-1
SUSELinux Enterprise Module for Basesystem 15 SP3, Linux Enterprise Module for Python 2 15 SP3, Linux Enterprise Real Time 15 SP2python-base2.7.18-150000.38.2SUSE-SU-2022:1091-1
SUSELinux Enterprise Module for Web and Scripting 12, Linux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5 and 1 morepython33.4.10-25.85.2SUSE-SU-2022:0882-1
SUSELinux Enterprise Module for Web and Scripting 12, Linux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5 and 1 morepython3-base3.4.10-25.85.1SUSE-SU-2022:0882-1
SUSELinux Enterprise Server 12 SP4-LTSS, Linux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP4 and 3 morepython, python-doc, python-base2.7.18-33.8.1SUSE-SU-2022:1140-1
SUSELinux Enterprise Server 15 SP6-LTSS, Linux Enterprise Server for SAP Applications 15 SP6python312, python312-core3.12.14-150600.3.68.1SUSE-SU-2026:4534-1
SUSELinux Enterprise Workstation Extension 12 SP5python-base2.7.18-33.8.1SUSE-SU-2022:1140-1
SUSELinux Micro 6.1python311, python311-core3.11.16-slfo.1.1_1.1SUSE-SU-2026:23743-1
SUSELinux Micro 6.2python3, python313, python313-core3.13.14-160000.1.1SUSE-SU-2026:22959-1
openSUSELeap 15.3python, python-doc2.7.18-150000.38.1openSUSE-SU-2022:1091-1
openSUSELeap 15.3python-base2.7.18-150000.38.2openSUSE-SU-2022:1091-1
openSUSELeap 16.0python3, python313, python313-core and 3 more3.13.14-160000.1.1openSUSE-SU-2026:21459-1
openSUSETumbleweedpython2.7.18-15.1openSUSE-SU-2024:11835-1
openSUSETumbleweedpython3103.10.21-1.1openSUSE-SU-2026:11747-1
openSUSETumbleweedpython3113.11.16-1.1openSUSE-SU-2026:11756-1
openSUSETumbleweedpython3123.12.14-1.1openSUSE-SU-2026:11757-1
openSUSETumbleweedpython3133.13.14-1.1openSUSE-SU-2026:11342-1
openSUSETumbleweedpython3143.14.6-1.1openSUSE-SU-2026:11181-1
openSUSETumbleweedpython3153.15.0~b2-1.1openSUSE-SU-2026:11101-1
openSUSETumbleweedpython3163.16.0~a1-1.1openSUSE-SU-2026:12477-1
AlmaLinux8babel, python2-babel2.5.1-10.module_el8.6.0+2781+fed64c13ALSA-2022:1821
AlmaLinux8python-nose-docs1.3.7-31.module_el8.5.0+2569+5c5719bcALSA-2022:1821
AlmaLinux8python-sqlalchemy-doc1.3.2-2.module_el8.5.0+2569+5c5719bcALSA-2022:1821
AlmaLinux8python2, python2-libs, python2-test and 4 more2.7.18-10.module_el8.6.0+2781+fed64c13.almaALSA-2022:1821
AlmaLinux8python2-Cython0.28.1-7.module_el8.6.0+2781+fed64c13ALSA-2022:1821
AlmaLinux8python2-PyMySQL0.8.0-10.module_el8.6.0+2781+fed64c13ALSA-2022:1821
AlmaLinux8python2-attrs17.4.0-10.module_el8.6.0+2781+fed64c13ALSA-2022:1821
AlmaLinux8python2-backports1.0-16.module_el8.6.0+2781+fed64c13ALSA-2022:1821
AlmaLinux8python2-backports-ssl_match_hostname3.5.0.1-12.module_el8.6.0+2781+fed64c13ALSA-2022:1821
AlmaLinux8python2-bson, python2-pymongo, python2-pymongo-gridfs3.7.0-1.module_el8.6.0+2781+fed64c13ALSA-2022:1821
AlmaLinux8python2-chardet3.0.4-10.module_el8.6.0+2781+fed64c13ALSA-2022:1821
AlmaLinux8python2-coverage4.5.1-4.module_el8.6.0+2781+fed64c13ALSA-2022:1821
33 more for AlmaLinux in the JSON.
Rocky Linux8Cython0:0.28.1-7.module+el8.4.0+403+9ae17a31RLSA-2022:1821
Rocky Linux8Cython0:0.28.1-7.module+el8.5.0+706+735ec4b3RLSA-2022:1821
Rocky Linux8PyYAML0:3.12-16.module+el8.4.0+403+9ae17a31RLSA-2022:1821
Rocky Linux8PyYAML0:3.12-16.module+el8.5.0+706+735ec4b3RLSA-2022:1821
Rocky Linux8babel0:2.5.1-10.module+el8.5.0+706+735ec4b3RLSA-2022:1821
Rocky Linux8numpy1:1.14.2-16.module+el8.4.0+403+9ae17a31RLSA-2022:1821
Rocky Linux8numpy1:1.14.2-16.module+el8.5.0+706+735ec4b3RLSA-2022:1821
Rocky Linux8pytest0:3.4.2-13.module+el8.4.0+403+9ae17a31RLSA-2022:1821
Rocky Linux8pytest0:3.4.2-13.module+el8.5.0+706+735ec4b3RLSA-2022:1821
Rocky Linux8python-PyMySQL0:0.8.0-10.module+el8.3.0+120+426d8bafRLSA-2022:1821
Rocky Linux8python-PyMySQL0:0.8.0-10.module+el8.5.0+706+735ec4b3RLSA-2022:1821
Rocky Linux8python-attrs0:17.4.0-10.module+el8.4.0+403+9ae17a31RLSA-2022:1821
53 more for Rocky Linux in the JSON.

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8python27:2.7-8060020220210185952.8cdc2268Fixed 2022-05-10RHSA-2022:1821
Red Hat Enterprise Linux 8python3-0:3.6.8-45.el8Fixed 2022-05-10RHSA-2022:1986
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-babel-0:2.7.0-12.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-python-0:3.8.11-2.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-python-cryptography-0:2.8-5.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-python-jinja2-0:2.10.3-6.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-python-lxml-0:4.4.1-7.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-python-pip-0:19.3.1-2.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-python-urllib3-0:1.25.7-7.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7python27-python-0:2.7.18-4.el7Fixed 2022-05-02RHSA-2022:1663
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUSrh-python38-babel-0:2.7.0-12.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUSrh-python38-python-0:3.8.11-2.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUSrh-python38-python-cryptography-0:2.8-5.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUSrh-python38-python-jinja2-0:2.10.3-6.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Enterprise Linux 6pythonOut of support scope
Red Hat Enterprise Linux 7pythonOut of support scope
Red Hat Enterprise Linux 7python3Out of support scope
Red Hat Enterprise Linux 8python36:3.6/python36Not affected
Red Hat Enterprise Linux 8python38:3.8/python38Not affected
Red Hat Enterprise Linux 8python39:3.9/python39Not affected
3 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-4189.

ICS advisories (CISA)

AdvisoryTitlePublishedSectorsAffectedFixed
ICSA-23-348-10Siemens SIMATIC S7-15002023-12-12Critical Manufacturing, Transportation Systems, Energy, Healthcare and Public Health, Financial Services, Government Services and FacilitiesSIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0), SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0), SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) and 2 morenone listed

From CISA's ICS advisories (CSAF), provided under CISA's notification. Only the facts are shown; each advisory is on CISA's page. Credits.

References

Check your stackJSON