Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
cdabc372
Kaydet (Commit)
cdabc372
authored
Eyl 17, 2014
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22419: Limit the length of incoming HTTP request in wsgiref server to 65536 bytes.
üst
c9cdd0cc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletion
+18
-1
test_wsgiref.py
Lib/test/test_wsgiref.py
+5
-0
simple_server.py
Lib/wsgiref/simple_server.py
+8
-1
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/test/test_wsgiref.py
Dosyayı görüntüle @
cdabc372
...
@@ -113,6 +113,11 @@ class IntegrationTests(TestCase):
...
@@ -113,6 +113,11 @@ class IntegrationTests(TestCase):
out
,
err
=
run_amock
()
out
,
err
=
run_amock
()
self
.
check_hello
(
out
)
self
.
check_hello
(
out
)
def
test_request_length
(
self
):
out
,
err
=
run_amock
(
data
=
"GET "
+
(
"x"
*
65537
)
+
" HTTP/1.0
\n\n
"
)
self
.
assertEqual
(
out
.
splitlines
()[
0
],
"HTTP/1.0 414 Request-URI Too Long"
)
def
test_validated_hello
(
self
):
def
test_validated_hello
(
self
):
out
,
err
=
run_amock
(
validator
(
hello_app
))
out
,
err
=
run_amock
(
validator
(
hello_app
))
# the middleware doesn't support len(), so content-length isn't there
# the middleware doesn't support len(), so content-length isn't there
...
...
Lib/wsgiref/simple_server.py
Dosyayı görüntüle @
cdabc372
...
@@ -113,7 +113,14 @@ class WSGIRequestHandler(BaseHTTPRequestHandler):
...
@@ -113,7 +113,14 @@ class WSGIRequestHandler(BaseHTTPRequestHandler):
def
handle
(
self
):
def
handle
(
self
):
"""Handle a single HTTP request"""
"""Handle a single HTTP request"""
self
.
raw_requestline
=
self
.
rfile
.
readline
()
self
.
raw_requestline
=
self
.
rfile
.
readline
(
65537
)
if
len
(
self
.
raw_requestline
)
>
65536
:
self
.
requestline
=
''
self
.
request_version
=
''
self
.
command
=
''
self
.
send_error
(
414
)
return
if
not
self
.
parse_request
():
# An error code has been sent, just exit
if
not
self
.
parse_request
():
# An error code has been sent, just exit
return
return
...
...
Misc/ACKS
Dosyayı görüntüle @
cdabc372
...
@@ -268,6 +268,7 @@ Denver Coneybeare
...
@@ -268,6 +268,7 @@ Denver Coneybeare
Phil Connell
Phil Connell
Juan José Conti
Juan José Conti
Matt Conway
Matt Conway
Devin Cook
David M. Cooke
David M. Cooke
Jason R. Coombs
Jason R. Coombs
Garrett Cooper
Garrett Cooper
...
...
Misc/NEWS
Dosyayı görüntüle @
cdabc372
...
@@ -21,6 +21,10 @@ Core and Builtins
...
@@ -21,6 +21,10 @@ Core and Builtins
Library
Library
-------
-------
- Issue #22419: Limit the length of incoming HTTP request in wsgiref server to
65536 bytes and send a 414 error code for higher lengths. Patch contributed
by Devin Cook.
- Lax cookie parsing in http.cookies could be a security issue when combined
- Lax cookie parsing in http.cookies could be a security issue when combined
with non-standard cookie handling in some Web browsers. Reported by
with non-standard cookie handling in some Web browsers. Reported by
Sergey Bobrov.
Sergey Bobrov.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment