Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Web Server & Linux  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to topicflat modethreaded modego to previous topicgo to next topicgo to back
作者 GNU Bash CVE-2014-6271环境变量处理远程代码执行漏洞
阿熊

阿熊

元老


发贴: 5644
于 2014-09-26 07:39 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
影响系统
gnu bash 1.14.0
gnu bash 1.14.1
gnu bash 1.14.2
gnu bash 1.14.3
gnu bash 1.14.4
gnu bash 1.14.5
gnu bash 1.14.6
gnu bash 1.14.7
gnu bash 2.0
gnu bash 2.01
gnu bash 2.01.1
gnu bash 2.02
gnu bash 2.02.1
gnu bash 2.03
gnu bash 2.04
gnu bash 2.05
gnu bash 2.05 a
gnu bash 2.05 b
gnu bash 3.0
gnu bash 3.0.16
gnu bash 3.1
gnu bash 3.2
gnu bash 3.2.48
gnu bash 4.0
gnu bash 4.0 rc1
gnu bash 4.1
gnu bash 4.2
gnu bash 4.3

远程攻击者利用漏洞可以应用程序上下文执行任意命令。

攻击所需条件

攻击者必须访问调用GNU Bash的应用。

漏洞信息

GNU Bash是一个命令语言解释器,能够从标准输入设备或文件读取、执行命令,同时它也结合了一部分ksh和csh的特点。

GNU Bash处理特定的环境变量存在输入验证漏洞,允许未验证远程攻击者利用漏洞提交特殊请求,以应用程序上下文执行shell命令。

GNU Bash在处理环境变量值中函数定义后的字符串时缺少充分过滤,通过特制的环境变量执行任意shell命令,如通过OpenSSH sshd的ForceCommand特性(ForceCommand特定用来给远程用户提供受限命令执行能力,因此使用该特定的如git,subversion等会受影响),Apache HTTP Server中的mod_cgi和mod_cgid模块(在Apache Server启动了mod_cgi和mod_cgid模块时,只要CGI脚本是BASH编写,或使用了派生的subhell会受影响,能够产生subshell的包括:C语言的system/popen, Python的os.system/os.popen, PHP的system/exec, perl的open/system),DHCP客户端执行脚本等其他条件来触发该漏洞。

测试方法

$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test

---------------------------------------------------------
[root@host cgi-bin]# rm -fr /tmp/aa
[root@host cgi-bin]# cat /var/www/cgi-bin/hi
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "hai"
[root@host cgi-bin]# curl -k -H 'User-Agent: () { :;}; echo aa>/tmp/aa' https://localhost/cgi-bin/hi
hai
[root@host cgi-bin]# tail -n1 /var/log/httpd/ssl_access_log
::1 - - [24/Sep/2014:18:22:05 +0200] "GET /cgi-bin/hi HTTP/1.1" 200 4 "-" "() { :;}; echo aa>/tmp/aa"
[root@host cgi-bin]# ls -l /tmp/aa
-rw-r--r--. 1 apache apache 3 24 sept. 18:22 /tmp/aa

用户可参考如下厂商提供的安全补丁以修复该漏洞:

http://ftp.gnu.org/pub/gnu/bash/bash-3.0-patches/bash30-017
http://ftp.gnu.org/pub/gnu/bash/bash-3.1-patches/bash31-018
http://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-052
http://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-039
http://ftp.gnu.org/pub/gnu/bash/bash-4.1-patches/bash41-012
http://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-048
http://ftp.gnu.org/pub/gnu/bash/bash-4.3-patches/bash43-025



yum clean all
yum --enablerepo-updates install bash

漏洞消息链接
https://securityblog.redhat.com/2014/09/24/bash-specially-crafted-environment-variables-code-injection-attack/
http://seclists.org/oss-sec/2014/q3/649
https://access.redhat.com/node/1200223



作者 Re:GNU Bash CVE-2014-6271环境变量处理远程代码执行漏洞 [Re:阿熊]
阿熊

阿熊

元老


发贴: 5644
于 2014-09-26 07:41 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
红帽系可通过更新 bash 并重启系统来解决这个问题:
yum update bash
或者:
yum update bash-4.1.2-15.el6_5.1
此举只是更新了 bash 包,还需要重启系统才能生效。

Ubuntu 用户可以通过如下命令打补丁,无需重启:
apt-get updateapt-get install bash




reply to topicflat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923