diff options
author | Benjamin Peterson <benjamin@python.org> | 2018-03-03 22:59:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-03 22:59:12 -0800 |
commit | c9516754067d71fd7429a25ccfcb2141fc583523 (patch) | |
tree | 3b5eff3ee633156e61e6cd4a96e17f9cbd2f3840 /Lib/tkinter/test/test_tkinter/test_misc.py | |
parent | bd92cfe632228ea4d6a1c0dc9506baa18d353dc1 (diff) | |
download | cpython-git-c9516754067d71fd7429a25ccfcb2141fc583523.tar.gz |
[3.6] bpo-32981: Fix catastrophic backtracking vulns (GH-5955)
* Prevent low-grade poplib REDOS (CVE-2018-1060)
The regex to test a mail server's timestamp is susceptible to
catastrophic backtracking on long evil responses from the server.
Happily, the maximum length of malicious inputs is 2K thanks
to a limit introduced in the fix for CVE-2013-1752.
A 2KB evil response from the mail server would result in small slowdowns
(milliseconds vs. microseconds) accumulated over many apop calls.
This is a potential DOS vector via accumulated slowdowns.
Replace it with a similar non-vulnerable regex.
The new regex is RFC compliant.
The old regex was non-compliant in edge cases.
* Prevent difflib REDOS (CVE-2018-1061)
The default regex for IS_LINE_JUNK is susceptible to
catastrophic backtracking.
This is a potential DOS vector.
Replace it with an equivalent non-vulnerable regex.
Also introduce unit and REDOS tests for difflib.
Co-authored-by: Tim Peters <tim.peters@gmail.com>
Co-authored-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 0e6c8ee2358a2e23117501826c008842acb835ac)
Diffstat (limited to 'Lib/tkinter/test/test_tkinter/test_misc.py')
0 files changed, 0 insertions, 0 deletions