InfiniteSilence has asked for the wisdom of the Perl Monks concerning the following question:
Here is the command line:#!/usr/local/bin/perl -Tw use CGI ':standard'; $file = param('file'); $comment = param('comment'); unless ($file) { $file = 'xcanalys.txt'; } unless ($comment) { $comment = 'No comment'; } open (OUTPUT, ">>./" . $file) or die "$!"; print OUTPUT $comment . "\n"; close OUTPUT; print header, start_html; print "<P>Thanks!</P>\n"; print end_html; 1;
Without untainting the information coming out from param(), this short script appends to the file! Isn't this supposed to fail?perl -T tainttest.pl (offline mode: enter name=value pairs on standard input) ^Z
Celebrate Intellectual Diversity
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32 taint...shouldn't this fail?
by nardo (Friar) on Sep 19, 2001 at 21:48 UTC | |
|
Re: Win32 taint...shouldn't this fail?
by hopes (Friar) on Sep 20, 2001 at 04:08 UTC | |
|
Re: Win32 taint...shouldn't this fail?
by InfiniteSilence (Curate) on Sep 20, 2001 at 18:02 UTC | |
by hopes (Friar) on Sep 21, 2001 at 21:29 UTC |