Staging
v0.5.1
https://github.com/python/cpython
Revision 942cc04ae44825ea120e3a19a80c9b348b8194d0 authored by Ned Deily on 11 March 2018, 18:28:53 UTC, committed by larryhastings on 11 March 2018, 18:28:53 UTC
* 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>.
1 parent f584ecd
History
Tip revision: 942cc04ae44825ea120e3a19a80c9b348b8194d0 authored by Ned Deily on 11 March 2018, 18:28:53 UTC
[3.4] bpo-32981: Fix catastrophic backtracking vulns (GH-5955) (#6035)
Tip revision: 942cc04
File Mode Size
NEWS.d
ACKS -rw-r--r-- 22.7 KB
HISTORY -rw-r--r-- 1.1 MB
Porting -rw-r--r-- 1.9 KB
README -rw-r--r-- 1.4 KB
README.AIX -rw-r--r-- 5.0 KB
README.coverity -rw-r--r-- 845 bytes
README.valgrind -rw-r--r-- 4.3 KB
SpecialBuilds.txt -rw-r--r-- 10.9 KB
coverity_model.c -rw-r--r-- 2.9 KB
gdbinit -rw-r--r-- 4.7 KB
indent.pro -rw-r--r-- 557 bytes
python-config.in -rw-r--r-- 2.0 KB
python-config.sh.in -rw-r--r-- 2.9 KB
python-wing3.wpr -rw-r--r-- 555 bytes
python-wing4.wpr -rw-r--r-- 835 bytes
python-wing5.wpr -rw-r--r-- 835 bytes
python.man -rw-r--r-- 13.2 KB
python.pc.in -rw-r--r-- 293 bytes
svnmap.txt -rw-r--r-- 4.1 MB
valgrind-python.supp -rw-r--r-- 8.2 KB
vgrindefs -rw-r--r-- 500 bytes

README

back to top