There's some misunderstanding of how the one-liner works, so here's a writeup. You can break the one-liner into two lines to see what is happening. 1. hobbes@media:~$ export badvar='() { :;}; echo vulnerable' 2. hobbes@media:~$ bash -c "echo I am an innocent sub process in '$BASH_VERSION'" 3. bash: warning: badvar: ignoring function definition attempt 4. bash: error importing function definition for `badvar' 5. I am…
I finally understand how it can be used.
CVE-2014-6271: Remote code execution through bash
341–350 of 432 posts
Re: CVE-2014-6271: Remote code execution through bash
#342Earlier quoted context omitted.
Because this allows execution of arbitrary commands from any unsantized environment variable. Web servers pass information about the HTTP client to CGI scripts using environment variables. A CGI script written in bash would be vulnerable to arbitrary command execution if any HTTP header contained the vulnerable string. GET / HTTP/1.0 User-Agent: () { :; }; rm -rf / Restricted SSH accounts (like the ones used by GitHu…
Who the hell writes CGI scripts in 2014? There is a reason PHP is to be kept away and not touched with a ten meter stick, it seems to spawn a shell for weird reasons, I dont think python or groovy apps do that. They're safe, unless you somewhere specifically invoke System.getRuntime().run("bash");
Re: CVE-2014-6271: Remote code execution through bash
#343Earlier quoted context omitted.
I finally understand how it can be used.
I'm sorry; perhaps I'm slow. I see the problem, but how can a stranger set an environment variable?
This can also happen with other service processes - such as OpenSSH, that sets ORIG_SSH_COMMAND variable to the command that the user supplies. That may allow people to break out of restricted accounts -i.e. accounts that are supposed to run just one command (ssh-based services, like SVN or Git, may be an example) and run arbitrary commands under such user.
Re: CVE-2014-6271: Remote code execution through bash
#344As an example of who might be impacted, since openssh preserves the original command line passed to the ssh server when authenticating a public key that has a fixed command associated in authorized_keys, GitHub and BitBucket security teams are probably both having a really exciting day.
This vulnerability is the kind of reason I would have a stripped-down OpenSSH for public users, if I were them. Hard-code to do what they need, don't use configuration files, remove any features not needed. For example, to print the "You've successfully authenticated, but GitHub does not provide shell access." a user gets trying to ssh to github.com, don't invoke anything, print it directly from the SSH server.
Re: CVE-2014-6271: Remote code execution through bash
#345Earlier quoted context omitted.
So for example if you don't run web servers that are front facing on the internet (and you trust your (for example) intranet) then does this become an "asap" rather than a "drop everything"? "is potentially an unauthenticated GET request" Are you saying that if you don't have a web server that allows "get" requests (only posts) then this exploit is not an issue at all?
No, that is not what tptacek is saying. Unauthenticated GET requests were just an example of something that can invoke this behavior. If you have any network-enabled service that's capable of spawning a shell, you can have attack vectors open. Possible vectors include things like DHCP clients, SSH, web servers, etc. Lots of things open shells for reasons you wouldn't intuitively expect. It's very likely that there ar…
Re: CVE-2014-6271: Remote code execution through bash
#346Earlier quoted context omitted.
I finally understand how it can be used.
I'm sorry; perhaps I'm slow. I see the problem, but how can a stranger set an environment variable?
Re: CVE-2014-6271: Remote code execution through bash
#347Has the redhat patch been pushed through centos yet?
Re: CVE-2014-6271: Remote code execution through bash
#348Earlier quoted context omitted.
I finally understand how it can be used.
I'm sorry; perhaps I'm slow. I see the problem, but how can a stranger set an environment variable?
That'd be pretty easy to do this if they weren't honest or man in the middle attack the site.
Re: CVE-2014-6271: Remote code execution through bash
#349Earlier quoted context omitted.
I finally understand how it can be used.
I'm sorry; perhaps I'm slow. I see the problem, but how can a stranger set an environment variable?
The moment any child process of these hit a system() or popen() like call, /bin/sh initializes and may hit the bug.
Re: CVE-2014-6271: Remote code execution through bash
#350The currently published fix is claimed to be incomplete: https://twitter.com/taviso/status/514887394294652929
Can anyone explain what's going on there? Seems like defining a function within a nameless function; how does it end up with this redirect? I'm not sure what the exploitabiliy of this is; is it just essentially $1 > $0 ?