httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject Possible Bug/Hole in Apache 1.1.1? (fwd)
Date Fri, 20 Sep 1996 10:25:15 GMT

Not acked


----- Forwarded message from Alex Mottram -----

Message-Id: <199609200218.VAA11389@dns1.net-connect.net>
From: Alex Mottram <alex@dns1.net-connect.net>
To: apache-bugs@mail.apache.org
MMDF-Warning:  Parse error in original version of preceding line at US1.IMDb.Com
Subject: Possible Bug/Hole in Apache 1.1.1?
Date: Thu, 19 Sep 1996 21:19:02 -0500
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1155
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Please consider the following c++ code, compiled as a cgi program.  :
(this is not intended to be an actual cgi, just something to find the
problem with
the parsing of the cgi query string).  

-- cut here --
#include <iostream.h>
extern char **environ;
int main( int argc, char *argv[] )
{
        int Fig;

        cout << "Content-Type: text/html" << endl << endl;
        cout << "<HTML><HEAD><TITLE>Test CGI</TITLE></HEAD><BODY>"
<< endl;

        for ( Fig = 1 ; Fig < argc ; Fig++ )
        {
                cout << argv[ Fig ] << "<P>" << endl;
        }

        cout << "<BR><HR>" << endl;

        Fig = 0;

        while ( environ[ Fig ] != NULL )
        {
                cout << environ[ Fig++ ] << "<P>" << endl;   
  }

        cout << "</BODY></HTML>" << endl;
}            
-- cut here --

produces the following output when accessed as:

"http://www.net-connect.net/cgi-test/bcgi?5 HTTP/3.06 7 8 9 0"

-- begin output --

5

HTTP_CONNECTION=Keep-Alive
HTTP_USER_AGENT=Mozilla/3.0b7Gold (Win95; I)
HTTP_HOST=www.net-connect.net
HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
PATH=/bin:/usr/bin:
SERVER_SOFTWARE=Apache/1.1.1
SERVER_NAME=www.net-connect.net
SERVER_PORT=80
REMOTE_HOST=as61.net-connect.net
REMOTE_ADDR=204.181.38.161
DOCUMENT_ROOT=/usr/local/etc/httpd/htdocs
SERVER_ADMIN=webmaster@net-connect.net
SCRIPT_FILENAME=/home/alex/cgi-bin/bcgi
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/3.06 7 8 9 0 HTTP/1.0 **** NOTICE ****
			^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
REQUEST_METHOD=GET
QUERY_STRING=5
SCRIPT_NAME=/cgi-test/bcgi


Thanks for your time!

Alex Mottram

----- End of forwarded message from Alex Mottram -----

-- 
Rob Hartill (robh@imdb.com)    
http://www.imdb.com/  ... why wait for a clear night to see the stars?.

Mime
View raw message