XP is just a number | |
PerlMonks |
Re: Possible Security Problemby ZZamboni (Curate) |
on May 01, 2001 at 04:53 UTC ( [id://76843]=note: print w/replies, xml ) | Need Help?? |
I don't see why you should get flamed for asking this. On the
contrary, everyone should get feedback on security issues before
writing CGI programs :-) My answer is: it depends on the setup, and what you do with the directory afterwards. Judging from your previous post, I assume that is going to be your "list of valid subdirectories". Are these directories predefined and created by you? If they are not (i.e. they can be created by users) then you should be careful with them, even if they pass your "validity" check. I think using -d is OK because it does not interpret any metacharacters AFAIK, but if you later use that name in something that does (like open or system), you will get in trouble if you don't sanitize the names before allowing them to pass. If the valid directories can only be created by you, as long as you are careful with their names, I think you should be OK. In any case, it's best if you do something to untaint the data before using it in any possibly vulnerable commands. --ZZamboni
In Section
Seekers of Perl Wisdom
|
|