Most servers are setup to prevent listing any files/subdirectories of the cgi-bin.... similar to how our server prevents you from listing this data directory:
(You should get some sort of "Forbidden" Error).
Unfortunately, I don't know enough about configuring server to be able to say what would need to be done on your server to configure it this way.
As described in section 4 on this reference page:
The idea is to prevent website visitors from accessing/listing your "data" directory (or whatever name you give it).
If giving that directory 777 permissions does allow regular website visitors to access your data directory, then:
1) You would need to get your web hosting provider to configure your data directory to prevent visitors from accessing that directory (as discussed above).
2) Your web hosting provider may provide something called "CGI WRAP" ... which essentially allows CGI script to run as a user... as opposed to running as "www" or "nobody". By running scripts as a user... you can actually set permissions on your data directory to something like 700. If your provider does provide CGI WRAP... and you need any assistance configuring the scripts to run with CGI WRAP... then just send us a support request (or email us at email@example.com) and I will assist.