Maybe I am being a bit paranoid, but as I am re-writing a contact module, the following question came to mind:
Can I use unfiltered input in php's native functions?
It is easy to sanitize stuff to put in a database, output to the screen, etc. but I was wondering if for example the following statement could be dangerous:
if (file_exists($_POST['brochure'])) {
// do some stuff
}
If someone somehow managed to post to that page, could the above code be exploited?
The above code is just an example, I can think of other functions I use when processing a form.
Edit: Thanks everybody, the file_exists in the example is actually part of a sanitation function but when cleaning up, php functions are being used so it is rapidly becoming a chicken and egg story: To use functions, I have to clean up, but to clean up I have to use functions.
Anyway, I have got some fresh ideas now.