From d161f53de04bc826ce1bdaeb3dce2c72ca50a3f8 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Mon, 23 Jul 2018 22:25:23 -0400 Subject: [core] security: use-after-free invalid Range req (thx Marcus Wengelin) --- tests/request.t | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tests/request.t') diff --git a/tests/request.t b/tests/request.t index a9fe3f6a..c1e8f472 100755 --- a/tests/request.t +++ b/tests/request.t @@ -8,7 +8,7 @@ BEGIN { use strict; use IO::Socket; -use Test::More tests => 50; +use Test::More tests => 52; use LightyTest; my $tf = LightyTest->new(); @@ -391,6 +391,26 @@ EOF $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; ok($tf->handle_http($t) == 0, 'GET, Range with range-requests-disabled'); +$t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "12345\n" } ]; +ok($tf->handle_http($t) == 0, 'GET, Range invalid range-unit (first)'); + +$t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 206 } ]; +ok($tf->handle_http($t) == 0, 'GET, Range ignore invalid range (second)'); + $t->{REQUEST} = ( <