-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3253 from pajod/patch-rfc9110-section5.5
Refuse requests with invalid and dangerous CR/LF/NUL in header field value, as demanded by rfc9110 section 5.5
- Loading branch information
Showing
7 changed files
with
189 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
GET / HTTP/1.1\r\n | ||
Host: x\r\n | ||
Newline: a\n | ||
Content-Length: 26\r\n | ||
GET / HTTP/1.1\n | ||
Host: x\r\n | ||
\r\n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from gunicorn.config import Config | ||
from gunicorn.http.errors import InvalidHeader | ||
|
||
cfg = Config() | ||
request = InvalidHeader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
GET / HTTP/1.1\r\n | ||
Host: x\r\n | ||
Newline: a\n | ||
Content-Length: 26\r\n | ||
X-Forwarded-By: broken-proxy\r\n\r\n | ||
GET / HTTP/1.1\n | ||
Host: x\r\n | ||
\r\n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from gunicorn.config import Config | ||
|
||
cfg = Config() | ||
cfg.set("tolerate_dangerous_framing", True) | ||
|
||
req1 = { | ||
"method": "GET", | ||
"uri": uri("/"), | ||
"version": (1, 1), | ||
"headers": [ | ||
("HOST", "x"), | ||
("NEWLINE", "a\nContent-Length: 26"), | ||
("X-FORWARDED-BY", "broken-proxy"), | ||
], | ||
"body": b"" | ||
} | ||
|
||
request = [req1] |