日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Struts2再曝S2-020補(bǔ)丁繞過漏洞–萬惡的正則表達(dá)式

4月24日,網(wǎng)絡(luò)曝出文章“安全研究人員指出Apache Struts2在漏洞公告S2-020里,在處理修復(fù)CVE-2014-0094的漏洞修補(bǔ)方案存在漏洞,導(dǎo)致補(bǔ)丁被完全繞過?!?/p>

受影響產(chǎn)品:

Struts 2.0.0 – Struts 2.3.16.1

成因與威脅:

Apache Struts 2.0.0-2.3.16版本的默認(rèn)上傳機(jī)制是基于Commons FileUpload 1.3版本,其附加的ParametersInterceptor允許訪問'class' 參數(shù)(該參數(shù)直接映射到getClass()方法),并允許控制ClassLoader。在具體的Web容器部署環(huán)境下(如:Tomcat),攻擊者利用 Web容器下的Java Class對象及其屬性參數(shù)(如:日志存儲(chǔ)參數(shù)),可向服務(wù)器發(fā)起遠(yuǎn)程代碼執(zhí)行攻擊,進(jìn)而植入網(wǎng)站后門控制網(wǎng)站服務(wù)器主機(jī)。

讓我們一起來回顧一下Struts縫縫補(bǔ)補(bǔ)的歷史(萬惡的正則表達(dá)式):

2007年1月:

dojo\..*

2008年6月:

dojo\..*,^struts\..*

2012年3月:


dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,parameters\...*

2013年10月:


^dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,^parameters\..*,^action:.*,^method:.*

2014年3月(S2-020):


^class\..*,^dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,^parameters\..*,^action:.*,^method:.*

漏洞詳情:Struts 2.3.15.1之前的版本,參數(shù)action的值redirect以及redirectAction沒有正確過濾,導(dǎo)致ognl代碼執(zhí)行。

修復(fù)方式:將 '^class\.*'添加到excludeParams列表內(nèi)

2014年4月……

從目前公布的信息來看,這個(gè)漏洞的局限性很高,利用范圍仍然有限。

目前官方在GitHub上對該問題做出了修正(臨時(shí))。

代碼修復(fù)詳情:

https://github.com/apache/struts/commit/aaf5a3010e3c11ae14e3d3c966a53ebab67146be#diff-710b29900cea21e85893cae43dd08c92

core/src/main/resources/struts-default.xml

-

^class\..*,^dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,^parameters\..*,^action:.*,^method:.*


+

(.*\.|^)class\..*,^dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,^parameters\..*,^action:.*,^method:.*

請注意多處都要修改。

在4月24日下午,又有同學(xué)貼出了終極修改方案:

修改struts源碼

com.opensymphony.xwork2.interceptor.ParametersInterceptor

將此處代碼:

 
 
 
 
  1. public void setExcludeParams(String commaDelim) {  
  2.       Collection excludePatterns = ArrayUtils.asCollection(commaDelim);  
  3.       if (excludePatterns != null) {  
  4.           excludeParams = new HashSet();  
  5.           for (String pattern : excludePatterns) {  
  6.               excludeParams.add(Pattern.compile(pattern));  
  7.           }  
  8.       }  
  9.   } 

修改為:

 
 
 
 
  1. public void setExcludeParams(String commaDelim) {  
  2.        Collection excludePatterns = ArrayUtils.asCollection(commaDelim);  
  3.        if (excludePatterns != null) {  
  4.            excludeParams = new HashSet();  
  5.            for (String pattern : excludePatterns) {  
  6.                excludeParams.add(Pattern.compile(pattern));  
  7.            }  
  8.        }  
  9.        //s021 zhenzheteng  
  10.        Pattern s021_1 = Pattern.compile("(.*\\.|^)class\\..*",Pattern.CASE_INSENSITIVE);  
  11.        Pattern s021_2 = Pattern.compile(".*'class&'.*",Pattern.CASE_INSENSITIVE);  
  12.        Pattern s021_3 = Pattern.compile("(.*\\.|^)class\\[.*",Pattern.CASE_INSENSITIVE);  
  13.        excludeParams.add(s021_1);  
  14.        excludeParams.add(s021_2);  
  15.        excludeParams.add(s021_3);  
  16.    } 

Struts歷史漏洞回顧:

S2-020: http://struts.apache.org/release/2.3.x/docs/s2-020.html

S2-019的遠(yuǎn)程代碼執(zhí)行漏洞: http://sebug.net/vuldb/ssvid-61048

S2-016官方補(bǔ)丁分析:http://www.freebuf.com/articles/web/11234.html

S2-013的漏洞分析:http://www.freebuf.com/vuls/9757.html

Struts2最近幾個(gè)漏洞分析&穩(wěn)定利用Payload: http://www.freebuf.com/articles/web/25337.html

希望Struts官方能在爆出漏洞的第一時(shí)間完美的堵上…..

另外關(guān)于S2-020:http://sec.baidu.com/index.php?research/detail/id/18

參考:

apache:http://struts.apache.org/release/2.3.x/docs/s2-020.html

cnvd:http://www.cnvd.org.cn/webinfo/show/3427

piyolog:http://d.hatena.ne.jp/Kango/20140417/139775019

scutum:http://www.scutum.jp/information/waf_tech_blog/2014/04/waf-blog-036.html

ipa.jp:http://www.ipa.go.jp/security/ciadr/vul/20140417-struts.html

空虛浪子心的博客:http://www.inbreak.net/

還有各路微博……


當(dāng)前名稱:Struts2再曝S2-020補(bǔ)丁繞過漏洞–萬惡的正則表達(dá)式
文章鏈接:http://www.dlmjj.cn/article/cdgdids.html