Live data from Hacker News

CVE-2014-7169: Bash Fix Incomplete, Still Exploitable

seclists.org

161–170 of 226 posts

Re: CVE-2014-7169: Bash Fix Incomplete, Still Exploitable

#161
post #88

The exploit worked against my cgi perl scripts as well! I had cgi-bin/update.pl running on OS X and I exploited it as mentioned here: https://twitter.com/hernano/status/514866681530023936 My perl scripts call $out = `git pull`, log to a file, and print a response; I was quite surprised the exploit worked against them. Promptly disabled, upgraded bash, and re-enabled, now disabling all cgi for a bit longer. What are t…

Perl backticks and system() delegate commands to the system shell, normally sh. On many systems, sh is simply bash in compatibility mode. That's how the attacker gets at the vulnerability.

Nice that "compatibility mode" does not bother to disable this technically non compatible behaviour...

Re: CVE-2014-7169: Bash Fix Incomplete, Still Exploitable

#164

My Zsh seems vulnerable. Anyone else care to replicate this? -- ➜ ~ zsh --version zsh 5.0.2 (x86_64-apple-darwin13.0) ➜ ~ echo $SHELL /bin/zsh ➜ ~ env x='() { do_something;}; echo vulnerable' bash -c "echo this is a test" vulnerable this is a test ---

You are using bash there...

Re: CVE-2014-7169: Bash Fix Incomplete, Still Exploitable

#165

Appears to work, even with latest patches, by using sh (from the link): $ env X='() { (a)=>\' sh -c "echo date"; cat echo date Wed Sep 24 15:00:34 PDT 2014 -- previous bug fix for bash (before/after patch) -- $ x='() { :;}; echo vulnerable' bash -c 'echo test' vulnerable test $ x='() { :;}; echo vulnerable' bash -c 'echo test' bash: warning: x: ignoring function definition attempt bash: error importing function defin…

I don't think either you or the author are correct. hobbes@media:~$ env X='() { (a)=>\' sh -c "echo date"; cat echo date cat: echo: No such file or directory hobbes@media:~$ uname -a Linux media 3.13-1-686-pae #1 SMP Debian 3.13.5-1 hobbes@media:~$ echo $BASH_VERSION 4.3.25(1)-release It looks to me like we're setting X in the environment, calling `sh -c "echo date"`, passing that X in to it, nothing happens, then we…

Switch sh to bash and it will work (create a file called echo)

Re: CVE-2014-7169: Bash Fix Incomplete, Still Exploitable

#167

My Zsh seems vulnerable. Anyone else care to replicate this? -- ➜ ~ zsh --version zsh 5.0.2 (x86_64-apple-darwin13.0) ➜ ~ echo $SHELL /bin/zsh ➜ ~ env x='() { do_something;}; echo vulnerable' bash -c "echo this is a test" vulnerable this is a test ---

if you do it correctly by using zsh instead of bash, you would that it is not vulnerable

  env x='() { do_something;}; echo vulnerable' zsh -c "echo this is a test"
  this is a test

Re: CVE-2014-7169: Bash Fix Incomplete, Still Exploitable

#168

OK - so assuming that there isn't going to be a single patch which fixes all possible / related bugs any time soon. Options? - Change /bin/sh to something else. (CentOS has BASH as default, alas...) - Filter out unknown, or suspicious looking HTTP vars / env vars at varnish/apache/nginx level, somehow... (doesn't stop other services) - Figure out some clever SELinux configuration that blocks it. I wonder how much wou…

Ubuntu 10.04LTS has dash as the default shell, as does Debian Squeeze (oldstable).

The default /bin/sh, but NOT the default login shell. Those are two very different things.

Re: CVE-2014-7169: Bash Fix Incomplete, Still Exploitable

#169
post #119

It looks like the important part of the patch (bash43-025) is here: In builtins/evalstring.c: if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def) In variables.c: parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD); So what the patch does is create a special mode of parse_and_execute() where it's supposed to only evaluate function definitions. A better option would…

Wouldn't that break the feature? Function definitions need to be executed so that they are available, right?

By "execution" I meant the execution of arbitrary code, either shell builtins or other programs, the original point of this vulnerability. Function definitions should really be thought of as being evaluated to make them available for future use.

Re: CVE-2014-7169: Bash Fix Incomplete, Still Exploitable

#170
post #23
post #22

I'm starting to see automated attack attempts using HTTP_HOST headers set to '() {'.

Are you seeing any from IP addresses besides 209.126.230.72, which is Robert Graham scanning the Internet[1]? [1] http://blog.erratasec.com/2014/09/bash-shellshock-scan-of-in...

I got mine!

    access.log.1:209.126.230.72 - - [25/Sep/2014:02:14:12 +0000]
    "GET / HTTP/1.0" 502 172 "() { :; }; ping -c 11 209.126.230.74" "shellshock-scan (http://blog.erratasec.com/2014/09/bash-shellshock-scan-of-internet.html)"
Post reply on HN