You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand allowing multiple digits for backwards-compatibility with RFC 2616, but I don't think it makes sense to let the specifics of int leak out into the world. We should at least ensure that only digits are permitted in HTTP version numbers.
My environment
CPython 3.12.0a6+
Operating system and architecture: Arch Linux on x86_64
…sist only of digits (#103205)
Reject HTTP requests with invalid http/x.y version numbers: x or y being non-digits or too-long.
---------
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
…st consist only of digits (pythonGH-103205)
Reject HTTP requests with invalid http/x.y version numbers: x or y being non-digits or too-long.
---------
(cherry picked from commit cf720ac)
Co-authored-by: Ben Kallus <49924171+kenballus@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
…ust consist only of digits (GH-103205) (#104438)
gh-103204: `http.server` - Enforce that HTTP version numbers must consist only of digits (GH-103205)
Reject HTTP requests with invalid http/x.y version numbers: x or y being non-digits or too-long.
---------
(cherry picked from commit cf720ac)
Co-authored-by: Ben Kallus <49924171+kenballus@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
http.server
parses HTTP version numbers too permissively.http.server
accepts request lines with HTTP version numbers that have'_'
,'+'
, and'-'
.Reproduction steps:
(Requires netcat)
Justification
Here are the
HTTP-version
definitions from each of the three HTTP RFCs:I understand allowing multiple digits for backwards-compatibility with RFC 2616, but I don't think it makes sense to let the specifics of
int
leak out into the world. We should at least ensure that only digits are permitted in HTTP version numbers.My environment
Linked PRs
http.server
- Enforce that HTTP version numbers must consist only of digits #103205http.server
- Enforce that HTTP version numbers must consist only of digits (GH-103205) #104438The text was updated successfully, but these errors were encountered: