Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

How do I make sure users can't enter values into a form that cause my CGI script to do bad things?

by vroom (Pope)
on Oct 08, 1999 at 00:32 UTC ( #768=perlfaq nodetype: print w/replies, xml ) Need Help??

Current Perl documentation can be found at

Here is our local, out-dated (pre-5.6) version:

Read the CGI security FAQ, at, and the Perl/CGI FAQ at

In brief: use tainting (see the perlsec manpage), which makes sure that data from outside your script (eg, CGI parameters) are never used in eval or system calls. In addition to tainting, never use the single-argument form of system() or exec(). Instead, supply the command and arguments as a list, which prevents shell globbing.

Log In?

What's my password?
Create A New User
and not a whimper to be heard...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-03-24 20:11 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (299 votes). Check out past polls.