{"id":8267,"date":"2024-06-05T13:59:46","date_gmt":"2024-06-05T05:59:46","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=8267"},"modified":"2024-06-05T14:00:05","modified_gmt":"2024-06-05T06:00:05","slug":"fastjson-%e6%bc%8f%e6%b4%9e%e4%bf%ae%e5%a4%8d%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=8267","title":{"rendered":"fastjson \u6f0f\u6d1e\u4fee\u590d\u8bf4\u660e"},"content":{"rendered":"<h2>\u4e00\u3001\u6f0f\u6d1e\u63cf\u8ff0\uff1a<\/h2>\n<p>\u8fd1\u65e5\uff0cFastjson Develop Team\u53d1\u5e03\u5b89\u5168\u516c\u544a\uff0c\u4fee\u590d\u4e86\u4e00\u4e2a\u5b58\u5728\u4e8eFastjson1.2.80\u53ca\u4e4b\u524d\u7248\u672c\u4e2d\u7684\u53cd\u5e8f\u5217\u5316\u6f0f\u6d1e\u3002<\/p>\n<p>Fastjson\u5df2\u4f7f\u7528\u9ed1\u767d\u540d\u5355\u7528\u4e8e\u9632\u5fa1\u53cd\u5e8f\u5217\u5316\u6f0f\u6d1e\uff0c\u8be5\u5229\u7528\u5728\u7279\u5b9a\u6761\u4ef6\u4e0b\u53ef\u7ed5\u8fc7\u9ed8\u8ba4autoType\u5173\u95ed\u9650\u5236\uff0c\u653b\u51fb\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u98ce\u9669\u5f71\u54cd\u8f83\u5927\u3002\u5728\u9ed8\u8ba4\u914d\u7f6e\u4e0b\uff0c\u5f53\u5e94\u7528\u6216\u7cfb\u7edf\u4f7f\u7528Fastjson\u5bf9\u7531\u7528\u6237\u53ef\u63a7\u7684JSON\u5b57\u7b26\u4e32\u8fdb\u884c\u89e3\u6790\u65f6\uff0c\u5c06\u53ef\u80fd\u5bfc\u81f4\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c\u7684\u5371\u5bb3 \u3002\u5efa\u8baeFastjson\u7528\u6237\u5c3d\u5feb\u91c7\u53d6\u5b89\u5168\u63aa\u65bd\u4fdd\u969c\u7cfb\u7edf\u5b89\u5168\u3002<\/p>\n<p>Fastjson\u662f\u963f\u91cc\u5df4\u5df4\u7684\u5f00\u6e90JSON\u89e3\u6790\u5e93\uff0c\u5b83\u53ef\u4ee5\u89e3\u6790JSON\u683c\u5f0f\u7684\u5b57\u7b26\u4e32\uff0c\u652f\u6301\u5c06Java Bean\u5e8f\u5217\u5316\u4e3aJSON\u5b57\u7b26\u4e32\uff0c\u4e5f\u53ef\u4ee5\u4eceJSON\u5b57\u7b26\u4e32\u53cd\u5e8f\u5217\u5316\u5230JavaBean\u3002<\/p>\n<h2>\u4e8c\u3001\u53d7\u5f71\u54cd\u7684\u7248\u672c<\/h2>\n<p>\u7279\u5b9a\u4f9d\u8d56\u5b58\u5728\u4e0b\u5f71\u54cd \u22641.2.80<\/p>\n<p>\u53d7\u5f71\u54cd\u7684TDH\u7ec4\u4ef6\u6709\uff1ainceptor\/slipstream\/tbak\/manager<\/p>\n<h2>\u4e09\u3001Inceptor\/Slipstream\u7ec4\u4ef6\u4fee\u590d\u65b9\u6848<\/h2>\n<h3>\u65b9\u6848\u4e00\uff1a\u6253\u5f00SafeMode\u52a0\u56fa\u529f\u80fd<\/h3>\n<p>\u57281.2.68\u4e4b\u540e\u7684\u7248\u672c\uff0c\u57281.2.68\u7248\u672c\u4e2d\uff0cfastjson\u589e\u52a0\u4e86safeMode\u7684\u652f\u6301\u3002safeMode\u6253\u5f00\u540e\uff0c\u5b8c\u5168\u7981\u7528autoType\u3002\u6240\u6709\u7684\u5b89\u5168\u4fee\u590d\u7248\u672csec10\u4e5f\u652f\u6301SafeMode\u914d\u7f6e\u3002<\/p>\n<p>\u6709\u4e09\u79cd\u65b9\u5f0f\u914d\u7f6eSafeMode\uff0c\u53c2\u8003 <a href=\"https:\/\/github.com\/alibaba\/fastjson\/wiki\/fastjson_safemode\">https:\/\/github.com\/alibaba\/fastjson\/wiki\/fastjson_safemode<\/a><\/p>\n<h4>1. \u5728\u4ee3\u7801\u4e2d\u914d\u7f6e<\/h4>\n<pre><code class=\"language-java\">ParserConfig.getGlobalInstance().setSafeMode(true);<\/code><\/pre>\n<p>\u6ce8\u610f\uff0c\u5982\u679c\u4f7f\u7528new ParserConfig\u7684\u65b9\u5f0f\uff0c\u9700\u8981\u6ce8\u610f\u5355\u4f8b\u5904\u7406\uff0c\u5426\u5219\u4f1a\u5bfc\u81f4\u4f4e\u6027\u80fdfull gc\u3002<\/p>\n<h4>2. \u52a0\u4e0aJVM\u542f\u52a8\u53c2\u6570<\/h4>\n<pre><code class=\"language-java\">-Dfastjson.parser.safeMode=true<\/code><\/pre>\n<h4>3. \u901a\u8fc7fastjson.properties\u6587\u4ef6\u914d\u7f6e\u3002<\/h4>\n<p>\u901a\u8fc7\u7c7b\u8def\u5f84\u7684fastjson.properties\u6587\u4ef6\u6765\u914d\u7f6e\uff0c\u914d\u7f6e\u65b9\u5f0f\u5982\u4e0b\uff1a<\/p>\n<p><code>fastjson.parser.safeMode=true<\/code><\/p>\n<p><font color=red><strong>\u8fd9\u91cc\uff0c\u6211\u4eec\u9488\u5bf9inceptor\u6216\u8005slipstream\u7ec4\u4ef6\uff0c\u53ef\u4ee5\u53c2\u8003\u65b9\u5f0f2\uff0c\u901a\u8fc7\u4fee\u6539\u53c2\u6570\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\uff1a<\/strong><\/font><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/05\/image-1653464036856.png\" alt=\"file\" \/><\/p>\n<ol>\n<li>\u4fee\u6539 <code>EXTRA_DRIVER_OPTS<\/code> \u548c <code>EXTRA_EXECUTOR_OPTS<\/code> \u8fd9\u4e24\u4e2a\u53c2\u6570\uff0c\u6dfb\u52a0 <code>-Dfastjson.parser.safeMode=true<\/code> \uff08\u591a\u4e2a\u53c2\u6570\u4e4b\u95f4\u901a\u8fc7\u7a7a\u683c\u62fc\u63a5\uff09<\/li>\n<li>\u53f3\u4e0a\u89d2\uff0c\u914d\u7f6e\u670d\u52a1<\/li>\n<li>\u91cd\u542finceptor\/slipstream<\/li>\n<\/ol>\n<h3>\u65b9\u6848\u4e8c\uff1a\u66f4\u6362inceptor\/inceptor \u955c\u50cf\u4e2d\u7684jar\u5305\uff0c\u5347\u7ea7\u5230\u6700\u65b0\u7248\u672c1.2.83<\/h3>\n<p><font color=red><strong>\u5982\u679c\u68c0\u67e5\u53d1\u73b0inceptor\/inceptor \u955c\u50cf\u4e2d\u7684fastjson jar\u5305 \u7248\u672c&lt; 1.2.68\uff0c\u6b64\u65f6 &lt;\u65b9\u6848\u4e00&gt; \u5c31\u884c\u4e0d\u901a\u4e86\uff0c\u9700\u8981\u901a\u8fc7\u6362\u5305\u7684\u65b9\u5f0f\u8fdb\u884c\u4fee\u590d\u3002<\/strong><\/font><\/p>\n<p>\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u5220\u9664\u955c\u50cf\u5185 <code>\/usr\/lib\/inceptor\/lib\/fastjson-1.2.XX.jar<\/code><\/li>\n<li>\u66ff\u6362\u4e0a\u9644\u4ef6\u76841.2.83\u7248\u672c\u7684 <code>fastjson-1.2.83.jar<\/code><br \/>\n\u8be5\u6b65\u9aa4\u9700\u8981\u5bf9 inceptor \u548c slipstream \u955c\u50cf\u505a\u6301\u4e45\u5316\uff08\u5982\u679c inceptor \u548c slipstream \u5e76\u975e\u4f7f\u7528\u4e00\u4e2a\u955c\u50cf\uff0c\u5219\u9700\u8981\u6bcf\u4e2a\u5355\u72ec\u91cd\u505a\u955c\u50cf\uff09\uff0c\u5177\u4f53\u6b65\u9aa4\u53ef\u4ee5\u53c2\u8003\u8fd9\u4e2aKB <a href=\"http:\/\/intkb.transwarp.cn\/posts\/2568\">http:\/\/intkb.transwarp.cn\/posts\/2568<\/a><\/li>\n<\/ol>\n<h2>\u56db\u3001Tbak\u7ec4\u4ef6\u4fee\u590d\u65b9\u6848<\/h2>\n<p><strong>\u53d7\u5f71\u54cd\u7684TBAK\u7248\u672c<\/strong>\uff1aTBAK3.0.1\u4e4b\u524d  1.2.47<\/p>\n<p><strong>\u4fee\u590d\u65b9\u5f0f\uff1a<\/strong><\/p>\n<ol>\n<li>\u66ff\u6362 TBAK\u5b89\u88c5\u8def\u5f84\/unzip\/WEB-INF\/lib\/ \u76ee\u5f55\u4e0b\u7684fastjson\u76f8\u5173jar\u5305\uff08\u4f7f\u7528 fastjson-1.2.83.jar \u66ff\u6362 fastjson-1.2.47.jar\uff09<\/li>\n<li>\u66ff\u6362\u5b8c\u6210\u540e\u91cd\u542fTBAK\u3002<\/li>\n<\/ol>\n<p>\u53c2\u8003\u5185\u90e8\u94fe\u63a5: <a href=\"https:\/\/wiki.transwarp.io\/pages\/viewpage.action?pageId=54901376\" title=\"Fastjson \u53cd\u5e8f\u5217\u5316\u6f0f\u6d1e\u4fee\u590d\u65b9\u5f0f\">TBAK Fastjson \u53cd\u5e8f\u5217\u5316\u6f0f\u6d1e\u4fee\u590d\u65b9\u5f0f<\/a><\/p>\n<h2>\u4e94\u3001Manager\u7ec4\u4ef6\u4fee\u590d\u65b9\u6848<\/h2>\n<h3>transwarp-8.1.2-final(build c9f84fa4)<\/h3>\n<p>8.1.2\u4f7f\u7528\u7684fastjson\u7248\u672c\u662f1.2.79\uff0c\u6b64\u7248\u672c\u5b58\u5728\u5b89\u5168\u6f0f\u6d1e\uff0c\u53ef\u4ee5\u5347\u7ea7\u81f3.1.2.83<\/p>\n<p>\u4fee\u590d\u65b9\u6848\uff1a<\/p>\n<blockquote>\n<p>\u8fdb\u5165\/lib\/transwarp-manager\/common\/lib\uff0c\u627e\u5230fastjson-1.2.79.jar\uff0c\u5c06\u5176\u79fb\u8d70\u5230\u4e34\u65f6\u76ee\u6807\u6682\u5b58<br \/>\n\u4e0b\u8f7dfastjson-1.2.83.jar\uff0c\u5e76\u5c06\u5176\u653e\u5165\u4e0a\u8ff0\u76ee\u5f55<br \/>\n\u91cd\u542fmanager\u5373\u53ef<\/p>\n<\/blockquote>\n<h3>manager-7.0.2007a-final build 6e4012cb<\/h3>\n<p>\u867d\u7136\u5f15\u5165\u4e86fastjson\u7684jar\u5305\uff0c\u4f46\u5b9e\u9645\u6ca1\u6709\u4f7f\u7528\uff0c\u53ef\u4ee5\u76f4\u63a5\u5c06jar\u5305\u5220\u9664\u3002<\/p>\n<h3>manager-6.0.2006a-final build ed2a229c<\/h3>\n<p>\u867d\u7136\u5f15\u5165\u4e86fastjson\u7684jar\u5305\uff0c\u4f46\u5b9e\u9645\u6ca1\u6709\u4f7f\u7528\uff0c\u53ef\u4ee5\u76f4\u63a5\u5c06jar\u5305\u5220\u9664\u3002<\/p>\n<h3>manager-6.0.1812a-final build 8222a749<\/h3>\n<p>\u867d\u7136\u5f15\u5165\u4e86fastjson\u7684jar\u5305\uff0c\u4f46\u5b9e\u9645\u6ca1\u6709\u4f7f\u7528\uff0c\u53ef\u4ee5\u76f4\u63a5\u5c06jar\u5305\u5220\u9664\u3002<\/p>\n<h3>transwarp-5.2.2-final build a37e539f<\/h3>\n<p>\u867d\u7136\u5f15\u5165\u4e86fastjson\u7684jar\u5305\uff0c\u4f46\u5b9e\u9645\u6ca1\u6709\u4f7f\u7528\uff0c\u53ef\u4ee5\u76f4\u63a5\u5c06jar\u5305\u5220\u9664\u3002<\/p>\n<hr \/>\n<p><strong>FAQ:<\/strong><br \/>\nfastjson jar\u5305\uff1a\u4e0b\u8f7d\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/alibaba\/fastjson\/releases\/tag\/1.2.83\">https:\/\/github.com\/alibaba\/fastjson\/releases\/tag\/1.2.83<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u6f0f\u6d1e\u63cf\u8ff0\uff1a \u8fd1\u65e5\uff0cFastjson Develop Team\u53d1\u5e03\u5b89\u5168\u516c\u544a\uff0c\u4fee\u590d\u4e86\u4e00\u4e2a\u5b58\u5728\u4e8eFastjson ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=8267\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[122],"tags":[],"class_list":["post-8267","post","type-post","status-publish","format-standard","hentry","category-vulnerabilities_info"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/8267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8267"}],"version-history":[{"count":3,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/8267\/revisions"}],"predecessor-version":[{"id":13248,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/8267\/revisions\/13248"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}