Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Taint mode... use all the time?

by jfroebe (Parson)
on Feb 11, 2005 at 20:42 UTC ( [id://430259]=note: print w/replies, xml ) Need Help??


in reply to Re: Taint mode... use all the time?
in thread Taint mode... use all the time?

So, the taint really comes into play whenever there is a user interface of some sort. Whether it is web based, curses based, Tk based, etc.

Taint mode would be wasted on non interacting scripts (installation, etc0).. do I have this correct? trying to make sure I understand the reasoning :)

Jason L. Froebe

Team Sybase member

No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Replies are listed 'Best First'.
Re^3: Taint mode... use all the time?
by perlhaq (Scribe) on Feb 12, 2005 at 15:56 UTC
    I don't see much point of using -T on stuff like interactive clients, Tk or not. After all, if the user is going to try to mess with the client, all he can do is screw himself. I make it a point to use it for the server end though, whether it's a CGI script, daemon, Win32 service, or whatnot.

    That's not to say that a client program shouldn't be doing any kind of error checking. It should, to some extent. But the server shouldn't depend on that at all, and it should thoroughly check all input in minute detail (which is where taint mode helps out a bit, though it's not 100% foolproof).

    Basically, it comes down to this: any code running on a machine which you don't control is code that you can't depend on in terms of security.

      After all, if the user is going to try to mess with the client, all he can do is screw himself.

      Even it's result of bad input, (perhaps especially if ...) it will be in the user's mind "the program's fault" -- "the program trashed my disk/registry/irreplacable data file/..." and you'll be the one who gets bad-mouthed.

      If *, (), rm -rf /, ;"@{unlink <*>}" aren't valid in filenames, then don't let them be there. And having Perl cover your a** takes only one extra char!

        And having Perl cover your a** takes only one extra char!
        No, that's a myth. Sure, it takes one (or rather two) characters to turn on taint checking. But turning on -T doesn't mean Perl validates data for you! You still need to write the validating code (and detaining) code. And that takes more than one character.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-19 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found