Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Cgi pm and photo uploads

by mandog (Curate)
on Oct 04, 2003 at 23:29 UTC ( [id://296603]=note: print w/replies, xml ) Need Help??


in reply to Re: Cgi pm and photo uploads
in thread Cgi pm and photo uploads

Hello sulfericacid

Your script is pretty easy to follow. It does the job. However, there are a few things that could be tweaked

You might put my $localfile at the top of the script. It will be easier to find there when you move the script to another host. Generally it is best to put constants like this at the top of the script.

You might run in taint mode (put -T on the shbang line)

You allow some nasty chars in the user supplied filename. Evil can be done to you with more than semicolons. Better to use the regex's in perldoc perlsec to ban everything except what you explicitly allow.

Having your images directory world writable, is a bit risky. For one thing other users on your server will be able to clobber things.

If it is not set globally, you might also look at $CGI::POST_MAX

Hope this is helpful

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://296603]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-03-19 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found