Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 95205 invoked from network); 2 Jul 2009 13:42:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jul 2009 13:42:25 -0000 Received: (qmail 22324 invoked by uid 500); 2 Jul 2009 13:42:35 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 22265 invoked by uid 500); 2 Jul 2009 13:42:35 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 22255 invoked by uid 99); 2 Jul 2009 13:42:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2009 13:42:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2009 13:42:33 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 25DC923888E6; Thu, 2 Jul 2009 13:42:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r790589 - /httpd/test/framework/trunk/t/security/CVE-2009-1890.t Date: Thu, 02 Jul 2009 13:42:13 -0000 To: cvs@httpd.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090702134213.25DC923888E6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jorton Date: Thu Jul 2 13:42:12 2009 New Revision: 790589 URL: http://svn.apache.org/viewvc?rev=790589&view=rev Log: - add test case for CVE-2009-1890 Added: httpd/test/framework/trunk/t/security/CVE-2009-1890.t (with props) Added: httpd/test/framework/trunk/t/security/CVE-2009-1890.t URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/security/CVE-2009-1890.t?rev=790589&view=auto ============================================================================== --- httpd/test/framework/trunk/t/security/CVE-2009-1890.t (added) +++ httpd/test/framework/trunk/t/security/CVE-2009-1890.t Thu Jul 2 13:42:12 2009 @@ -0,0 +1,63 @@ +use strict; +use warnings FATAL => 'all'; + +use Apache::Test; +use Apache::TestRequest; +use Apache::TestUtil; + +plan tests => 7, need [qw(mod_proxy proxy_http.c)]; + +my $len = 100000; + +my $sock = Apache::TestRequest::vhost_socket('proxy_http_reverse'); +ok $sock && $sock->connected; + +my $req = + "POST /reverse/modules/cgi/perl_echo.pl HTTP/1.0\r\n". + "Content-Length: 0" . $len . "\r\n". + "\r\n"; + +ok $sock->print($req); + +my $half_body = 'x' x ($len/2); +ok $sock->print($half_body); +sleep(1); +ok $sock->print($half_body); + +my $readable = IO::Select->new($sock)->can_read(10); +ok $readable, 1, "timeout, server hung"; +if (!$readable) { + skip "server hung, not testing further", foreach(1..2); + exit(0); +} + +my $line = Apache::TestRequest::getline($sock) || ''; +ok t_cmp($line, qr{^HTTP/1\.. 200}, "request was parsed"); + +do { + $line = Apache::TestRequest::getline($sock) || ''; + $line = super_chomp($line); + print "# header: $line\n"; +} until ($line eq ""); + +my $buffer; +while ($len > 0 && $sock->read($buffer, $len)) { + print "# got: $buffer\n"; + $len -= length($buffer); + print "# remaining: $len\n"; +} + +ok t_cmp($len, 0, "read entire body"); + +sub super_chomp { + my ($body) = shift; + + ## super chomp - all leading and trailing \n (and \r for win32) + $body =~ s/^[\n\r]*//; + $body =~ s/[\n\r]*$//; + ## and all the rest change to spaces + $body =~ s/\n/ /g; + $body =~ s/\r//g; #rip out all remaining \r's + + $body; +} Propchange: httpd/test/framework/trunk/t/security/CVE-2009-1890.t ------------------------------------------------------------------------------ svn:eol-style = native