8000 [3.8] bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) by miss-islington · Pull Request #28036 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.8] bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) #28036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 29, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
Prev Previous commit
Don't use support.LOOPBACK_TIMEOUT because it's only been added in 3.9
  • Loading branch information
ambv committed Aug 29, 2021
commit d4ef855cbbb7aa46fa0bed8f80166d96e5239f9d
6 changes: 3 additions & 3 deletions Lib/test/test_smtplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def testEXPNNotImplemented(self):
def test_issue43124_putcmd_escapes_newline(self):
# see: https://bugs.python.org/issue43124
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost',
timeout=support.LOOPBACK_TIMEOUT)
timeout=10) # support.LOOPBACK_TIMEOUT in newer Pythons
self.addCleanup(smtp.close)
with self.assertRaises(ValueError) as exc:
smtp.putcmd('helo\nX-INJECTED')
Expand Down Expand Up @@ -384,7 +384,7 @@ def test_issue43124_escape_localhostname(self):
# connect and send mail
m = 'wazzuuup\nlinetwo'
smtp = smtplib.SMTP(HOST, self.port, local_hostname='hi\nX-INJECTED',
timeout=support.LOOPBACK_TIMEOUT)
timeout=10) # support.LOOPBACK_TIMEOUT in newer Pythons
self.addCleanup(smtp.close)
with self.assertRaises(ValueError) as exc:
smtp.sendmail("hi@me.com", "you@me.com", m)
Expand All @@ -405,7 +405,7 @@ def test_issue43124_escape_options(self):
m = 'wazzuuup\nlinetwo'
smtp = smtplib.SMTP(
HOST, self.port, local_hostname='localhost',
timeout=support.LOOPBACK_TIMEOUT)
timeout=10) # support.LOOPBACK_TIMEOUT in newer Pythons

self.addCleanup(smtp.close)
smtp.sendmail("hi@me.com", "you@me.com", m)
Expand Down
0