by
Anonymous Coward
on 2014年09月25日 12時32分
(#2682274)
Linuxのだと
$ bash --version GNU bash, version 4.2.48(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test" bash: warning: x: ignoring function definition attempt bash: error importing function definition for `x' this is a test
こんな感じ。
Cygwinのだと
$ bash --version GNU bash, version 4.1.11(5)-release (x86_64-unknown-cygwin) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test" bash: warning: x: ignoring function definition attempt bash: error importing function definition for `x' this is a test
$ bash --version GNU bash, version 4.1.10(4)-release (i686-pc-cygwin) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later
This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test" vulnerable this is a test
$ bash --version GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later
This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
$ export HTTP_USER_AGENT='() { :;}; echo dangerous injection' $ bash -c "echo safe code" bash: warning: HTTP_USER_AGENT: ignoring function definition attempt bash: error importing function definition for `HTTP_USER_AGENT' safe code
脆弱性入りだと具体的にどうなるの (スコア:0)
Linuxのだと
こんな感じ。
Cygwinのだと
こんな感じ。
違いが全くわからない。
Cygwinの4.1系でも脆弱性無さげだけど。
Re:脆弱性入りだと具体的にどうなるの (スコア:2)
うちのCygwin だと、こんな感じでふ。
$ bash --version
GNU bash, version 4.1.10(4)-release (i686-pc-cygwin)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test
svn-init() {
svnadmin create .svnrepo
svn checkout file://$PWD/.svnrepo .
}
Re:脆弱性入りだと具体的にどうなるの (スコア:2)
$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test
$
ありだと上のようになるそうです。すべてのバージョンってのが間違ってて、つい最近のものだったりするのか…
あと修正が不十分だという発言を見かけたのですが、認識された [redhat.com]ようです。
Re:脆弱性入りだと具体的にどうなるの (スコア:1)
ってのが多分今回のパッチで追加された warning メッセージなので、元コメの人のは既に patch 適用済なのではと思います。
ディストリビューションに付属のものはバージョン番号を上げずに脆弱性対策のパッチだけを当てることがあるので、バージョン番号のみで判断できないというのはまぁいつものことですね。
Re:脆弱性入りだと具体的にどうなるの (スコア:1)
CentOS 6.5 x64 は対策済みのパッケージが配布されているみたいですね。
$ cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
$ rpm -qa | grep bash
bash-4.1.2-15.el6_5.1.x86_64
(@update http://mirror.centos.org/centos/6.5/updates/x86_64/Packages/ [centos.org] )
$ bash --version
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ export HTTP_USER_AGENT='() { :;}; echo dangerous injection'
$ bash -c "echo safe code"
bash: warning: HTTP_USER_AGENT: ignoring function definition attempt
bash: error importing function definition for `HTTP_USER_AGENT'
safe code
# SlashDot Light [takeash.net] やってます。
Re: (スコア:0)
どっちも対策済みじゃん
Re: (スコア:0)
これってSELinuxとかを有効にしてても緩和できなかったりするんですかね
Re: (スコア:0)
そのシェルを呼ぶ親プロセスが誰かによる。
httpdなどのログインシェルから呼ばれたのではないプロセスならたぶん動かない。
ただ、そもそもhttpdが任意のプロセスを起動できるというフラグを持っていればなんの役にもたたない。
それは設定で選べるのだったと思った。当然つけないのが推奨だけど、SSIとか昔からの互換のために機能としてはあるはず。
なんにでも言えることだけど、SELinixだから安心とか、そういうことで片付けないでちゃんとわかる人に調べてもらった方がいい。