CVE-2021-4189
n/a python: Unchecked Return Value
Check your servers for CVE-2021-4189
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-4189 affects python, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
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)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality low, integrity none, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 3.61%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 89.7% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 25 Jun 2025):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- yes: an attacker can automate the attack across many targets
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-252 Unchecked Return Value
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
|
python
n/a
|
affected Fixed in python 3.6.14, python 3.7.11, python 3.8.9, python 3.9.3, python 3.10.0
|
Is my server affected?
Find the installed version of python and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i python
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-4189 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-4189RHEL, Rocky, Alma, Fedora
rpm -q python
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-4189Alpine
apk list --installed | grep -i pythonWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2021-4189
trivy image --scanners vuln IMAGE | grep CVE-2021-4189
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://bugs.python.org/issue43285 bugs.python.org
- https://python-security.readthedocs.io/vuln/ftplib-pasv.html python-security.readthedocs.io
- https://github.com/python/cpython/commit/0ab152c6b5d95caa2dc1a30fa96e10258b5f188e github.com
- https://security-tracker.debian.org/tracker/CVE-2021-4189 security-tracker.debian.org
- https://bugzilla.redhat.com/show_bug.cgi?id=2036020 bugzilla.redhat.com
- https://access.redhat.com/security/cve/CVE-2021-4189 access.redhat.com
- https://security.netapp.com/advisory/ntap-20221104-0004/ security.netapp.com
- [debian-lts-announce] 20230524 [SECURITY] [DLA 3432-1] python2.7 security update lists.debian.org · mailing list
- [debian-lts-announce] 20230630 [SECURITY] [DLA 3477-1] python3.7 security update lists.debian.org · mailing list
- https://lists.debian.org/debian-lts-announce/2024/12/msg00000.html lists.debian.org
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html cert-portal.siemens.com
- https://cert-portal.siemens.com/productcert/html/ssa-457936.html cert-portal.siemens.com
Source: the record CVE-2021-4189 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse