Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^6: Security issue and solution for terminal command accessed by public user

by Anonymous Monk
on Jul 07, 2012 at 04:39 UTC ( #980433=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Security issue and solution for terminal command accessed by public user
in thread Security issue and solution for terminal command accessed by public user

That's what; not why. Those modules exist and serve useful purposes; but just as I do not use high-pressure autoclaves, ultrasonic debriders or anti-bacterial soaps to clean my car; there is simply no good reason for using those modules for this purpose. So your terse suggestions and laconic style amount to nothing more than insecurity and bluster.

Of course its a why. What you do is irrelevant. The OP doesn't want to limit his program, and you're telling him to limit his program as a sham for safety. You know better, but for some reason you're being a dick


Comment on Re^6: Security issue and solution for terminal command accessed by public user
Re^7: Security issue and solution for terminal command accessed by public user
by BrowserUk (Pope) on Jul 07, 2012 at 05:46 UTC

    If the information is for the OP, offer it as a reply to the OP, not me!

    And just how restricting the arguments to the program, to their exact range of legal values, limiting?

    If you think throwing whatever garbage or carefully calculated input a (potentially malicious) user chooses to supply, at a shell and trusting to luck that there are no flaws in the quoting done by those modules, is an effective security mechanism, you are somewhat less than a dick. You are a fool!

    I thought everyone knew that the *only* secure method of doing the is to only allow that which is safe.

    Trying to "sanitise" user input has been the downfall of many a system. And with fools like you around, it will long continue that way.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      If the information is for the OP, offer it as a reply to the OP, not me!

      Its both

      And just how restricting the arguments to the program, to their exact range of legal values, limiting?

      It would require the Op to enumerate every possible legal input , even all the units, of which he says there are 2526; quoting is much simpler

      If you think throwing whatever garbage or carefully calculated input a (potentially malicious) user chooses to supply, at a shell and trusting to luck that there are no flaws in the quoting done by those modules, is an effective security mechanism, you are somewhat less than a dick. You are a fool!

      Its much better to badmouth them without investigation of any kind

      I thought everyone knew that the *only* secure method of doing the is to only allow that which is safe.

      Yup, and quoting , or avoiding the shell accomplishes this exactly

      Trying to "sanitise" user input has been the downfall of many a system. And with fools like you around, it will long continue that way.

      What, you've never heard of the `rm -rfv /` units?

        Its both

        Then if you are offering it as advice to me, I reserve the right to reject it. And explain why. Which I did.

        even all the units, of which he says there are 2526;

        I made it 2571. It took me exactly 6 minutes to locate the source; download the file; unzip it; locate definitions.units; load it into my editor; and run 5 regex substitutions and half-a-dozen manual fixups to isolate that list. Which I then pasted into the data section of a script:

        #! perl -slw use strict; use Time::HiRes qw[ time ]; my $start = time; my %units = map{ chomp; $_ , 1 } <DATA>; print time-$start; __DATA__ ...

        And it took a whole 7 milliseconds to load the hash:

        C:\test>junk3 0.00783705711364746
        Its much better to badmouth them without investigation of any kind
        1. I didn't bad mouth; just said that they were unnecessary.
        2. I did investigated String::ShellQuote.

          Enough to discover that as only supports BourneShell quoting, it would be useless to me or anyone who needs to support some other shell. Which would then require yet another module and trusting yet another author.

          And for long enough to know that it would take me days to convince myself that the author knew what he was doing; and much longer to convince myself he'd covered everything.

        As for IPC::System::Simple. I've investigated that before. And whilst I have seen modules that purport to be 'better' substitutes for built-ins that were more bloated, and/or more pointless, but there aren't many.

        Now that is bad mouthing if you wish to see it that way.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://980433]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2014-10-20 08:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (73 votes), past polls