in reply to Special Chars in CGI form variables
As a general note you should avoid doing things like this, even if you're dealing with an hidden field - these are no more secure than visible ones. Use tainted mode, and place strict restrictions upon filenames you allow, like:
Another advice: use the three-argument open instead of appending filename to the ">" char.$field =~ s/[^\w.-]//g; # keep alpha, num, and "_.-" if ($field =~ /([\w.-]+)/) { $field = $1; } else { $field = undef; } # now $field is untainted
All that said, take a deep look at perldoc perlsec!
Flavio (perl -e "print(scalar(reverse('ti.xittelop@oivalf')))")
Don't fool yourself.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Special Chars in CGI form variables
by rsiedl (Friar) on Apr 20, 2005 at 13:31 UTC | |
by cazz (Pilgrim) on Apr 20, 2005 at 13:49 UTC | |
by polettix (Vicar) on Apr 20, 2005 at 13:41 UTC |