From: Daniel Stenberg Date: Mon, 16 May 2022 14:29:07 +0000 (+0200) Subject: test387: verify rejection of compression chain attack X-Git-Tag: curl-7_84_0~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7230b19a2e17a164f61f82e4e409a9777ea2421a;p=thirdparty%2Fcurl.git test387: verify rejection of compression chain attack --- diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 8b7cc46a32..370727eeca 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -64,7 +64,7 @@ test343 test344 test345 test346 test347 test348 test349 test350 test351 \ test352 test353 test354 test355 test356 test357 test358 test359 test360 \ test361 test362 test363 test364 test365 test366 test367 test368 test369 \ test370 test371 test372 test373 test374 test375 test376 test378 test379 \ -test380 test381 test383 test384 test385 test386 \ +test380 test381 test383 test384 test385 test386 test387 \ \ test390 test391 test392 test393 test394 test395 test396 test397 test398 \ \ diff --git a/tests/data/test387 b/tests/data/test387 new file mode 100644 index 0000000000..015ec25f1d --- /dev/null +++ b/tests/data/test387 @@ -0,0 +1,53 @@ + + + +HTTP +gzip + + + +# +# Server-side + + +HTTP/1.1 200 OK +Transfer-Encoding: gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip,gzip + +-foo- + + + +# +# Client-side + + +http + + +Response with overly long compression chain + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -sS + + + +# +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + +# CURLE_BAD_CONTENT_ENCODING is 61 + +61 + + +curl: (61) Reject response due to 5 content encodings + + +