{"id":48407,"date":"2017-03-15T18:29:40","date_gmt":"2017-03-15T10:29:40","guid":{"rendered":"https:\/\/blog.trendmicro.com.tw\/?p=48407"},"modified":"2017-03-15T18:29:40","modified_gmt":"2017-03-15T10:29:40","slug":"cve-2017-5638%ef%bc%9aapache-struts-2-%e6%bc%8f%e6%b4%9e%e5%8f%af%e8%83%bd%e8%ae%93%e9%a7%ad%e5%ae%a2%e5%be%9e%e9%81%a0%e7%ab%af%e5%9f%b7%e8%a1%8c%e7%a8%8b%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/blog.trendmicro.com.tw\/?p=48407","title":{"rendered":"CVE-2017-5638\uff1aApache Struts 2 \u6f0f\u6d1e\u53ef\u80fd\u8b93\u99ed\u5ba2\u5f9e\u9060\u7aef\u57f7\u884c\u7a0b\u5f0f"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full alignleft\" src=\"https:\/\/blog.trendmicro.com\/trendlabs-security-intelligence\/files\/2016\/04\/Vulnerability04-200x200.jpg\" width=\"200\" height=\"200\" \/><\/p>\n<p>Apache Struts \u662f\u4e00\u500b\u514d\u8cbb\u7684\u958b\u653e\u539f\u59cb\u78bc\u7a0b\u5f0f\u958b\u767c\u67b6\u69cb\uff0c\u7528\u4f86\u958b\u767c Java \u7db2\u7ad9\u61c9\u7528\u7a0b\u5f0f\u3002\u6211\u5011\u4ed4\u7d30\u7814\u7a76\u4e86\u904e\u53bb Apache Struts \u88ab\u767c\u73fe\u7684\u5e7e\u500b\u9060\u7aef\u7a0b\u5f0f\u78bc\u57f7\u884c (Remote Code Execution\uff0c\u7c21\u7a31 RCE) \u6f0f\u6d1e\u4e4b\u5f8c\u767c\u73fe\uff0c\u6b79\u5f92\u5927\u591a\u4f7f\u7528 Object Graph Navigation Language (OGNL) \u9019\u500b\u7a0b\u5f0f\u8a9e\u8a00\u3002OGNL \u4e4b\u6240\u4ee5\u5f88\u5bb9\u6613\u8b93\u99ed\u5ba2\u5f9e\u9060\u7aef\u57f7\u884c\u4efb\u610f\u7684\u7a0b\u5f0f\u78bc\uff0c\u662f\u56e0\u70ba Apache Struts \u5728\u5927\u591a\u6578\u7684\u6d41\u7a0b\u7576\u4e2d\u90fd\u7528\u5230\u9019\u500b\u8a9e\u8a00\u3002<\/p>\n<p>\u6700\u8fd1\uff0c\u4e00\u4f4d<a href=\"https:\/\/github.com\/tengzhangchao\">\u7814\u7a76\u4eba\u54e1<\/a>\u5728 Apache Struts 2 \u7576\u4e2d\u65b0\u767c\u73fe\u4e00\u500b\u95dc\u65bc OGNL \u7684\u9060\u7aef\u7a0b\u5f0f\u78bc\u57f7\u884c\u6f0f\u6d1e\uff1aCVE-2017-5638\u3002\u6b64\u5916\uff0c\u4e00\u4efd<a href=\"https:\/\/www.theregister.co.uk\/2017\/03\/09\/apache_under_attack_patch_for_zero_day_available\/\">\u5831\u544a<\/a>\u4e5f\u6307\u51fa\u7db2\u8def\u4e0a\u5df2\u51fa\u73fe\u5be6\u969b\u7684\u6f0f\u6d1e\u653b\u64ca\u6848\u4f8b\uff0c\u6211\u5011\u7684\u7814\u7a76\u548c\u76e3\u63a7\u5718\u968a\u4e5f\u898b\u904e\u5229\u7528\u8a72\u6f0f\u6d1e\u7684\u653b\u64ca\u3002<\/p>\n<p><strong><em>\u653b\u64ca\u624b\u6cd5<\/em><\/strong><\/p>\n<p>\u99ed\u5ba2\u53ef\u4ee5\u767c\u9001\u4e00\u500b\u7cbe\u5fc3\u8a2d\u8a08\u7684\u7db2\u7ad9\u8acb\u6c42\u7d66\u542b\u6709\u6f0f\u6d1e\u7684\u4f3a\u670d\u5668\uff0c\u5c31\u80fd\u5c07\u4e00\u500b\u6a94\u6848\u4e0a\u50b3\u81f3\u4f7f\u7528 Jakarta \u5916\u639b\u6a21\u7d44\u4f86\u8655\u7406\u6a94\u6848\u4e0a\u50b3\u8acb\u6c42\u7684\u4f3a\u670d\u5668\u3002<\/p>\n<p>\u99ed\u5ba2\u63a5\u8457\u5728 Content-Type \u6a19\u982d\u7576\u4e2d\u5305\u542b\u6240\u8981\u57f7\u884c\u7684\u6307\u4ee4\u4f86\u8b93\u53d7\u5bb3\u7684\u4f3a\u670d\u5668\u57f7\u884c\u6307\u4ee4\u3002\u7db2\u8def\u4e0a\u5df2\u7d93\u51fa\u73fe\u793a\u7bc4\u9019\u9805\u653b\u64ca\u624b\u6cd5\u7684<a href=\"https:\/\/github.com\/tengzhangchao\/Struts2_045-Poc\">\u6982\u5ff5\u9a57\u8b49<\/a>\u3002<\/p>\n<p><strong><em>\u6f0f\u6d1e\u5206\u6790<\/em><\/strong><\/p>\n<p>\u70ba\u4e86\u6df1\u5165\u4e86\u89e3\u9019\u9805\u6f0f\u6d1e\uff0c\u6211\u5011\u4ed4\u7d30\u7814\u7a76\u4e86\u4e00\u4e0b\u8a72\u6f0f\u6d1e\u7684<a href=\"https:\/\/git-wip-us.apache.org\/repos\/asf?p=struts.git;a=commitdiff;h=6b8272ce47160036ed120a48345d9aa884477228\">\u4fee\u88dc\u7a0b\u5f0f<\/a>\uff0c\u6211\u5011\u767c\u73fe\u5ee0\u5546\u5728 <a href=\"https:\/\/git-wip-us.apache.org\/repos\/asf?p=struts.git;a=blob;f=core\/src\/main\/java\/org\/apache\/struts2\/interceptor\/FileUploadInterceptor.java;h=b9f5cb6f5adc52f9a23b955a2d864d2fde5471a1\"><em>FileUploadInterceptor.java<\/em><\/a> \u7576\u4e2d\u5df2\u653e\u68c4\u4f7f\u7528\u300c<em>LocalizedTextUtil<\/em>\u300d\u9019\u500b\u985e\u5225\u3002\u6b64\u985e\u5225\u539f\u672c\u662f\u7528\u4f86\u5728 HTTP \u6a94\u6848\u4e0a\u50b3\u8acb\u6c42\u5931\u6557\u6642\u63d0\u4f9b\u932f\u8aa4\u8a0a\u606f\u7d66\u4f7f\u7528\u8005\u3002<!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full\" src=\"https:\/\/blog.trendmicro.com\/trendlabs-security-intelligence\/files\/2017\/03\/CVE-2017-5638-1.jpg\" width=\"1113\" height=\"274\" \/><\/p>\n<p><em>\u5716 1\uff1a<\/em><a href=\"https:\/\/git-wip-us.apache.org\/repos\/asf?p=struts.git;a=commitdiff;h=6b8272ce47160036ed120a48345d9aa884477228\"><em>\u4fee\u88dc\u7a0b\u5f0f\u4fee\u6539\u4e4b\u8655<\/em><\/a>\u3002<\/p>\n<p>\u70ba\u4e86\u63d0\u4f9b\u9069\u7576\u7684\u932f\u8aa4\u8a0a\u606f\uff0c\u7a0b\u5f0f\u4f7f\u7528\u4e86\u300c<em>LocalizedTextUtil<\/em> \u300d\u7576\u4e2d\u6240\u5b9a\u7fa9\u7684\u300c<em>findText<\/em>\u300d\u51fd\u5f0f\u4f86\u53d6\u5f97<a href=\"https:\/\/cwiki.apache.org\/confluence\/display\/WW\/File+Upload#FileUpload-AlternateLibraries\">\u9810\u5148\u5b9a\u7fa9\u7684\u932f\u8aa4\u8a0a\u606f<\/a>\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full\" src=\"https:\/\/blog.trendmicro.com\/trendlabs-security-intelligence\/files\/2017\/03\/CVE-2017-5638-2.jpg\" width=\"1001\" height=\"240\" \/><\/p>\n<p><em>\u5716 2\uff1aApache Struts \u6a94\u6848\u4e0a\u50b3\u529f\u80fd<a href=\"https:\/\/cwiki.apache.org\/confluence\/display\/WW\/File+Upload#FileUpload-AlternateLibraries\">\u9810\u5148\u5b9a\u7fa9\u7684\u932f\u8aa4\u8a0a\u606f<\/a>\u3002<\/em><\/p>\n<p><em>findText <\/em>\u51fd\u5f0f\u7684\u5b9a\u7fa9\u5982\u4e0b\uff1a<\/p>\n<p>public static\u00a0<a href=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/lang\/String.html?is-external=true\">String<\/a>\u00a0findText(<a href=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/lang\/Class.html?is-external=true\">Class<\/a>\u00a0aClass, <a href=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/lang\/String.html?is-external=true\">String<\/a>\u00a0aTextName,<br \/>\n<a href=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/util\/Locale.html?is-external=true\">Locale<\/a>\u00a0locale, <a href=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/lang\/String.html?is-external=true\">String<\/a>\u00a0defaultMessage, <a href=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/lang\/Object.html?is-external=true\">Object<\/a>[]\u00a0args )<\/p>\n<p>\u6b64\u51fd\u5f0f\u6703\u641c\u5c0b\u5132\u5b58\u5728\u672c\u5730\u7aef\u7684\u8a0a\u606f\u6587\u5b57\u4f86\u5c0d\u61c9\u51fd\u5f0f\u53c3\u6578\u6240\u50b3\u5165\u7684\u300c<em>aTextName<\/em>\u300d\u932f\u8aa4\u4ee3\u78bc\u3002\u6b64\u51fd\u6578\u7684\u53c3\u6578\u5982\u4e0b\uff1a<\/p>\n<p><em>aClass<\/em>\uff1a<em>FileUploadInterceptor<\/em> \u50b3\u5165\u6b64\u985e\u5225\u4f86\u6307\u5b9a\u932f\u8aa4\u8a0a\u606f\u641c\u5c0b\u7684\u8d77\u59cb\u9ede\u3002<\/p>\n<p><em>aTextName<\/em>\uff1a\u932f\u8aa4\u4ee3\u78bc\uff0c\u7528\u4f86\u5c0b\u627e\u5c0d\u61c9\u7684\u932f\u8aa4\u8a0a\u606f\u3002<\/p>\n<p><em>Locale<\/em>\uff1a\u6307\u5b9a\u8981\u8b80\u53d6\u54ea\u500b\u5730\u5340\u6240\u5c0d\u61c9\u7684\u932f\u8aa4\u8a0a\u606f\u3002<\/p>\n<p><em>defaultMessage<\/em>\uff1a\u5982\u679c\u627e\u4e0d\u5230\u5c0d\u61c9\u7684\u8a0a\u606f\u6587\u5b57\uff0c\u5373\u50b3\u56de\u6b64\u9810\u8a2d\u8a0a\u606f\u3002<\/p>\n<p><em>args<\/em>\uff1a\u932f\u8aa4\u53c3\u6578\u7684\u8cc7\u6e90\u5305 (resource bundle)\u3002<\/p>\n<p>\u5982\u679c\u7a0b\u5f0f\u627e\u5230\u5c0d\u61c9\u7684\u8a0a\u606f\uff0c\u5c31\u6703\u7576\u6210\u4e00\u500b OGNL \u6558\u8ff0\u4f86\u8655\u7406\u3002\u56e0\u6b64\uff0c\u5982\u679c\u99ed\u5ba2\u5728 Content-Type \u6a19\u982d\u4e2d\u50b3\u905e OGNL \u6558\u8ff0\u6642\u6307\u5b9a\u4e86\u300cmultipart\/form-data\u300d\u5c6c\u6027\uff0c\u7a0b\u5f0f\u5c31\u6703\u8655\u7406\u4e26\u8b93\u99ed\u5ba2\u6709\u6a5f\u6703\u5f9e\u9060\u7aef\u57f7\u884c\u4efb\u610f\u7a0b\u5f0f\u78bc\u3002<\/p>\n<p>\u70ba\u4e86\u4fee\u6b63\u6b64\u554f\u984c\uff0c\u5ee0\u5546\u653e\u68c4\u4f7f\u7528\u300c<em>LocalizedTextUtil<\/em>\u300d\u985e\u5225\u4ee5\u53ca\u53ef\u80fd\u8b93\u99ed\u5ba2\u7528\u4f86\u8f38\u51fa\u57f7\u884c\u7d50\u679c\u7684\u300c<em>java.io.File<\/em>\u300d\u985e\u5225\u3002<\/p>\n<p>\u6839\u64da<a href=\"https:\/\/cwiki.apache.org\/confluence\/display\/WW\/S2-045?from=timeline&amp;isappinstalled=0\">\u5831\u544a<\/a>\uff0c\u5305\u62ec Struts 2.3.5 \u81f3 Struts 2.3.31 \u4ee5\u53ca Struts 2.5 \u81f3 \u00a0Struts 2.5.10 \u7684 Apache Struts \u7248\u672c\u90fd\u53d7\u5230\u5f71\u97ff\u3002\u82e5\u60a8\u6b63\u5728\u4f7f\u7528 Jakarta \u505a\u70ba\u6a94\u6848\u4e0a\u50b3\u7684 Multipart \u8655\u7406\u6a21\u7d44\uff0c\u5efa\u8b70\u60a8\u5347\u7d1a\u81f3 Apache Struts 2.3.32 \u6216 2.5.10.1 \u7248\u3002\u7576\u7136\u60a8\u4e5f\u53ef\u4ee5\u6539\u7528\u00a0<a href=\"https:\/\/cwiki.apache.org\/confluence\/display\/WW\/File+Upload#FileUpload-AlternateLibraries\">\u5176\u4ed6\u7684<\/a>\u00a0 Multipart \u8655\u7406\u6a21\u7d44\u3002<\/p>\n<ul>\n<li><strong><em>\u8da8\u52e2\u79d1\u6280\u89e3\u6c7a\u65b9\u6848\u00a0<\/em><\/strong>\n<p><a href=\"https:\/\/t.rend.tw\/?i=Mzc4MQ\">\u8da8\u52e2\u79d1\u6280Deep Security<\/a> \u548c \u00a0<a href=\"https:\/\/www.trendmicro.tw\/tw\/enterprise\/product-security\/vulnerability-protection\/\">\u8da8\u52e2\u79d1\u6280 Vulnerability Protection \u6f0f\u6d1e\u9632\u8b77<\/a>\u00a0 \u90fd\u80fd\u900f\u904e\u00a0<a href=\"https:\/\/www.trendmicro.com\/us\/enterprise\/product-security\/vulnerability-protection\/\">\u865b\u64ec\u4fee\u88dc<\/a>\u00a0\u4f86\u9632\u6b62\u7aef\u9ede\u88dd\u7f6e\u906d\u5230\u6b64\u6f0f\u6d1e\u7684\u5a01\u8105\u3002<a href=\"https:\/\/t.rend.tw\/?i=Mzk3OQ==\">\u8da8\u52e2\u79d1\u6280 OfficeScan\u2122\u00a0<\/a> \u7684\u6f0f\u6d1e\u9632\u8b77\u529f\u80fd\uff0c\u4e5f\u80fd\u5728\u4fee\u88dc\u7a0b\u5f0f\u90e8\u7f72\u4e4b\u524d\u9632\u6b62\u7aef\u9ede\u88dd\u7f6e\u906d\u5230\u5df2\u77e5\u53ca\u672a\u77e5\u7684\u6f0f\u6d1e\u653b\u64ca\u3002<a href=\"https:\/\/www.trendmicro.tw\/tw\/enterprise\/security-risk-management\/deep-discovery\/\">Deep Discovery<\/a> \u80fd\u5920\u5075\u6e2c\u3001\u6df1\u5165\u5206\u6790\u4e26\u4e3b\u52d5\u56de\u61c9\u6f0f\u6d1e\u653b\u64ca\u4ee5\u53ca\u5176\u4ed6\u985e\u4f3c\u5a01\u8105\uff0c\u5229\u7528\u7279\u6b8a\u7684\u5f15\u64ce\u3001\u5ba2\u88fd\u5316\u00a0<a href=\"https:\/\/blog.trendmicro.com\/trendlabs-security-intelligence\/deploying-a-smart-sandbox-for-unknown-threats-and-zero-day-attacks\/\">\u6c99\u76d2\u6a21\u64ec\u5206\u6790<\/a>\u4ee5\u53ca\u5bc6\u5207\u7684\u4ea4\u53c9\u95dc\u806f\u5206\u6790\uff0c\u5b8c\u6574\u6db5\u84cb\u7db2\u8def\u653b\u64ca\u7684\u6240\u6709\u968e\u6bb5\uff0c\u751a\u81f3\u4e0d\u9808\u66f4\u65b0\u5f15\u64ce\u6216\u75c5\u6bd2\u78bc\u5c31\u80fd\u5075\u6e2c\u9019\u985e\u653b\u64ca\u3002<\/p>\n<p>Deep Security\u2122 \u53ef\u5229\u7528\u4e0b\u5217\u6df1\u5c64\u5c01\u5305\u6aa2\u67e5 (DPI) \u898f\u5247\u4f86\u9632\u6b62\u5229\u7528\u524d\u8ff0\u6f0f\u6d1e\u7684\u5a01\u8105\uff1a<\/p>\n<ul>\n<li>1008207 \u2013 Apache Struts2 Remote Code Execution Vulnerability (CVE-2017-5638)<\/li>\n<\/ul>\n<p>Deep Discovery Inspector \u5ba2\u6236\u53ef\u900f\u904e\u4ee5\u4e0b DDI \u898f\u5247\u4f86\u9632\u7bc4\u9019\u9805\u5a01\u8105\uff1a<\/p>\n<ul>\n<li>Beta Rule ID: 3421 \u2013 CVE-2017-5638_HTTP_APACHESTRUTS_EXPLOIT<\/li>\n<\/ul>\n<p>TippingPoint \u5ba2\u6236\u53ef\u5229\u7528\u4ee5\u4e0b Custom Shield Writer (CSW) \u548c MainlineDV \u904e\u6ffe\u898f\u5247\u4f86\u9632\u7bc4\u9019\u9805\u5a01\u8105\uff1a<\/p>\n<ul>\n<li>CSW: HTTP: Apache Struts Content-type Command Injection Vulnerability (CVE-2017-5638)<\/li>\n<li>27410: HTTP: Apache Struts Content-type Command Injection Vulnerability (CVE-2017-5638)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u539f\u6587\u51fa\u8655\uff1a<a href=\"https:\/\/blog.trendmicro.com\/trendlabs-security-intelligence\/cve-2017-5638-apache-struts-vulnerability-remote-code-execution\/\">CVE-2017-5638: Apache Struts 2 Vulnerability Leads to Remote Code Execution<\/a>\u00a0\u4f5c\u8005\uff1a<a href=\"https:\/\/blog.trendmicro.com\/trendlabs-security-intelligence\/author\/surajs\/\">Suraj Sahu (\u6f0f\u6d1e\u7814\u7a76\u5de5\u7a0b\u5e2b)<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Apache Struts \u662f\u4e00\u500b\u514d\u8cbb\u7684\u958b\u653e\u539f\u59cb\u78bc\u7a0b\u5f0f\u958b\u767c\u67b6\u69cb\uff0c\u7528\u4f86\u958b\u767c Java \u7db2\u7ad9\u61c9\u7528\u7a0b\u5f0f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wpscppro_dont_share_socialmedia":false,"_wpscppro_custom_social_share_image":0,"_facebook_share_type":"","_twitter_share_type":"","_linkedin_share_type":"","_pinterest_share_type":"","_linkedin_share_type_page":"","_instagram_share_type":"","_medium_share_type":"","_threads_share_type":"","_google_business_share_type":"","_selected_social_profile":[],"_wpsp_enable_custom_social_template":false,"_wpsp_social_scheduling":{"enabled":false,"datetime":null,"platforms":[],"status":"template_only","dateOption":"today","timeOption":"now","customDays":"","customHours":"","customDate":"","customTime":"","schedulingType":"absolute"},"_wpsp_active_default_template":true},"categories":[156],"tags":[2292],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.trendmicro.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/48407"}],"collection":[{"href":"https:\/\/blog.trendmicro.com.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.trendmicro.com.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.trendmicro.com.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.trendmicro.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=48407"}],"version-history":[{"count":0,"href":"https:\/\/blog.trendmicro.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/48407\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.trendmicro.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=48407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.trendmicro.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=48407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.trendmicro.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=48407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}