Bash 新漏洞:用户可以执行 root 权限

2014-09-25 09:38:43 +08:00
 mengzhuo
Github上通知的
http://seclists.org/oss-sec/2014/q3/649

共享VPS的可得小心了……
9472 次点击
所在节点    信息安全
34 条回复
jasontse
2014-09-25 09:51:33 +08:00
webshell 也要注意被提权
semicircle21
2014-09-25 09:53:13 +08:00
常年 root 敢死队用户表示这都不是事儿~
chinni
2014-09-25 09:57:35 +08:00
Cent 好像已经修复了?
lyragosa
2014-09-25 09:58:00 +08:00
zsh用户表示应该无影响?
steptodream
2014-09-25 10:08:44 +08:00
@lyragosa 除非你系统没装bash
LazyZhu
2014-09-25 10:09:28 +08:00
66beta
2014-09-25 10:10:52 +08:00
俺的DO上只有测试站点,不怕不怕
顶多被copy走价值2万多的知识产权
LazyZhu
2014-09-25 10:14:13 +08:00
业务使用的 Debian 其实只要加一个安全补丁源,每天更新下就可以了。
https://www.debian.org/security/
coolicer
2014-09-25 10:17:29 +08:00
@LazyZhu Ubuntu可以用吗?
LazyZhu
2014-09-25 10:22:24 +08:00
@coolicer
https://help.ubuntu.com/14.04/serverguide/configuration.html
Ubuntu也有相应的关键安全补丁源的
glasslion
2014-09-25 10:27:08 +08:00
@lyragosa csh, tcsh, ksh, sh, and zsh 无一幸免
dndx
2014-09-25 10:27:17 +08:00
root 权限有点夸张了吧,bash 又不是 setuid 的程序。
Tink
2014-09-25 10:27:35 +08:00
我去,那zsh呢
heiher
2014-09-25 10:49:08 +08:00
哪里有说和 root 权限有关了?
cxl008
2014-09-25 10:55:48 +08:00
求方法
lsylsy2
2014-09-25 11:20:04 +08:00
@LazyZhu 有办法在命令里只更新来自这个源的内容么?
万一用cron更新的时候把别的什么软件版本更新了出问题就囧了……
LazyZhu
2014-09-25 11:41:40 +08:00
@lsylsy2
笨办法,多个sources.list切换

/etc/apt/sources.list.security
/etc/apt/sources.list.all
fany
2014-09-25 12:17:42 +08:00
如果您使用的是CentOS、RedHat或Fedora,请在SSH下执行以下命令:
yum clean all
yum update bash
如果您用的系统是Ubuntu或Debian,请在SSH下执行以下命令:
apt-get update
apt-get upgrade
dorentus
2014-09-25 12:27:04 +08:00
没看到和 root 权限相关的说明。

CGI 暂且不提(反正多年没用过 CGI 了),
我的本地和远程机器的登录 shell 都是 fish shell,

---- 本地 ----

1) env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
显示果然有漏洞

2) env x='() { :;}; echo vulnerable' fish -c "echo this is a test"
没触发漏洞

3) env x='() { :;}; echo vulnerable' zsh -c "echo this is a test"
没触发漏洞

4) set -x x '() { :;}; echo vulnerable' # 相当于 bash 的 export x=...
bash -c "echo this is a test"
触发漏洞

---- ssh ----
5) set -x x '() { :;}; echo vulnerable'
ssh 到远程机器之后执行:bash -c "echo this is a test"
没见漏洞(这是自然的,因为远程机器 sshd 配置里面 AcceptEnv 只允许了 LANG LC_*)

6) 那么试试 set -x LANG '() { :;}; echo vulnerable' # 这里`包括之后每次执行一条命令都会有警告 locale 不对
再 ssh 到远程机器,看了下,LANG 没传递过去……
那么执行:bash -c "echo this is a test"
很自然地还是没见漏洞

7) 再试 set -x TERM '() { :;}; echo vulnerable'
ssh 到远程机器,远程 fish shell 提示:Could not set up terminal
然后连接断开

PS: 同第六步,设置 LANG 之后,ssh 到另一台登录 shell 为 bash 的机器上,LANG 依然是没传递过去
同第七步,设置 TERM,然后 ssh 到另一台登录 shell 为 bash 的机器上,终于成功触发了漏洞
mind3x
2014-09-25 12:33:53 +08:00
见风就是雨……谁说的有root?谁说的其他shell也中招?瞎JB扯...

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/135557

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX