| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
(GH-19251)
(cherry picked from commit cd16661f903153ecac55f190ed682e576c5deb24)
|
|
|
|
|
|
|
|
|
| |
http.client. (GH-19052)
Add host validation for control characters for more
CVE-2019-18348 protection.
(cherry picked from commit 83fc70159b24)
Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit f4800b8ed3dbe15a0078869a836d968ab3362b8c)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
|
|
|
|
|
|
| |
(#17774)
desired behavior under windows platform.
Suggestion by David Bolen
|
|
|
|
|
| |
(cherry picked from commit 32f1443aa98db769d87db497b45bd0dcb732445b)
Co-authored-by: Ned Deily <nad@python.org>
|
|
|
|
|
| |
(cherry picked from commit 946b29ea0b3b386ed05e87e60b8617c9dc19cd53)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
|
|
|
| |
transfer (#1040)
* bpo-27973: Fix urllib.urlretrieve failing on subsequent ftp transfers from the same host.
* bpo-35411: Skip test_urllibnet FTP tests on Travis CI.
|
|
|
|
|
|
| |
(cherry picked from commit 5c7ed7550ec2da16d7679e538fcd7c1a5631811f)
Co-authored-by: William Ayd <william.ayd@icloud.com>
|
|
|
|
|
|
|
| |
Catalina (GH-17636)
(cherry picked from commit bf3aa1060a29a05813abbe877193af16e3e7131e)
Co-authored-by: Ned Deily <nad@python.org>
|
|
|
| |
In all these cases, we know the exact length we want copied, so memcpy is the right function to use.
|
| |
|
|
|
|
|
|
|
| |
output format (GH-17418). (#17452)
(cherry picked from commit a62ad4730c9b575f140f24074656c0257c86a09a)
Co-authored-by: Matthew Rollings <1211162+stealthcopter@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit fdafa1d0ed0a8930b52ee81e57c931cc4d5c2388)
Co-authored-by: idomic <michael.ido@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
| |
(GH-17081)
|
| |
|
|
|
|
| |
(GH-17077)
|
|
|
|
|
|
|
| |
_POSIX_C_SOURCE (GH-16733)
(cherry picked from commit 8177404d520e81f16324a900f093adf3856d33f8)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit d898d20e8c228229eb68e545f544db13f246f216)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
decorators. (GH-16861). (GH-16931)
(cherry picked from commit 26ae9f6d3d755734c9f371b9356325afe5764813)
|
|
|
|
|
| |
(cherry picked from commit 01659ca62c4508518478a74615ac91c0009427ad)
Co-authored-by: Ned Deily <nad@python.org>
|
|
|
| |
AddRefActCtx() does not return a value.
|
|
|
|
|
| |
(cherry picked from commit dfe726b1ace03f206f45253b93ed7610473ae20f)
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
|
|
|
|
|
|
| |
(GH-16869). (GH-16877)
(cherry picked from commit 5bc6a7c06eda20ba131ecba6752be0506d310181)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
(cherry picked from commit 3f36043db22361500f52634f2b8de49dde0e7da9)
Co-authored-by: Ned Deily <nad@python.org>
|
| |
|
|
|
|
|
|
|
| |
interpreter (GH-5960) (GH-16565)
(cherry picked from commit 7a7f100eb352d08938ee0f5ba59c18f56dc4a7b5)
Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
|
|
|
|
|
|
|
| |
(GH-6043) (GH-16566)
(cherry picked from commit f7a6ff6fcab32a53f262ba3f8a072c27afc330d7)
Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit 4504b4500d2a1a80c26b27b0bfff8b624d5ce06c)
Co-authored-by: Julien Palard <julien@palard.fr>
|
| |
|
|
|
|
|
|
| |
Rather than requiring the path to blurb and/or sphinx-build to be specified to the make rule, enhance the Doc/Makefile to look for each first in a virtual environment created by make venv and, if not found, look on the normal process PATH. This allows the Doc/Makefile to take advantage of an installed spinx-build or blurb and, thus, do the right thing most of the time. Also, make the directory for the venv be configurable and document the `make venv` target..
(cherry picked from commit 590665c399fc4aa3c4a9f8e7104d43a02e9f3a0c)
Co-authored-by: Ned Deily <nad@python.org>
|
|
|
|
|
|
|
| |
Previous to commit ee171a2 the logline was working because of self.info() (now
deprecated) defaults to an empty message.
(cherry picked from commit c3f52a59ce8406d9e59253ad4621e4749abdaeef)
Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
|
|
|
|
|
|
| |
Also addresses doc build failures documented in bpo-32200.
(cherry picked from commit 7324b5ce8e7c031a0a3832a6a8d7c639111ae0ff)
Co-authored-by: Julien Palard <julien@palard.fr>
|
|
|
|
|
| |
(cherry picked from commit ee171a26c1169abfae534b08acc0d95c6e45a22a)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
validation and encoding behavior (GH-16476)
Backporting this change, I observe a couple of things:
1. The _encode_request call is no longer meaningful because the request construction will implicitly encode the request using the default encoding when the format string is used (request = '%s %s %s'...). In order to keep the code as consistent as possible, I decided to include the call as a pass-through. I'd be just as happy to remove it entirely, but I'll leave that up to the reviewer to decide. It's okay that this functionality is disabled on Python 2 because this functionality was mainly around bpo-36274, which was mainly a concern with the transition to Python 3.
2. Because _encode_request is no longer meaningful, neither is the test for it, so I've removed that test. Therefore, the meaningful part of this test is that for bpo-38216, adding a (underscore-protected) hook to customize/disable validation.
(cherry picked from commit 7774d7831e8809795c64ce27f7df52674581d298)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
|
|
|
|
| |
(cherry picked from commit 10c452b894d95fed06056fe11e8fe8e1a2a60040)
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
|