Apache Struts 'getClass()'方法安全限制绕过漏洞


发布日期:2014-04-28
更新日期:2014-04-29

受影响系统:
Apache Group Struts 2.0.0 - 2.3.16.1
描述:
--------------------------------------------------------------------------------
BUGTRAQ  ID: 67081
 CVE(CAN) ID: CVE-2014-0113
 
Struts2 是第二代基于Model-View-Controller (MVC)模型的java企业级web应用框架。
 
Apache Struts 2.0.0 - 2.3.16.1内引入的排除参数模式无法有效阻止对getClass()方法的访问,攻击者通过特制的请求,利用此漏洞可绕过该模式。另外CookieInterceptor配置为接受所有cookie后也存在此类安全漏洞。成功利用后可使攻击者绕过某些安全限制并执行未授权操作。

推荐阅读:

Struts2的入门实例

Struts中异步传送XML和JSON类型的数据

<*来源:Taki Uchiyama
        Takeshi Terada
        Takayoshi Isayama
        Yoshiyuki Karezaki
        NSFOCUS Security Team
        BAKA/ty
        Shine
        heige
 
  链接:http://secunia.com/advisories/58016/
        https://cwiki.apache.org/confluence/display/WW/S2-021
 *>

建议:
--------------------------------------------------------------------------------
临时解决方法:
 
如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:
 
* 排除 'class' 参数
 
在excludeParams列表上,用 '(.*\.|^|.*|\[('|"))class(\.|('|")]|\[).*' 代替之前类相关模式,如下所示:
 <interceptor-ref name="params">
  <param name="excludeParams">(.*\.|^|.*|\[('|"))(c|C)lass(\.|('|")]|\[).*,^dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,^parameters\..*,^action:.*,^method:.*</param>
 </interceptor-ref>
 
对CookieInterceptor无法执行此操作,请不要使用通配符映射接受cookie名称或在 Struts 2.3.16.2 提供的代码基础上,执行自己的CookieInterceptor版本。
 
厂商补丁:
 
Apache Group
 ------------
 Apache Group已经为此发布了一个安全公告(S2-021)以及相应补丁:
 S2-021:S2-021
 链接:https://cwiki.apache.org/confluence/display/WW/S2-021
 
补丁下载:http://struts.apache.org/download.cgi#struts23162

Struts 的详细介绍:请点这里
Struts 的下载地址:请点这里

本文永久更新链接地址:

相关内容