-
Notifications
You must be signed in to change notification settings - Fork 179
Parsing issue of the CONNECT method #463
Copy link
Copy link
Open
Description
Version
fc592e8
Platform
Ubuntu 11.4.0-1ubuntu1~22.04
Description
Hello, I may have found a bug in waitress's parsing of CONNECT requests.
RFC 9112 says this:
A server MUST reject a
CONNECTrequest that targets an empty or invalid port number, typically by responding with a400 (Bad Request)status code.
However, waitress does not reject such CONNECT request, and does not establish a proxy connection. It handles CONNECT requests just like GET or POST, and responses with 200 OK.
For example:
CONNECT victim.com HTTP/1.1\r\n
Host: victim.com\r\n
\r\n
$ echo -ne "CONNECT victim.com HTTP/1.1\r\nHost: victim.com\r\n\r\n" | nc 172.18.0.6 80
HTTP/1.1 200 OK
Content-Length: 129
Content-Type: application/json
Date: Thu, 20 Mar 2025 09:07:15 GMT
Server: waitress
{"headers":[["SE9TVA==","dmljdGltLmNvbQ=="]],"body":"","version":"SFRUUC8xLjE=","uri":"dmljdGltLmNvbQ==","method":"Q09OTkVDVA=="}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels