Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: The importance of avoiding the shell

by Anonymous Monk
on Sep 26, 2014 at 15:14 UTC ( [id://1102148]=note: print w/replies, xml ) Need Help??


in reply to Re: The importance of avoiding the shell
in thread The importance of avoiding the shell

To be clear in my head, you're saying that if I run CGI scripts in taint mode that I don't need to worry about this bash bug from CGI?

Replies are listed 'Best First'.
Re^3: The importance of avoiding the shell
by ikegami (Patriarch) on Sep 29, 2014 at 06:54 UTC

    I'm pretty sure that is what he's saying, but he's wrong if that's the case.

    $ HTTP_ACCEPT='() { :;}; echo 0wn3d' \ perl -T -e'$ENV{PATH}=""; system(q(/bin/ls -- "$HOME"))' 0wn3d ... contents of home dir ...

    While $ENV{HTTP_ACCEPT} is tainted, system doesn't check if it's tainted.

Re^3: The importance of avoiding the shell
by Anonymous Monk on Sep 26, 2014 at 15:25 UTC

    Taint mode, like most security measures, is "just" an additional security measure. Whether or not you "need to worry" depends a whole lot on the individual situation. Generally, turning on taint mode in CGI scripts is a good idea, but it is not a silver bullet.

Re^3: The importance of avoiding the shell
by petdance (Parson) on Oct 01, 2014 at 19:50 UTC
    No, I am not making any claims about taint mode mitigating the bash bug.

    My point is that the bash bug is, at its core, about treating untrusted data as executable code. Perl's taint mode is designed to catch that problem in Perl code.

    Say you get an argument from the command line in your Perl program. That variable is now tainted, because it came from an untrusted source. Now, say you try to execute a command with system using that variable. Perl's taint mode will disallow it because the data fed to system is untrustworthy.

    xoxo,
    Andy

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-03-29 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found