A few things spring to mind here. This is all based on the assumption that users get to write their own HTML.
- I would strip all meta tags from their code. Users can play havoc with redirects, such as redirecting to porn sites or worse, having two accounts and having them redirect to each other's page. A browser could be then caught in an infinite loop of redirects.
- If they are allowed to create their own HTML, do they get to include images also? If so, you might have a concern about adult content.
- Make sure that server side includes are disabled or at least have the "exec" option turned off. Plus, I would probably just strip SSI tags from their input.
- This is the big one: however they create their pages, stick them in a database (after validating page size) or, if they are written out to files, make sure that the user CAN NOT pick their file name. Also, don't let their filename be based on the name they input. They could potentially stick a null byte in their username and cause you all sorts of pain.
Any other suggestions from fellow monks?
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.