5 ms·
Is it just me, or are the patches "fixing" the vulnerability woefully insufficient? With the patch, bash stops executing the trailing code, but it still allows
by JoshTriplett 12y ago
Is it just me, or are the patches "fixing" the vulnerability woefully insufficient? With the patch, bash stops executing the trailing code, but it still allows defining arbitrary shell functions from environment variables. So, even though the patch fixes the ability to exploit this via SSH_ORIGINAL_COMMAND or HTTP_*, anything that can set environment variables can still override an arbitrary command. (Note that privileged environments typically filter out attempts to set PATH, LD_LIBRARY_PATH, and so on.)
This applies even if your shell script or shell snippet uses the full paths to commands. For instance:
$ env '/sbin/foo'='() { echo exploit; }' bash -c '/sbin/foo'
exploit
- jimrandomh 12y agoAttacker-controlled environment variable names are a rare scenario, and one that probably has you hosed no matter what. Attacker-controlled environment variable values, on the other hand, are not so rare, and if not for this vulnerability they wouldn't be a problem.
- peterwwillis 12y agoMore specifically: The environment in general is an attack vector. I mean, it's global input that crosses execution domains! Any name/value pair could potentially mess with any number of programs in unexpected ways. A user should not be able to control any environment changes, period. Of course, whether or not this is practical is an exercise for the sysadmin.
- sliverstorm 12y agoThe vulnerability was released, what, a few hours ago? With a major vulnerability, waiting around for a "proper" fix is probably not a good idea. Get in a hot-patch to minimize the damage, then work on a "proper" fix...
- notacoward 12y agoIt's not just you. The fact that an environment variable can override e.g. "git" to do something else is a real problem requiring separate protection. However, that's effectively PATH injection rather than code injection so it's already addressed in many cases.
- increment_i 12y agoI might be misunderstanding this, but this can be accomplished through http request headers?
- riquito 12y agoIt would be a malformed http header and most libraries would ignore it or raise an error.
- JoshTriplett 12y agoExcept that most environments already filter out attempts to control PATH, LD_LIBRARY_PATH, and similar; they don't filter out "git".
- notacoward 12y agoI agree. In the next few months, we'll probably be finding out about some of the cases where neither existing sanitization nor the half-fix for this problem was sufficient to prevent exploits in this family. :(