Matej Cepl 2022-02-06 08:01:12 +00:00 committed by Git OBS Bridge
parent 68c3ceb48d
commit 430843dcc5

@ -19,11 +19,31 @@ Date: Mon Mar 15 11:39:31 2021 -0700
attribute on your `ftplib.FTP` instance to True.
---
Doc/whatsnew/2.7.rst | 10 +++
Lib/ftplib.py | 11 +++-
Lib/test/test_ftplib.py | 27 +++++++++-
Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst | 8 ++
3 files changed, 43 insertions(+), 3 deletions(-)
4 files changed, 53 insertions(+), 3 deletions(-)
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -166,6 +166,16 @@ The ``unittest`` module also automatical
when running tests.
+Post-EOS fixes
+==============
+
+A security fix alters the :class:`ftplib.FTP` behavior to not trust the
+IPv4 address sent from the remote server when setting up a passive data
+channel. We reuse the ftp server IP address instead. For unusual code
+requiring the old behavior, set a ``trust_server_pasv_ipv4_address``
+attribute on your FTP instance to ``True``. (See :issue:`43285`)
+
+
Python 3.1 Features
=======================
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -107,7 +107,9 @@ class FTP: