jerrygarciuh has asked for the wisdom of the Perl Monks concerning the following question:

Gracious monks,
I have a perl script here which writes to a text file and uses the text to update an SSI footer for the form which sent the info. The 'success' page for the script is generated by the script and has the script URL in the address bar on the browser.
My question is: Is the visibility of the script's location a security issue? If so what measures would y'all recommend I take?
TIA
jg

Replies are listed 'Best First'.
Re: Script Visability and Security
by Zaxo (Archbishop) on Sep 18, 2001 at 11:02 UTC

    If the cgi environment is set up correctly, advertising the location of the script has no effect on security.

    There is potential for security problems in writing files from cgi. The key issues are:

    1. can the uset select the file path and name?
    2. can the user write arbitrary content or amount of data to the file?
    3. can the user overwrite existing files?
    There are many resources around for recognising these problems and correcting them. 'man perlsec' is a good introduction.

    After Compline,
    Zaxo

      If the cgi environment is set up correctly, advertising the location of the script has no effect on security.

      True, and this is the well-known There's no security through obscurity. However revealing such information is still a bad idea. Although it may not have a direct effect on this CGI script, it does reveal private information about the server which may be used to exploit another vulnerability, in another program or script. Think of a potential attacker quietly collecting all sorts of tidbits about how the server is layed out. Each piece of information is not a security issue in itself, but in the end it all adds up and can provide the attacker with enough information to compromise the system. That is why disclosing file system paths is never a good idea, and such bugs are a frequent topic on Bugtraq.

      I will add to that the simple fact that the full path to the script is already available within the source of your .shtml file.. "form action="

      Update: of course by full path, I mean the full URL which is what you were concerned with.
      Thanks echo for pointing that out.
        "form action=" points to the URL of the script, something quite different from its file system path.