Hey guys, I wrote a small program as shown below that is used to linux man pages over the internet. I was looking at the code and realized that there is a big security hole becuase the user could enter in the text box "themanpage ';' system command" which would allow anyone to execute system commands with the apache user permissions. Can anyone tell me how to limit what I will allow in the text box? such as if there is a semi colon then delete it or give them a message like "nice try ;-)"
Thanks,
Ben LeMasurier
Source:
echo "
<head>
<title>PHPMan
</title>
</head><body bgcolor=#ffffff>"; // start out the html
$view = man $page | col -b; // change the variable to exec a system command
echo "<pre>$view</pre>";
?>
</body>