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

Potentially huge problem.

A user of mine just reported that, while using a computer that has VB installed on it, he got an error messaged and was offered the option to debug.
He allegedly chose to debug, and my script was displayed in an editor.
A) Is this possible?
B) Why would a VB utility even be capable of debugging Perl?
C) The program runs fine, using strict and the line the error is reported on is nothing fancy and i see no bug.

My concern is that most of my scripts contain my database username and password. If he can pull up the script, there's a big security problem... heh

He's a good guy, and I trust him, it's others I'm concerned about and I would like to resolve this issue ASAP.

How can I address this issue?

Thank you monks!


Stenyj
  • Comment on VB debugging my Perl Scripts on user comp? help! Security issue!

Replies are listed 'Best First'.
Re: VB debugging my Perl Scripts on user comp? help! Security issue!
by davidj (Priest) on Jul 05, 2004 at 17:05 UTC
    1) Since he has VB installed on the computer, he probably has MS Visual Studio installed, which comes with MS InterDev. InterDev is a GUI debugging tool used for ASP scripts.

    2) If you are using activeState perl, it comes with activePerl which is an ActiveX component, meaning you can use it as an ASP scripting language.

    3) (I'm almost 100% certain this is true): your Perl script is, for all practical purposes, being seen by IIS as an ASP script. Thus, it is pulling it up in the InterDev debugger as it would a script written in ASP.

    It seems to me that for some reason IIS is having a problem processing the script. I would suggest you run it on his computer, bring it up in the InterDev debugger, and see what the problem is.

    Hope this helps,
    davidj
      From what my host has listed under my package, the site is hosted on a Linux machine, so (unless I'm mistkane) it shouldn't be an IIS or ActiveState problem, since I thought that ActiveState was strictly a windows version of perl, and IIS was a windows based server application.

      The script has been running fine for probably a year now... if not longer. Nobody else has reported this problem, and I can't find any errors in the code nor can I seem to reproduce the error (then again, I don't have VB installed... so that may be why).

      I'm assuming my only solution would be to setup a library below the web route, and then use a subroutine in the library to generate the connection to the database for each script? I just don't want to potentially leave my username & PW to my db out in the open (obviously).

      Any suggestions?

      Thx guys!

      Stenyj
        Is the server running front page extensions? If it is, someone would need a username and password to get to it. Other than that, I can think of no reason the server would serve up the source of the script (unless it's a configuration issue.)

        I'm assuming my only solution would be to setup a library below the web route...
        Yes, you should store your id & password outside of the web root.

Re: VB debugging my Perl Scripts on user comp? help! Security issue!
by dws (Chancellor) on Jul 05, 2004 at 16:59 UTC

    He allegedly chose to debug, and my script was displayed in an editor.

    If what appeared was the source to your CGI, then yes, you have a security problem, and probably a very unusual one.

    If instead what appeared was HTML, then what's happening is very normal. IE by default will ignore Javascript errors in pages. But with the right switches thrown on the client side, or the right Microsoft development tools installed (including the generic stuff underneath VB), the default changes to note that there's an error on the page, giving the user the option of opening the (HTML) page in one of the Microsoft development tools. This isn't a security problem, but you should locate and fix the Javascript error.

    (I'm assuming--and perhaps it's not a safe assumption--that you're able to see your page in a browser without apparent error.)

Re: VB debugging my Perl Scripts on user comp? help! Security issue!
by theorbtwo (Prior) on Jul 05, 2004 at 18:25 UTC

    There are several possibilities. Which one is the case will depend on many variables -- including how well-informed the user is, what sort of code you write, and how secure you are that your configuration is correct.

    The first possibility is that the user was incorrect, and the code in question was not perl at all, but javascript, and the debugger was Microsoft Visual InterDev, or Microsoft Visual Script Editor, not Visual Basic. (It's possible that VS 2003 has unified them, but last I looked, they were sepperate tools.)

    The second possibility is that you're writing an ASP-based (or similar -- I forget what the look-alike Apache-based framework is called, or even if there is one) page, and somehow your script got through to the browser, and was interpreted as incorrect javascript (see above).

    The third is that he's just rattling your chain.

    The fourth is that you aren't using a CGI-ish script at all, but rather are using a local script, and somehow, interdev, or even VB, managed to notice that it died, and debug it.

    Note that all of the above cases contain at least one miscommunication, so you may be best getting him to repeat it with you there, or at least take a screenshot.

      Yeah, I'm waiting to hear back from him for a screenshot. I'm starting to think it was something other then my code, but waiting for confirmation first.

      Thx for the feedback guys!
Re: VB debugging my Perl Scripts on user comp? help! Security issue!
by Anonymous Monk on Jul 05, 2004 at 16:44 UTC
    A) Yes.
    B) A few MS development utils will modify the system so that when a program crashes, one of the options is to debug the program.
    C) Then it you need to do more looking, because it broke somewhere. Try to reproduce the bug.

    That being said, if you're using perl, your users will most likely be able to "pull up the script". There are very few ways you can prevent this.