forked from varnishcache/varnish-cache
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly handle bogusly large chunk sizes
This fixes a denial of service attack vector where bogusly large chunk sizes in requests could be used to force restarts of the Varnish server. This is Varnish Security Vulnerability VSV00001 For more information visit: https://varnish-cache.org/security/VSV00001 Fixes: varnishcache#2379
- Loading branch information
1 parent
999b39b
commit 9e03eb9
Showing
2 changed files
with
41 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
varnishtest "Check that we handle bogusly large chunks correctly" | ||
|
||
# Check that the bug has been fixed | ||
|
||
server s1 { | ||
rxreq | ||
txresp | ||
} -start | ||
|
||
varnish v1 -vcl+backend { | ||
} -start | ||
|
||
client c1 { | ||
send "POST / HTTP/1.1\r\n" | ||
send "Transfer-Encoding: chunked\r\n\r\n" | ||
send "FFFFFFFFFFFFFFED\r\n" | ||
send "0\r\n\r\n" | ||
|
||
rxresp | ||
expect resp.status == 503 | ||
} -run | ||
|
||
# Check that the published workaround does not cause harm | ||
|
||
varnish v1 -vcl+backend { | ||
sub vcl_recv { | ||
if (req.http.transfer-encoding ~ "(?i)chunked") { | ||
return (fail); | ||
} | ||
} | ||
} | ||
|
||
client c1 { | ||
send "POST / HTTP/1.1\r\n" | ||
send "Transfer-Encoding: chunked\r\n\r\n" | ||
send "FFFFFFFFFFFFFFED\r\n" | ||
|
||
rxresp | ||
expect resp.status == 503 | ||
} -run |