ShellShockの対応をした

OS XでのShellShockの対応に関することを。

とりあえず最初にbashのバージョンを調べてみる。

$ bash --version
GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
Copyright (C) 2007 Free Software Foundation, Inc.

ver.3.2.51と。ちなみにbashのmanを見ていて知ったのだけど、C-x C-vと入力すると現在使用しているbashのバージョンが出力される。

bashをアップデートしたとしても、bashのセッションが古いbashで起動した時のものだと、脆弱性がそのまま残っているので一度セッションを終了してから再度セッションを開いた方がいいと思う。

http://support.apple.com/kb/DL1769 からdmgファイルをダウンロードして、インストーラに従ってアップデートする。アップデート後のバージョンも見てみる。

$ bash --version
GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin13)
Copyright (C) 2007 Free Software Foundation, Inc.

ver.3.2.53になった。

https://github.com/hannob/bashcheck でbashの脆弱性をチェックしてみる。curlで直接スクリプトを実行しても良いのかな。

$ curl -L https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck | bash
Testing /bin/bash ...
GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin13)

Variable function parser inactive, bugs not explitable
Not vulnerable to CVE-2014-6271 (original shellshock)
Not vulnerable to CVE-2014-7169 (taviso bug)
Found non-exploitable CVE-2014-7186 (redir_stack bug)
Test for CVE-2014-7187 not reliable without address sanitizer
Found non-exploitable CVE-2014-6277 (lcamtuf bug #1)
Not vulnerable to CVE-2014-6278 (lcamtuf bug #2)

bashcheckを実行すると色付きで脆弱性に対応しているかどうかが出力される。見やすくてとても良い。

OS Xの対応は出来たけど、UbuntuやDebianで動かしているサーバもいくつか持っているのでそちらも対応しないと……

apt-getだけで対応できるのか、それをしたとしてもまだ脆弱性は残っているのか、とか調べないと。