[Python-checkins] cpython (2.7): raise an error when STARTTLS fails

benjamin.peterson python-checkins at python.org
Sat Jun 11 16:21:06 EDT 2016


https://hg.python.org/cpython/rev/b3ce713fb9be
changeset:   101886:b3ce713fb9be
branch:      2.7
parent:      101866:3017e41b0c99
user:        Benjamin Peterson <benjamin at python.org>
date:        Sat Jun 11 13:16:42 2016 -0700
summary:
  raise an error when STARTTLS fails

files:
  Lib/smtplib.py |  5 +++++
  Misc/NEWS      |  3 +++
  2 files changed, 8 insertions(+), 0 deletions(-)


diff --git a/Lib/smtplib.py b/Lib/smtplib.py
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -656,6 +656,11 @@
             self.ehlo_resp = None
             self.esmtp_features = {}
             self.does_esmtp = 0
+        else:
+            # RFC 3207:
+            # 501 Syntax error (no parameters allowed)
+            # 454 TLS not available due to temporary reason
+            raise SMTPResponseException(resp, reply)
         return (resp, reply)
 
     def sendmail(self, from_addr, to_addrs, msg, mail_options=[],
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -92,6 +92,9 @@
 Library
 -------
 
+- Fix TLS stripping vulnerability in smptlib, CVE-2016-0772.  Reported by Team
+  Oststrom
+
 - Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the
   locale.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list