Ovid has asked for the wisdom of the Perl Monks concerning the following question:
I'm demonstrating why most alternatives to CGI.pm fail on file uploads and I use the following script to show the contents of <STDIN> following the browser POST:
Now generally, if the Content-type is test/html, this represents a security hole as some user could enter a dangerous SSI (e.g. <!--#exec cmd="/bin/rm -fr"-->). If the Web server is configured to allow SSI interpretation in CGI scripts, you've just had a bunch of files wiped out with that. However, if the Content-type is text/plain, do the servers ignore SSI? If it is in any way possible for such an SSI to be entered in such a script, I would like to include that in one of my "Security Checkpoints."#!c:/perl/bin/perl.exe -wT use strict; my $buffer; read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); print "Content-type: text/plain\n\n"; print $buffer;
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just go the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Security question
by merlyn (Sage) on Oct 09, 2000 at 07:51 UTC | |
|
Re (tilly) 1: Security question
by tilly (Archbishop) on Oct 09, 2000 at 14:43 UTC | |
|
Re: Security question
by AgentM (Curate) on Oct 09, 2000 at 07:45 UTC | |
|
(Ovid) Re: Security question
by Ovid (Cardinal) on Oct 09, 2000 at 19:32 UTC | |
by tilly (Archbishop) on Oct 09, 2000 at 19:51 UTC | |
by merlyn (Sage) on Oct 09, 2000 at 19:35 UTC |