4 ms·
Ok, let me see if I have this straight, since I'm not seeing an end of the world situation here. This requires a webserver to be running CGI (mod_cgi or whatev
by mhurron 12y ago
Ok, let me see if I have this straight, since I'm not seeing an end of the world situation here.
This requires a webserver to be running CGI (mod_cgi or whatever) and the get request has to go to a valid page, correct? So in this case `GET /cgi-bin/hello ... yada yada yada` /cgi-bin/hello has to be a valid location.
So, explain to me how this is any worse than any remote execution vulnerability in something like PHP?
- yebyen 12y ago> explain to me how this is any worse than any remote execution vulnerability in something like PHP? Why does it need to be worse than something you might find in PHP? If it's a worm that's been found in the wild spreading by exploiting a remote execution vulnerability in bash and cgi, isn't that bad enough?
- mhurron 12y ago> Why does it need to be worse than something you might find in PHP? Because that's what it's being hyped as, or more correctly hyped as "OH MY GOD IT'S THE END OF EVERYTHING" when in reality it appears that if you're not running ssh with forcecommands or a webserver with CGI enabled, you don't care, just like if you didn't run a webserver with PHP enabled a PHP vulnerability wouldn't really be much of an issue to you.
- general_failure 12y agoYeah, I am not sure why there is so much hype. From what I can tell you are affected only if you use CGI or the like somewhere in your response chain. AFAIK most people use http reverse proxies, phpfm, wsgi and the like. They are all unaffected.
- epochwolf 12y agoThere's a lot of older web applications that run via cgi.
- nitrogen 12y agoIt is not just CGI. It is any process that uses user-controlled environment variables anywhere, that later eventually happens to call something that calls something that calls system() or executes a shell script. So CUPS printer servers at universities may be vulnerable. Dhclient may be vulnerable to malicious DHCP responses. Anything that calls out may be vulnerable (lots of mail libraries actually call /usr/bin/sendmail or the like; better hope they don't use system() or a bash /bin/sh to do it). This is a big deal because there's a ton of stuff that uses environment variables that is and is not a web server, and very little time to track it all down before a black hat or oppressive regime gets there first.
- drvdevd 12y agoThink of it this way: this doesn't just affect webservers. It affects most unpatched bash instances. The vector of attack is through environment variables in bash. You could argue that 90% of the worlds' PHP servers will probably contain bash, but that the converse is not true: 100% of the worlds' bash instances may not contain PHP. Therefore, the attack surface is much larger and the attack vector much more basic to the way the OS works. Since environment variables are so "leaky" -- they are often spread between processes without any sort of checks -- there are essentially innumerable ways for an exploit to reach a vulnerable version of bash, both remotely and offline.
- mhurron 12y ago> It affects most unpatched bash instances But it needs something to expose bash to the outside world. Without mod_cgi (or the like) or sshd with a specific configuration, a vulnerable bash isn't going to be remotely exploitable.
- nitrogen 12y agoNo, it doesn't. Bash is already indirectly exposed to the world by anything that calls system() with bash as /bin/sh. More library functions than you might expect are wrappers around external binaries (e.g. mail() calling /usr/bin/mail) on PHP, Ruby, etc. Their authors probably thought they were safe with escapeshellarg()-like functions, but now any user-controlled env var set for whatever reason, not just CGI, is an attack vector, and not just through HTTP and not just through headers.
- skuhn 12y agoIt is correct that PHP's mail() function will fork a shell: sendmail = popen(sendmail_cmd, "w"); Which calls /bin/sh to execute sendmail_cmd. However, two things must also be true: 1. /bin/sh is bash 2. PHP has set environment variables with user-provided data #1 is often the case, but is much less common now than in the past. #2 is not commonly the case, PHP does not even automatically create PHP variables from user-provided data anymore (because it is a terrible idea to put untrusted data into a trusted scope without sanitizing).
- SchizoDuckie 12y agoIt's not worse, it's equal. But the thing is that people didn't think that this would happen and now they're affected. So yes, that's quite 'drop your sandwich while you're eating it and go update your servers'
- dz0ny 12y agoFYI some routers, STBs run httpd with cgi-bin. It's lot worse than some PHP vulnerability, because PHP is not used on those devices but bash is.
- yourad_io 12y agoDon't most routers run some form of busybox or ash rather than bash?
- mzs 12y agoYes, I'm getting really annoyed seeing comments like this pop-up repeatedly, ash has no exporting of functions even: # type foo foo is a shell function # export -f foo -sh: export: Illegal option -f
- mhurron 12y agoYou know, this whole thing would be a lot clearer to everyone if the following would be clearly communicated: Are you running sshd with ForceCommand? - Get Patching (when a patch is out) Are you running a webserver that uses 'old style' CGI (are you really sure you're not?) - Get Patching (when a patch is out) Are you absolutely sure neither of the above is true? Then patch bash in your next patch cycle. The super-hype vulnerabilities are getting is just muddying the waters when trying to get actual information.
- nitrogen 12y agoAre you certain that no process on your system ever sets an environment variable to a user-controlled value? Get patching. Hypothetical: some GPG library is just a wrapper around /usr/bin/gpg. Maybe that library uses an environment variable to set a password that doesn't show up in ps. Maybe that library used system() instead of execve(). That password is now an attack vector. See also /usr/bin/mail called by mail() functions in scripting languages, /bin/hostname, /bin/uname, etc. If any user-controlled variable is set in the environment, those calls become potential attack vectors
- danielweber 12y agoIt's like a remote execution vulnerability in PHP and Ruby and DHCP and Django and Perl and any of a bunch of different services all layered together. Environment variables are passed around all the time.
- thefreeman 12y agoI understand why its a big deal. What I don't understand is why everybody seems to think its necessary to start posting every script kiddies attempt at spreading their crappy ddos / botnet scripts via the vulnerability.