commit fb290dfbd8cdb205bd1440cd31e0486637200a8b Author: Daniel Stenberg Date: Mon May 16 16:29:07 2022 +0200 [Backport] test387: verify rejection of compression chain attack Offering: RTOS CVE: CVE-2022-32206 Reference: upstream_commit_id=7230b19a2e17a164f61f82e4e409a9777ea2421a DTS/AR: DTS2022063005656 type: LTS reason: fix CVE-2022-32206 for curl. weblink:https://github.com/curl/curl/commit/7230b19a2e17a164f61f82e4e409a9777ea2421a Signed-off-by: jiahuasheng diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index cd52a026b..ffcde9f30 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -61,7 +61,7 @@ test334 test335 test336 test337 test338 test339 test340 test341 test342 \ test343 test344 test345 test346 test347 test348 test349 test350 test351 \ test352 test353 test354 test355 test356 test357 test358 test359 test360 \ test361 test362 test363 test364 \ -\ +test387 \ test393 test394 test395 test396 test397 \ \ test400 test401 test402 test403 test404 test405 test406 test407 test408 \ diff --git a/tests/data/test387 b/tests/data/test387 new file mode 100644 index 000000000..015ec25f1 --- /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 + + +