PLEASE COME BACK HERE
don't, please, run CGIs without -T. As holli said below, someone will pass you "/etc/passwd" as a parameter and you will be hosed.
you can unlink the file IIRC if you check it against a regex, like this:
unlink $1 if $fileName =~ /^(\.\.\/\.\.\/20\d{6}\.txt)$/;
_without_ having to run it insecurely. as a plus, it will only remove the remove-able files.
| [reply] [d/l] |
Thank you for the advice, massa. I'm using the strict pattern matching that you suggested, modified for my specific application. There are other measures that would have to be defeated before someone could access this page, but I'll keep the taint checking too!
It was very kind and generous of holli to offer to hack my site, but not necessary, thanks.
| [reply] |