The minimum permissions you can give is related to the exact setup of the server.
In an ideal situation, you could just set everything 700 and forget it, however the sheer majority of ISPs do *NOT* run CGIs as you, they run them as user nobody. That's why we ask that certain files be set up as 777. Files owned by you but accessed by nobody set to less than 666 would not be (reliably) usable. Nobody is a real pain. You can quote me on that.
Please, PLEASE do not change permissions on ANYTHING until you ask their host if they are running CGIWrap, suExec, or a similar CGI wrapper to ensure CGI scripts run as a user rather than nobody.
Also a little reminder - we can not officially support a board that's not using the permission settings we set forth in the installation instructions. If something goes wrong at your board, you may have to reset permissions on your files...
As for the hacking - three months ago, the UBB contained a nasty security hole that would have allowed something like what you describe. Current UBB versions don't contain the hole.
------------------
Charles Capps,
Moderator, Post-Install TroubleshootingPLEASE NOTE: Due to time limitations, I do not provide UBB support via email.