{"id":274,"date":"2011-05-09T10:07:57","date_gmt":"2011-05-09T02:07:57","guid":{"rendered":"http:\/\/inbreak.net\/?p=274"},"modified":"2011-05-09T10:19:15","modified_gmt":"2011-05-09T02:19:15","slug":"struts-2-2-3-dos%e6%bc%8f%e6%b4%9e","status":"publish","type":"post","link":"https:\/\/www.inbreak.net\/archives\/274.html","title":{"rendered":"Struts 2.2.3 DOS\u6f0f\u6d1e"},"content":{"rendered":"
By \u7a7a\u865a\u6d6a\u5b50\u5fc3 http:\/\/inbreak.net<\/p>\n
\u5728struts2\u548cwebwork\u4e2d\uff0c\u66fe\u51fa\u73b0\u4e86\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c\u6f0f\u6d1e\uff0c\u4f46\u662f\u540e\u6765\u56e0\u4e3a\u8865\u4e01\u4f1a\u5bfc\u81f4\u90e8\u5206\u5e94\u7528\u51fa\u73b0BUG\uff0c\u6240\u4ee5\u5b98\u65b9\u53c8\u7ed9\u51fa\u4e862\u6b21\u8865\u4e01\u3002\u8fd9\u6b21\u7684\u4fee\u8865\uff0c\u91cd\u65b0\u5f00\u542f\u4e00\u4e2a\u5c0f\u5c0f\u7684\u529f\u80fd\uff0c\u4e5f\u540c\u65f6\u5f00\u542f\u4e86\u4e00\u4e2a\u5fc5\u6740dos\u70b8\u5f39\u3002\u8fd9\u4e2a\u70b8\u5f39\u9700\u8981\u7ed3\u5408java\u6d6e\u70b9\u6f0f\u6d1e\u4f7f\u7528\u3002<\/p>\n
\u8be5\u6f0f\u6d1e\u4f1a\u8986\u76d6\u6240\u6709\u6700\u65b0\u7248\u672c\u7684struts2\uff1a
\n Struts 2.2.3 (GA)
\n Struts 2.0.14 (GA)
\n \u53ea\u6709\u6253\u4e86\u201cjava\u6d6e\u70b9\u6f0f\u6d1e\u5b98\u65b9\u8865\u4e01\u201d\uff0c\u624d\u80fd\u9003\u8fc7\u4e00\u52ab\u3002<\/p>\n
\u8fd9\u662f\u4f5c\u8005\u5bf9\u8be5\u6f0f\u6d1e\u7684\u4e00\u7bc7\u5206\u6790\u6587\uff1ahttp:\/\/inbreak.net\/archives\/212<\/a>\uff0c\u300aJava\u6d6e\u70b9\u503c\u62d2\u7edd\u670d\u52a1\u6f0f\u6d1e\u5371\u5bb3\u5206\u6790\u300b\uff0c\u540e\u6587\u4f1a\u7528\u5230\u3002<\/p>\n Struts2\u4e3a\u4e86\u4fee\u8865\u6f0f\u6d1e\uff0c\u9996\u5148\u63a8\u51fa\u4e86\u8865\u4e01\uff1a \u8fd9\u5bfc\u81f4\u5f00\u53d1\u4eba\u5458\u672c\u8eab\u5b9a\u4e49\u7684\u6570\u636e\u7c7b\u578bSet\uff0c\u672c\u6765\u53ef\u4ee5\u63d0\u4ea4<\/p>\n Persons(1).name=\u7a7a\u865a\u6d6a\u5b50\u5fc3<\/p>\n \u8d4b\u503c\u7684\uff0c\u6253\u4e86\u8fd9\u4e2a\u8865\u4e01\u540e\uff0c\u8fd9\u79cd\u7528\u6cd5\u76f4\u63a5\u88ab\u62e6\u622a\u4e86\u3002\u6240\u4ee5struts2\u5b98\u65b9\u4e5f\u610f\u8bc6\u5230\u8fd9\u4e2a\u8fd9\u4e2a\u8865\u4e01\u8fc7\u4e8e\u4e25\u683c\uff0c\u5bfc\u81f4\u6b63\u5e38\u4e1a\u52a1\u4e0d\u80fd\u901a\u884c\uff0c\u5fc5\u987b\u8981\u628a\u5706\u62ec\u53f7\u653e\u5f00\uff0c\u540c\u65f6\u5706\u62ec\u53f7\u4e5f\u4e0d\u4f1a\u91cd\u73b0\u6f0f\u6d1e\uff0c\u6240\u4ee5\u518d\u6b21\u8865\u4e01\uff1a \u6700\u65b0\u7248\u672c\u7684struts2\u4e5f\u662f\u8fd9\u6837\u7684\u4ee3\u7801\u3002\u4ece\u4f5c\u8005\u7684\u8c03\u67e5\u4e0a\u770b\uff0c\u5927\u591a\u6570\u5f00\u53d1\u90fd\u4e0d\u4f1a\u76f4\u63a5\u4f7f\u7528\u5b98\u65b9\u8865\u4e01\uff0c\u7279\u522b\u662f\u6709\u7ecf\u9a8c\u7684\u5f00\u53d1\uff0c\u4ed6\u4eec\u53ea\u4f1a\u8fc7\u6ee4\u6389\u8865\u4e01\u4e2d\u7684\u201cexp\u7279\u5f81\u7801\u201d\uff08\u5b98\u65b9\u8865\u4e01\u8bef\u6740\u592a\u591a\uff09\uff0c\u5141\u8bb8\u5c0f\u62ec\u53f7\u7684\u51fa\u73b0\u3002\u90a3\u4e48\u4e0d\u7ba1\u600e\u6837\uff0c\u73b0\u5728\u5141\u8bb8\u5c0f\u62ec\u53f7\u4e86\u3002<\/p>\n \u770b\u8fc7\u6211\u5206\u6790struts2\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c\u6587\u7ae0\u7684\u540c\u5b66\u4eec\uff08http:\/\/inbreak.net\/archives\/167\uff09\uff0c\u90fd\u77e5\u9053\u8fd9\u4e2a\u6f0f\u6d1e\u548cognl\u7684\u5173\u7cfb\uff0c\u672c\u6587\u4e0d\u518d\u53d9\u8ff0\uff0c\u53ea\u662f\u5f15\u7528\u4e00\u7bc7OGNL\u5b98\u65b9\u6587\u7ed9\u5927\u5bb6\u770b\uff1a<\/p>\n http:\/\/www.opensymphony.com\/ognl\/html\/LanguageGuide\/constructors.html<\/p>\n OGNL\u7684LanguageGuide\u4e2d\uff0c\u5199\u660e\u81ea\u5df1\u662f\u5141\u8bb8\u201cnew Object\u201d\u7684\uff0c\u800cOGNL\u7684\u4ee3\u7801\uff0c\u5b9e\u9645\u610f\u4e49\u4e0a\uff0c\u662f\u5148\u7f16\u8bd1\uff0c\u540e\u6267\u884c\u3002\u5c31\u662f\u8bf4\uff0c\u6211\u4eec\u63d0\u4ea4\u4e86\u4e00\u4e2aognl\u8bed\u53e5\u540e\uff0c\u5f15\u64ce\u4f1a\u8d1f\u8d23\u8f6c\u6362\u4e3ajava\u4ee3\u7801\uff0c\u4e4b\u540e\u7f16\u8bd1\u3001\u6267\u884c\u3002\u6ce8\u610f\uff0c\u524d\u6587\u63d0\u5230\u4e86\u201c\u7f16\u8bd1\u201d\u8fd9\u4e2a\u8bcd\u3002<\/p>\n \u90a3\u4e48\u518d\u6b21\u5f15\u7528\u4e0a\u4e00\u7bc7\u6587\u7ae0\u7684\u8bdd\uff1a \u90a3\u65f6\u7684\u4f5c\u8005\uff0c\u5176\u5b9e\u4e5f\u53d1\u73b0\u4e86\u7f16\u8bd1\u7684\u6f0f\u6d1e\uff0c\u53ea\u662f\u4e0d\u613f\u610f\u53d1\u51fa\u6765\uff0c\u6240\u4ee5\u4f7f\u7528\u4e86\u201c\u800c\u7f16\u8bd1\u4e2d\u6302\u6389\uff0c\u51e0\u4e4e\u4e0d\u53ef\u80fd\u5b58\u5728\uff0c\u5f88\u96be\u6709\u6b63\u5e38\u7684\u4e1a\u52a1\u9700\u8981\u7528\u6237\u63d0\u4ea4\u4ee3\u7801\uff0c\u8ba9\u670d\u52a1\u5668\u7f16\u8bd1\u6267\u884c\u3002\u201d\u8fd9\u6837\u7684\u8bdd\u6765\u8bef\u5bfc\u5927\u5bb6\u3002\u5177\u4f53\u539f\u56e0\u5927\u5bb6\u61c2\u5f97\u3002<\/p>\n \u63d0\u9192\u8fc7\u5927\u5bb6\uff0c\u4f1a\u6709\u66f4\u52a0\u76f4\u63a5\u7684\u5229\u7528\u53d1\u51fa\u6765\u7684\u3002\u4e0a\u6b21\u8bb2\u8fc7\uff0c\u53ea\u8981action\u7684\u65b9\u6cd5\u4e2d\uff0c\u5b58\u5728DOUBLE\u7c7b\u578b\u7684\u5c5e\u6027\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u653b\u51fb\uff0c\u5229\u7528\u7684\u662f\u201c\u8fd0\u884c\u65f6\u6302\u6389\u201d\u539f\u7406\u3002<\/p>\n \u5728ognl\u8bed\u53e5\u4e2d\uff0c\u6267\u884c\u201cnew Double(2.2250738585072012e-308)\u201d\uff0c\u5c31\u4f1a\u76f4\u63a5\u5728\u7f16\u8bd1\u4e2d\u6302\u6389\uff0c\u73b0\u5728struts2\u5141\u8bb8\u7528\u6237\u63d0\u4ea4\u7528\u4e8e\u7f16\u8bd1\u7684\u4ee3\u7801\uff0c\u53c8\u5141\u8bb8\u4e86\u5c0f\u62ec\u53f7\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u63d0\u4ea4\uff1a<\/p>\n \u7ecf\u8fc7\u6d4b\u8bd5\uff0c\u53ef\u4ee5\u76f4\u63a5CPU\u8dd1\u6ee1\u4e86\u3002\u8bf7\u6ce8\u610f\u5b9e\u9645\u4e0a\u8fd9\u91cc\u7684\u201dnew java.lang.double\u201d\u6839\u672c\u6ca1\u6709\u771f\u7684\u201cnew\u201d\uff0c\u800c\u662f\u6302\u5728\u4e86\u7f16\u8bd1\u7684\u65f6\u5019\u3002<\/p>\n \u521a\u53d1\u90ae\u4ef6\uff0c\u5c31\u88abKJ\u725b\u9119\u89c6\u4e86\uff1a\u201c\u91cc\u9762\u6709\u77ed\u6a2a\u7ebf\u201d\uff0c\u4f1a\u88abstruts2\u8865\u4e01\u8fc7\u6ee4\u6389\u3002\u8fd8\u597d\uff0c\u4f5c\u8005\u590d\u4e60\u4e86\u4e00\u904d\u201c\u79d1\u5b66\u8ba1\u6570\u6cd5\u201d\uff0c\u7ed5\u8fc7\u4e86struts2\u7684\u8865\u4e01\u6267\u884c\uff0c\u624d\u6ca1\u6709\u4e22\u4eba\uff1a<\/p>\n \u8fd9\u6bb5\u4e1c\u897f\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5728eclipse\u4e2d\u8dd1\uff0c\u8bf7\u6d4b\u8bd5\u65f6\uff0c\u63d0\u524d\u6253\u5f00\u201c\u4efb\u52a1\u7ba1\u7406\u5668\u201d\uff0c\u4f60\u4f1a\u7528\u5230\u7684\u3002<\/p>\n \u5bf9\u8fd9\u79cd\u6570\u5b57\u8f6c\u6362\u5f62\u5f0f\uff0c\u4e0d\u61c2\u7684\u81ea\u5df1\u767e\u5ea6\u4e00\u4e0b\u201c0.xxxE-xx\u201d\u7684\u542b\u4e49\uff0c\u5b66\u4e60\u4e00\u4e0b\u201c\u79d1\u5b66\u8ba1\u6570\u6cd5\u201d\u3002\u6700\u7ec8\u6ca1\u6709\u201c\u77ed\u6a2a\u7ebf\u201d\u4e86\uff0c\u540c\u65f6\u4e5f\u628a\u6d4b\u8bd5\u73af\u5883\u8dd1\u6302\u3002<\/p>\n \u5982\u679c\u770b\u4e86\u4e0a\u4e00\u7bc7\u5206\u6790\u6587\uff0c\u4f60\u6ca1\u6709\u8001\u8001\u5b9e\u5b9e\u7684\u6253\u5b98\u65b9\u8865\u4e01\uff0c\u800c\u662f\u91c7\u7528\u4e86\u201cby pass exp\u7279\u5f81\u7801\u201d\u7684\u65b9\u6cd5\uff0c\u8fc7\u6ee4\u4e86\u5b57\u7b26\u4e32\u4e2d\u7684\u201c2.2250738\u201d,\u90a3\u4e48\u770b\u4e86\u8fd9\u4e32\u6570\u5b57\uff0c\u76f8\u4fe1\u4f60\u4f1a\u6bd4\u4f5c\u8005\u66f4\u6fc0\u52a8\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u5728struts2\u548cwebwork\u4e2d\uff0c\u66fe\u51fa\u73b0\u4e86\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c\u6f0f\u6d1e\uff0c\u4f46\u662f\u540e\u6765\u56e0\u4e3a\u8865\u4e01\u4f1a\u5bfc\u81f4\u90e8\u5206\u5e94\u7528\u51fa\u73b0BUG\uff0c\u6240\u4ee5\u5b98\u65b9\u53c8\u7ed9\u51fa\u4e862\u6b21\u8865\u4e01\u3002\u4f46\u662f\u8fd9\u6b21\u7684\u4fee\u8865\uff0c\u91cd\u65b0\u5f00\u542f\u4e00\u4e2a\u5c0f\u5c0f\u7684\u529f\u80fd\uff0c\u4e5f\u540c\u65f6\u5f00\u542f\u4e86\u4e00\u4e2a\u5fc5\u6740dos\u70b8\u5f39\u3002\u8fd9\u4e2a\u70b8\u5f39\u9700\u8981\u7ed3\u5408java\u6d6e\u70b9\u6f0f\u6d1e\u4f7f\u7528\u3002<\/p>\n
\n
\n private String acceptedParamNames = \"[a-zA-Z0-9\\\\.\\\\]\\\\[_'\\\\s]+\";
\n<\/code>
\n \u53ea\u5141\u8bb8\u201c\u5b57\u6bcd\u3001\u6570\u5b57\u3001.\u3001[\u3001]\u3001_\u3001\u2019\u3001\u7a7a\u683c\u201d\u51fa\u73b0\u5728\u53c2\u6570\u540d\u79f0\u4e2d\uff0c\u7136\u800c\u8fd9\u4e2a\u9650\u5236\uff0c
\n \u4e5f\u540c\u65f6\u76f4\u63a5\u7981\u6b62\u4e86(\u5f15\u81ea
\nhttp:\/\/www.sunxin.org\/forum\/thread\/19682.html<\/a>)\uff1a
\n<\/a><\/p>\n
\n http:\/\/svn.apache.org\/viewvc\/struts\/struts2\/trunk\/xwork-core\/src\/main\/java\/com\/opensymphony\/xwork2\/interceptor\/ParametersInterceptor.java?r1=956389&r2=956397&diff_format=h<\/p>\n
\n private String acceptedParamNames = \"[a-zA-Z0-9\\\\.\\\\]\\\\[\\\\(\\\\)_'\\\\s]+\";
\n<\/code><\/p>\n
\n
\n \u8fd9\u6bb5\u4ee3\u7801\u4f1a\u5728\u7f16\u8bd1\u65f6\u6302\u6389\uff1a
\n double d = 2.2250738585072012e-308;
\n \u8fd9\u6bb5\u4ee3\u7801\u4f1a\u5728\u8fd0\u884c\u65f6\u6302\u6389\uff1a
\n double d = Double.parseDouble(\u201c2.2250738585072012e-308\u2033);
\n<\/code><\/p>\n
\n http:\/\/inbreak.net\/app\/secTest.action?new java.lang.Double(2.2250738585072012e-308)
\n<\/code><\/p>\n
\n http:\/\/inbreak.net\/app\/secTest.action?(new java.lang.Double(0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022250738585072012))
\n<\/code><\/p>\n