Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From: Markus Koschany <apo@debian.org>
Date: Sat, 20 Mar 2021 13:49:17 +0200
Subject: CVE-2019-20445_3
Origin: https://github.com/netty/netty/commit/5f68897880467c00f29495b0aa46ed19bf7a873c
---
.../handler/codec/http/HttpRequestDecoderTest.java | 25 +++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java b/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java
index 5aa6fec..9a8912f 100644
--- a/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java
+++ b/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java
@@ -325,7 +325,30 @@ public class HttpRequestDecoderTest {
public void testWhitespace() {
String requestStr = "GET /some/path HTTP/1.1\r\n" +
"Transfer-Encoding : chunked\r\n" +
- "Host: netty.io\n\r\n";
+ "Host: netty.io\r\n\r\n";
+ testInvalidHeaders0(requestStr);
+ }
+
+ @Test
+ public void testWhitespaceBeforeTransferEncoding01() {
+ String requestStr = "GET /some/path HTTP/1.1\r\n" +
+ " Transfer-Encoding : chunked\r\n" +
+ "Content-Length: 1\r\n" +
+ "Host: netty.io\r\n\r\n" +
+ "a";
+ testInvalidHeaders0(requestStr);
+ }
+
+ @Test
+ public void testWhitespaceBeforeTransferEncoding02() {
+ String requestStr = "POST / HTTP/1.1" +
+ " Transfer-Encoding : chunked\r\n" +
+ "Host: target.com" +
+ "Content-Length: 65\r\n\r\n" +
+ "0\r\n\r\n" +
+ "GET /maliciousRequest HTTP/1.1\r\n" +
+ "Host: evilServer.com\r\n" +
+ "Foo: x";
testInvalidHeaders0(requestStr);
}