<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git, branch travis-3.6</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>bpo-39035: travis: Update image to xenial</title>
<updated>2019-12-16T07:12:37+00:00</updated>
<author>
<name>Inada Naoki</name>
<email>songofacandy@gmail.com</email>
</author>
<published>2019-12-16T07:12:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=c72635a86b88ab83b8e301bc20388f5750d442be'/>
<id>c72635a86b88ab83b8e301bc20388f5750d442be</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix warnings in test_asyncio.test_base_events (GH-17577) (#17581)</title>
<updated>2019-12-12T14:08:48+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-12-12T14:08:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=b35ec007b60bcf91f76ae3efc3e8cc1e032bfc66'/>
<id>b35ec007b60bcf91f76ae3efc3e8cc1e032bfc66</id>
<content type='text'>
Co-authored-by: tirkarthi
(cherry picked from commit 1988344a6bff253f017e053f69318ecf03587294)

Co-authored-by: Kyle Stanley &lt;aeros167@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: tirkarthi
(cherry picked from commit 1988344a6bff253f017e053f69318ecf03587294)

Co-authored-by: Kyle Stanley &lt;aeros167@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Post release updates</title>
<updated>2019-12-11T09:37:54+00:00</updated>
<author>
<name>Ned Deily</name>
<email>nad@python.org</email>
</author>
<published>2019-12-11T09:37:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=bf62515a5ba9214c999c2feb54a958c3ec4d134f'/>
<id>bf62515a5ba9214c999c2feb54a958c3ec4d134f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>3.6.10rc1</title>
<updated>2019-12-11T08:28:36+00:00</updated>
<author>
<name>Ned Deily</name>
<email>nad@python.org</email>
</author>
<published>2019-12-11T08:27:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=7ea0551592d80584b318099d5ebde4e7c552679f'/>
<id>7ea0551592d80584b318099d5ebde4e7c552679f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[3.6] bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (GH-17311). (GH-17571)</title>
<updated>2019-12-11T06:54:02+00:00</updated>
<author>
<name>Kyle Stanley</name>
<email>aeros167@gmail.com</email>
</author>
<published>2019-12-11T06:54:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=b23c0840ce07e03f2705fb08d94f8f03e5c5d5b8'/>
<id>b23c0840ce07e03f2705fb08d94f8f03e5c5d5b8</id>
<content type='text'>
(cherry picked from commit ab513a38c98695f271e448fe2cb7c5e39eeaaaaf)

Co-authored-by: Kyle Stanley &lt;aeros167@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit ab513a38c98695f271e448fe2cb7c5e39eeaaaaf)

Co-authored-by: Kyle Stanley &lt;aeros167@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format (GH-17418) (GH-17444)</title>
<updated>2019-12-02T23:34:31+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-12-02T23:34:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=30afc91f5e70cf4748ffac77a419ba69ebca6f6a'/>
<id>30afc91f5e70cf4748ffac77a419ba69ebca6f6a</id>
<content type='text'>
(cherry picked from commit a62ad4730c9b575f140f24074656c0257c86a09a)

Co-authored-by: Matthew Rollings &lt;1211162+stealthcopter@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit a62ad4730c9b575f140f24074656c0257c86a09a)

