36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
From 761db274ca898f8a92348ed5979d3d3c1b0d634a Mon Sep 17 00:00:00 2001
|
|
From: Tomas Orsava <torsava@redhat.com>
|
|
Date: Fri, 17 Jun 2016 16:08:11 +0200
|
|
Subject: [PATCH] Raise an error when STARTTLS fails
|
|
|
|
CVE-2016-0772 python: smtplib StartTLS stripping attack
|
|
rhbz#1303647: https://bugzilla.redhat.com/show_bug.cgi?id=1303647
|
|
rhbz#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345
|
|
|
|
Based on an upstream change by Benjamin Peterson <benjamin@python.org>
|
|
- in changeset 101887:d590114c2394 3.4
|
|
- https://hg.python.org/cpython/rev/d590114c2394
|
|
---
|
|
Lib/smtplib.py | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
|
|
index 4756973..dfbf5f9 100755
|
|
--- a/Lib/smtplib.py
|
|
+++ b/Lib/smtplib.py
|
|
@@ -773,6 +773,11 @@ class SMTP:
|
|
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=[],
|
|
--
|
|
2.5.5
|
|
|