CVE-2021-4189 Server-side request forgery in python

Medium 5.3 Published Updated

A malicious FTP server can trick the Python FTP client into connecting to arbitrary internal hosts, enabling port scanning and potential data access.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-4189?

CVE-2021-4189 is a medium-severity server-side request forgery vulnerability in Debian Debian Linux, published on 24 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-252

Which versions are affected by CVE-2021-4189?

3 open source packages ship an affected version, including libpython, python and python-min. It affects 5 products.

PackageAffectedFixed in
libpython BitnamiFrom 3.6.03.6.14, 3.7.11, 3.8.9, 3.9.3, 3.10.1
python BitnamiFrom 3.6.03.6.14, 3.7.11, 3.8.9, 3.9.3, 3.10.1
python-min BitnamiFrom 3.6.03.6.14, 3.7.11, 3.8.9, 3.9.3, 3.10.1
Linux distribution packages (1)
python openSUSE:TumbleweedAll versions2.7.18-15.1

Products include Debian Debian Linux, Netapp Ontap Select Deploy Administration Utility, Python Python, Redhat Enterprise Linux, Redhat Software Collections.

How do I fix CVE-2021-4189?

Upgrade libpython to a fixed version for your release line: 3.6.14, 3.7.11, 3.8.9 or 3.9.3.

Upgrade, and send outbound requests through an allow-list that blocks internal addresses. More about Server-side request forgery.

Is CVE-2021-4189 being exploited?

There is no known exploitation of CVE-2021-4189 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as BIT-libpython-2021-4189, BIT-python-2021-4189, BIT-python-min-2021-4189, CLSA-2022-1649170553, CLSA-2022-1649348075, DEBIAN-CVE-2021-4189 and 3 more.

Is CVE-2021-4189 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free