""A bird doesn't sing because it has an answer, it sings because it has a song."
Maya Angelou

Make /tmp nonexecutalbe and secure your box!!!

Leaving the /tmp folder executable, surely does cause a security risk, as PHP can be used to upload as 'nobody' files to other parts of your system. Making the /tmp folder nonexecutable would eliminate such a security risk and enable you to breathe easy...

Here is how you should proceed:
  1. Create a file that we will use to mount at /tmp
  2. Create a 200mb file in /dev
    cd /dev 
    dd if=/dev/zero of=tmpMnt bs=1024 count=200000
    
  3. Make an extended filesystem for our tmpMnt file
    mke2fs /dev/tmpMnt (hit y when prompted)
    
  4. Backup your /tmp dir
    cd /
    cp -R /tmp /tmp_backup
    
  5. Mount the new /tmp filesystem with noexec.
    mount -o loop,nosuid,noexec,rw /dev/tmpMnt /tmp
    chmod 777 /tmp
    
  6. Copy everything back to new /tmp verify and remove backup
    cp -R /tmp_backup/* /tmp/
    cd /tmp
    ls -la (verify the files are there)
    rm -rf /tmp_backup
    
  7. Add to fstab so it mounts automatically on reboots.
    vi /etc/fstab
    
  8. You will see something like this:
    LABEL=/ / ext3 defaults 1 1
    none /dev/pts devpts gid=5,mode=620 0 0
    LABEL=/home /home ext3 defaults 1 2
    none /proc proc defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    LABEL=/usr /usr ext3 defaults 1 2
    LABEL=/var /var ext3 defaults 1 2
    /dev/hda6 swap swap defaults 0 0
    
    At the bottom add
    /dev/tmpMnt /tmp ext2 loop,nosuid,noexec,rw 0 0
    
    Note: Each space is a tab
  9. Your done- /tmp is now mounted as noexec. then
    cd /var
    rm -rf tmp
    ln -s /tmp /var/tmp
    
    and your done!!!