Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Re: Re: Re: How to do that with eval ?

by Hissingsid (Sexton)
on Apr 10, 2004 at 08:34 UTC ( #344105=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re: How to do that with eval ?
in thread How to do that with eval ?

>>"Absolutely. If the above script was a cgi, you might as well reformat your disk now. If the script is meant to be a 'quick hack', evals work, they work well, and with minimal coding."


In the interests of clarity I'd be grateful if you could make it absolutely clear which of the "above" scripts you are referring to. I'm trying to learn and don't want to inadvertently misunderstand.


  • Comment on Re: Re: Re: Re: How to do that with eval ?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: How to do that with eval ?
by perlmonkey (Hermit) on Apr 10, 2004 at 19:58 UTC
    By 'above' I was refering to my previous post. If you run an eval on user input, the user input could be anything. In this case if the user instead of entering '>=' like we expect, enters ';`sudo rm -rf /`;' this will make the eval execute this extremely damaging command.

    For more reasons of how to make sure you are not allowing users to do bad things, please read the perlsec manpage

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://344105]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2018-01-23 18:37 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (252 votes). Check out past polls.