Be certain to only assign write permissions to the root user for any directory containing scripts or CGIs. This can be accomplished by typing the following commands:
chown root <directory_name> chmod 755 <directory_name>
Also, always verify that any scripts running on the system work as intended before putting them into production.