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.
In reply to Security question by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |