8000 [3.3] bpo-30585: [security] raise an error when STARTTLS fails (#225) · stackless-dev/stackless@3625f7f · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 3625f7f

Browse files
vstinnerned-deily
authored andcommitted
[3.3] bpo-30585: [security] raise an error when STARTTLS fails (#225)
(cherry picked from commit 46b32f3)
1 parent 4956dd2 commit 3625f7f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Lib/smtplib.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,11 @@ def starttls(self, keyfile=None, certfile=None, context=None):
680680
self.ehlo_resp = None
681681
self.esmtp_features = {}
682682
self.does_esmtp = 0
683+
else:
684+
# RFC 3207:
685+
# 501 Syntax error (no parameters allowed)
686+
# 454 TLS not available due to temporary reason
687+
raise SMTPResponseException(resp, reply)
683688
return (resp, reply)
684689

685690
def sendmail(self, from_addr, to_addrs, msg, mail_options=[],

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Core and Builtins
3535
Library
3636
-------
3737

38+
- [Security] bpo-30585: Fix TLS stripping vulnerability in smptlib,
39+
CVE-2016-0772. Reported by Team Oststrom
40+
3841
- [Security] bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes
3942
of multiple security vulnerabilities including: CVE-2017-9233 (External
4043
entity infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix),

0 commit comments

Comments
 (0)
0