Co-authored-by: Matthew Rollings &lt;1211162+stealthcopter@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-38804: Fix REDoS in http.cookiejar (GH-17157) (#17343)</title>
<updated>2019-11-22T22:09:10+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-11-22T22:09:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=0716056c49e9505041e30386dad9b2e788f67aaf'/>
<id>0716056c49e9505041e30386dad9b2e788f67aaf</id>
<content type='text'>
The regex http.cookiejar.LOOSE_HTTP_DATE_RE was vulnerable to regular
expression denial of service (REDoS).

LOOSE_HTTP_DATE_RE.match is called when using http.cookiejar.CookieJar
to parse Set-Cookie headers returned by a server.
Processing a response from a malicious HTTP server can lead to extreme
CPU usage and execution will be blocked for a long time.

The regex contained multiple overlapping \s* capture groups.
Ignoring the ?-optional capture groups the regex could be simplified to

    \d+-\w+-\d+(\s*\s*\s*)$

Therefore, a long sequence of spaces can trigger bad performance.

Matching a malicious string such as

    LOOSE_HTTP_DATE_RE.match("1-c-1" + (" " * 2000) + "!")

caused catastrophic backtracking.

The fix removes ambiguity about which \s* should match a particular
space.

You can create a malicious server which responds with Set-Cookie headers
to attack all python programs which access it e.g.

    from http.server import BaseHTTPRequestHandler, HTTPServer

    def make_set_cookie_value(n_spaces):
        spaces = " " * n_spaces
        expiry = f"1-c-1{spaces}!"
        return f"b;Expires={expiry}"

    class Handler(BaseHTTPRequestHandler):
        def do_GET(self):
            self.log_request(204)
            self.send_response_only(204)  GH- Don't bother sending Server and Date
            n_spaces = (
                int(self.path[1:])  GH- Can GET e.g. /100 to test shorter sequences
                if len(self.path) &gt; 1 else
                65506  GH- Max header line length 65536
            )
            value = make_set_cookie_value(n_spaces)
            for i in range(99):  GH- Not necessary, but we can have up to 100 header lines
                self.send_header("Set-Cookie", value)
            self.end_headers()

    if __name__ == "__main__":
        HTTPServer(("", 44020), Handler).serve_forever()

This server returns 99 Set-Cookie headers. Each has 65506 spaces.
Extracting the cookies will pretty much never complete.

Vulnerable client using the example at the bottom of
https://docs.python.org/3/library/http.cookiejar.html :

    import http.cookiejar, urllib.request
    cj = http.cookiejar.CookieJar()
    opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
    r = opener.open("http://localhost:44020/")

The popular requests library was also vulnerable without any additional
options (as it uses http.cookiejar by default):

    import requests
    requests.get("http://localhost:44020/")

* Regression test for http.cookiejar REDoS

If we regress, this test will take a very long time.

* Improve performance of http.cookiejar.ISO_DATE_RE

A string like

"444444" + (" " * 2000) + "A"

could cause poor performance due to the 2 overlapping \s* groups,
although this is not as serious as the REDoS in LOOSE_HTTP_DATE_RE was.
(cherry picked from commit 1b779bfb8593739b11cbb988ef82a883ec9d077e)

Co-authored-by: bcaller &lt;bcaller@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The regex http.cookiejar.LOOSE_HTTP_DATE_RE was vulnerable to regular
expression denial of service (REDoS).

LOOSE_HTTP_DATE_RE.match is called when using http.cookiejar.CookieJar
to parse Set-Cookie headers returned by a server.
Processing a response from a malicious HTTP server can lead to extreme
CPU usage and execution will be blocked for a long time.

The regex contained multiple overlapping \s* capture groups.
Ignoring the ?-optional capture groups the regex could be simplified to

    \d+-\w+-\d+(\s*\s*\s*)$

Therefore, a long sequence of spaces can trigger bad performance.

Matching a malicious string such as

    LOOSE_HTTP_DATE_RE.match("1-c-1" + (" " * 2000) + "!")

caused catastrophic backtracking.

The fix removes ambiguity about which \s* should match a particular
space.

You can create a malicious server which responds with Set-Cookie headers
to attack all python programs which access it e.g.

    from http.server import BaseHTTPRequestHandler, HTTPServer

    def make_set_cookie_value(n_spaces):
        spaces = " " * n_spaces
        expiry = f"1-c-1{spaces}!"
        return f"b;Expires={expiry}"

    class Handler(BaseHTTPRequestHandler):
        def do_GET(self):
            self.log_request(204)
            self.send_response_only(204)  GH- Don't bother sending Server and Date
            n_spaces = (
                int(self.path[1:])  GH- Can GET e.g. /100 to test shorter sequences
                if len(self.path) &gt; 1 else
                65506  GH- Max header line length 65536
            )
            value = make_set_cookie_value(n_spaces)
            for i in range(99):  GH- Not necessary, but we can have up to 100 header lines
                self.send_header("Set-Cookie", value)
            self.end_headers()

    if __name__ == "__main__":
        HTTPServer(("", 44020), Handler).serve_forever()

This server returns 99 Set-Cookie headers. Each has 65506 spaces.
Extracting the cookies will pretty much never complete.

Vulnerable client using the example at the bottom of
https://docs.python.org/3/library/http.cookiejar.html :

    import http.cookiejar, urllib.request
    cj = http.cookiejar.CookieJar()
    opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
    r = opener.open("http://localhost:44020/")

The popular requests library was also vulnerable without any additional
options (as it uses http.cookiejar by default):

    import requests
    requests.get("http://localhost:44020/")

* Regression test for http.cookiejar REDoS

If we regress, this test will take a very long time.

* Improve performance of http.cookiejar.ISO_DATE_RE

A string like

"444444" + (" " * 2000) + "A"

could cause poor performance due to the 2 overlapping \s* groups,
although this is not as serious as the REDoS in LOOSE_HTTP_DATE_RE was.
(cherry picked from commit 1b779bfb8593739b11cbb988ef82a883ec9d077e)

Co-authored-by: bcaller &lt;bcaller@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Update URL in macOS installer copy of license (GH-16905) (GH-16908)</title>
<updated>2019-10-23T20:29:55+00:00</updated>
<author>
<name>Miss Skeleton (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-10-23T20:29:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=86c17c06c9420040c79c29ecf924741f37975342'/>
<id>86c17c06c9420040c79c29ecf924741f37975342</id>
<content type='text'>
(cherry picked from commit 01659ca62c4508518478a74615ac91c0009427ad)

Co-authored-by: Ned Deily &lt;nad@python.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit 01659ca62c4508518478a74615ac91c0009427ad)

Co-authored-by: Ned Deily &lt;nad@python.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[3.6] Fix Zope URL (GH-16880) (GH-16904)</title>
<updated>2019-10-23T19:33:56+00:00</updated>
<author>
<name>Miss Skeleton (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-10-23T19:33:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=293fc1730b378159194e260d946ffa53501fc95f'/>
<id>293fc1730b378159194e260d946ffa53501fc95f</id>
<content type='text'>
(cherry picked from commit dfe726b1ace03f206f45253b93ed7610473ae20f)

Co-authored-by: Kyle Stanley &lt;aeros167@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit dfe726b1ace03f206f45253b93ed7610473ae20f)

Co-authored-by: Kyle Stanley &lt;aeros167@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Update doc switcher list for 3.8.0 (GH-16809) (GH-16812)</title>
<updated>2019-10-15T21:46:19+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-10-15T21:46:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=1039f215746fd2ba21741e8a11f1f8badcea2a66'/>
<id>1039f215746fd2ba21741e8a11f1f8badcea2a66</id>
<content type='text'>
(cherry picked from commit 3f36043db22361500f52634f2b8de49dde0e7da9)

Co-authored-by: Ned Deily &lt;nad@python.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit 3f36043db22361500f52634f2b8de49dde0e7da9)

Co-authored-by: Ned Deily &lt;nad@python.org&gt;</pre>
</div>
</content>
</entry>
</feed>
