- Do not use SUID shell scripts.
- Never, ever, under any circumstances, use SUID C-shell scripts.
- Always manually set your IFS.
- Always manually set your PATH and use absolute path names.
- Understand how the programs you call work, and how they handle arguments.
- Do not use temporary files. If you must, don't put them in a publicly writable area.
- Distrust and check all user input and eliminate dangers such as meta-characters.