in reply to Re (tilly) 1: CGI Security and Forking
in thread CGI Security and Forking

You pointed out the danger of what occurs when someone enters something like ' `rm -rf /`. In this case, it's not possible because the character class specifically did not allow for backticks or forward slashes (amongst other things). That was part of the reason why I was trying to figure out why it was dangerous. Now I think I see the point: with the fork, it's not possible to pass the arguments directly to the shell, regardless of further modifications. The first version was only secure so long as someone did not allow the offending characters.

Thanks for the tip on IPC::Open3. I'll check it out.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.