in reply to file download security
Warning: You have a whopping security hole in your script. Because you don't check that the user-supplied filename is safe, the user could use this script to open (and possible run) any file on your box that the script would have the rights to access.
As for your original question, you have a few options. The easiest is to allow basic authentication and require each user to login in before they can get to your cgi-bin. However, basic authentication sends the data "Base64" encoded, which is plain-text. If you need this secure, this is not a good solution.
You could build a simple password authentication application that controls access to the other applications, but that also won't be terribly secure unless you use SSL, which is really the only way you're going to get decent security. Incidentally, my cgi course has information for a simple authentication program in Lesson 4, part 2. In fact, after looking at your code, I think there are a few other pointers you might appreciate from that course (no offense!).
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: file download security
by jreades (Friar) on Apr 15, 2002 at 18:35 UTC | |
by tachyon (Chancellor) on Apr 15, 2002 at 19:29 UTC | |
by tachyon (Chancellor) on Apr 16, 2002 at 14:01 UTC |