Apache Struts2远程代码执行漏洞(S2-052)(CVE-2017-9805)
受影响系统:
Apache Group Struts 2.5-2.5.12
Apache Group Struts 2.1.2-2.3.33
不受影响系统:
Apache Group Struts 2.5.13
Apache Group Struts 2.3.34
描述:CVE(CAN) ID: CVE-2017-9805
Struts2 是构建企业级Jave Web应用的可扩展框架。
Struts 2.5 - Struts 2.5.12、Struts 2.1.2 – Struts 2.3.33版本,使用XStreamHandler反序列化XStream实例时,没有任何类型过滤,导致远程代码执行。
<*来源:Man Yue Mo (<mmo at semmle dot com> (lgtm.com / Semmle))
链接:https://struts.apache.org/docs/s2-052.html
*>
建议:临时解决方法:
如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:
添加xml过滤器,将所有的contentType为“application/xml”的请求全部过滤。该方案会导致所有contentType为application/xml的请求失效,为暂时性的防护方案。
注意:
新版本使用的默认限制策略会导致REST的一些函数停止工作,会对一些业务造成影响,建议使用以下新的接口:
org.apache.struts2.rest.handler.AllowedClasses
org.apache.struts2.rest.handler.AllowedClassNames
org.apache.struts2.rest.handler.XStreamPermissionProvider
厂商补丁:
Apache Group
------------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
https://cwiki.apache.org/confluence/display/WW/S2-052
Struts官方已经发布了最新版本,请受影响的受用尽快升级来进行防护。
参考链接:
Struts 2.3.34:
https://cwiki.apache.org/confluence/display/WW/Version+Notes+2.3.34
Struts 2.5.13:
https://cwiki.apache.org/confluence/display/WW/Version+Notes+2.5.13