天天看點

Struts2遠端代碼執行漏洞CVE-2017-9805 s2-052 綠盟科技釋出掃描工具

struts2在使用帶有 xstream 處理程式的 struts rest 插件,處理 xml 有效負載時,可能發生遠端代碼執行攻擊

綠盟科技随即釋出釋出預警通告(見本文後半部分),并給出cve-2017-9805(s2-052漏洞)免費線上掃描工具

<a href="https://cloud.nsfocus.com/#/krosa/views/initcdr/productandservice?page_id=12" target="_blank">https://cloud.nsfocus.com/#/krosa/views/initcdr/productandservice?page_id=12</a>
http://toutiao.secjia.com/struts2-cve-2017-9805-s2-052-protection

讀者

所有struts 2 開發者及使用者

漏洞影響

安全等級

嚴重

建議

受影響版本

struts 2.12 - struts 2.3.33 , struts 2.5 - struts 2.5.12

報告者

cve編号

cve-2017-9805

問題

rest 插件正在使用帶有 xstream 執行個體的 xstreamhandler 進行反序列化, 而不進行任何類型篩選, 這可能導緻在對 xml 有效負載進行序列處理時,執行遠端代碼。

解決方案

更新到 apache struts版本 2.5.13.

由于對可用類的應用預設限制, 一些 rest 動作可能停止工作。在這種情況下, 請調查為允許定義每個操作的類限制而引入的新接口, 這些接口是:

<code>org.apache.struts2.rest.handler.allowedclasses</code>

<code>org.apache.struts2.rest.handler.allowedclassnames</code>

<code>org.apache.struts2.rest.handler.xstreampermissionprovider</code>

最好的選擇是, 當不使用rest插件時,或僅限于伺服器普通頁面和 json時,删除 struts rest插件

<code>&lt;constant name= </code><code>"struts.action.extension" </code><code>value= </code><code>"xhtml,,json" </code><code>/&gt;</code>

綠盟科技釋出公告稱,公告全文如下

2017年9月5日,apache struts釋出最新的安全公告,apache struts 2.5.x的rest插件存在遠端代碼執行的高危漏洞,漏洞編号為 cve-2017-9805 ( s2-052 ) 。漏洞的成因是由于使用xstreamhandler反序列化xstream執行個體的時候沒有任何類型過濾導緻遠端代碼執行。

相關連結如下:

https://cwiki.apache.org/confluence/display/ww/s2-052

影響版本:

struts 2.5 - struts 2.5.12

立即更新到struts 2.5.13。

注意:

新版本使用的預設限制政策會導緻rest的一些函數停止工作,會對一些業務造成影響,建議使用以下新的接口:

org.apache.struts2.rest.handler.allowedclasses

org.apache.struts2.rest.handler.allowedclassnames

org.apache.struts2.rest.handler.xstreampermissionprovider

本安全公告僅用來描述可能存在的安全問題,綠盟科技不為此安全公告提供任何保證或承諾。由于傳播、利用此安全公告所提供的資訊而造成的任何直接或者間接的後果及損失,均由使用者本人負責,綠盟科技以及安全公告作者不為此承擔任何責任。綠盟科技擁有對此安全公告的修改和解釋權。如欲轉載或傳播此安全公告,必須保證此安全公告的完整性,包括版權聲明等全部内容。未經綠盟科技允許,不得任意修改或者增減此安全公告内容,不得以任何方式将其用于商業目的。

原文釋出時間:2017年9月5日 

本文由:apache釋出,版權歸屬于原作者

原文連結:http://toutiao.secjia.com/struts2-rce#

本文來自雲栖社群合作夥伴安全加,了解相關資訊可以關注安全加網站