{"id":14186,"date":"2022-09-27T05:14:56","date_gmt":"2022-09-26T21:14:56","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=14186"},"modified":"2022-09-27T05:15:38","modified_gmt":"2022-09-26T21:15:38","slug":"imagemagick-loopholes-solution","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/imagemagick-loopholes-solution.html","title":{"rendered":"WP_Image_Editor_Imagick \u6f0f\u6d1e\u4e34\u65f6\u89e3\u51b3\u65b9\u6cd5"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u963f\u91cc\u4e91\u63a8\u9001\u7684\u4e00\u6761\u77ed\u4fe1\u901a\u77e5\uff1a\u5b58\u653e\u5728\u4e0a\u9762\u7684WordPress\u7a0b\u5e8f\u6709WP_Image_Editor_Imagick\u6f0f\u6d1e\u95ee\u9898\uff0c\u9700\u8981\u767b\u5165\u540e\u53f0\u8865\u4e01\u7b49\u7b49\u7684\u6697\u793a\u3002\u5f53\u7136\uff0c\u5982\u679c\u9700\u8981\u5728\u7ebf\u8865\u4e01\u5219\u9700\u8981\u5347\u7ea7\u963f\u91cc\u4e91\u7684\u5b89\u9a91\u58eb\u4e13\u4e1a\u7248\uff0c100\u5143\/5\u53f0\/\u6708\u3002\u5176\u5b9e\u5bf9\u4e8e\u6211\u4eec\u6765\u8bf4\u6211\u4eec\u6ca1\u6709\u5fc5\u8981\u53bb\u8d2d\u4e70\u8fd9\u4e2a\u670d\u52a1\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u6f0f\u6d1e\u5e76\u4e0d\u662f\u7531\u4e8eWordpress\u7a0b\u5e8f\u672c\u8eab\u9020\u6210\u7684\uff0c\u800c\u662f\u7531\u4e8eImageMagick\u8fd9\u4e2aPHP\u56fe\u50cf\u5904\u7406\u6a21\u5757\u7206\u51fa\u7684\u201c0day\u201d\u6f0f\u6d1e\u6240\u5f15\u53d1\u7684\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"WordPress\"
\n\u5148\u6765\u8bf4\u4e0bImageMagick\u8fd9\u4e2a\u6a21\u5757\uff0cImageMagick\u662f\u4e00\u4e2a\u514d\u8d39\u7684\u521b\u5efa\u3001\u7f16\u8f91\u3001\u5408\u6210\u56fe\u7247\u7684\u8f6f\u4ef6\u3002\u5b83\u53ef\u4ee5\u8bfb\u53d6\u3001\u8f6c\u6362\u3001\u5199\u5165\u591a\u79cd\u683c\u5f0f\u7684\u56fe\u7247\u3002\u56fe\u7247\u5207\u5272\u3001\u989c\u8272\u66ff\u6362\u3001\u5404\u79cd\u6548\u679c\u7684\u5e94\u7528\uff0c\u56fe\u7247\u7684\u65cb\u8f6c\u3001\u7ec4\u5408\uff0c\u6587\u672c\uff0c\u76f4\u7ebf\uff0c\u591a\u8fb9\u5f62\uff0c\u692d\u5706\uff0c\u66f2\u7ebf\uff0c\u9644\u52a0\u5230\u56fe\u7247\u4f38\u5c55\u65cb\u8f6c\u3002ImageMagick\u662f\u514d\u8d39\u8f6f\u4ef6\uff1a\u5168\u90e8\u6e90\u7801\u5f00\u653e\uff0c\u53ef\u4ee5\u81ea\u7531\u4f7f\u7528\uff0c\u590d\u5236\uff0c\u4fee\u6539\uff0c\u53d1\u5e03\uff0c\u5b83\u9075\u5b88GPL\u8bb8\u53ef\u534f\u8bae\uff0c\u53ef\u4ee5\u8fd0\u884c\u4e8e\u5927\u591a\u6570\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0cImageMagick\u7684\u5927\u591a\u6570\u529f\u80fd\u7684\u4f7f\u7528\u90fd\u6765\u6e90\u4e8e\u547d\u4ee4\u884c\u5de5\u5177\u3002\u7531\u4e8e\u5176\u5f3a\u5927\u7684\u529f\u80fd\u4ee5\u53ca\u8d85\u5f3a\u7684\u53ef\u64cd\u4f5c\u6027\uff0c\u662f\u7684\u8fd9\u6b3e\u4f5c\u56fe\u8f6f\u4ef6\u6df1\u5f97\u5e7f\u5927\u529e\u516c\u4eba\u58eb\u559c\u7231\uff0c\u6b63\u56e0\u4e3a\u5982\u6b64\uff0c\u6b64\u6b210day\u6f0f\u6d1e\u6240\u5e26\u6765\u7684\u5f71\u54cd\u8d85\u4e4e\u4e86\u4eba\u4eec\u7684\u60f3\u8c61\u3002\u8bf8\u591a\u7f51\u7ad9\u8bba\u575b\u90fd\u6df1\u53d7\u5176\u5bb3\uff0c\u5176\u4e2d\u4e0d\u4e4f\u767e\u5ea6\u3001\u963f\u91cc\u3001\u817e\u8baf\u3001\u65b0\u6d6a\u7b49\u77e5\u540d\u7f51\u7ad9\uff0c\u4e00\u65f6\u95f4\uff0c\u4e1a\u754c\u5404\u5927\u7f51\u7ad9\u53ca\u4f01\u4e1a\u90fd\u4eba\u4eba\u81ea\u5371\uff0c\u7eb7\u7eb7\u81ea\u67e5\uff0c\u4ee5\u514d\u4e2d\u62db\u3002<\/p>\n

\u90a3\u4e48\u5bf9\u4e8e\u6211\u4eec\u6765\u8bf4\uff0c\u5982\u679c\u53bb\u89e3\u51b3\u8fd9\u4e2a\u6f0f\u6d1e\u5462\uff1f<\/p>\n

1.\u6700\u5b8c\u5584\u7684\u89e3\u51b3\u65b9\u6848\u662f\u201c\u7b49\u201d\uff1a<\/strong><\/span><\/div>\n

\u7b49ImageMagick\u7684\u5b98\u65b9\u66f4\u65b0\uff0c\u5e76\u5c06\u5176\u5347\u7ea7\u5230\u6700\u65b0\u7248\u672c\u3002\u4e0d\u8fc7\u8fd9\u4f3c\u4e4e\u8981\u7b49\u6bb5\u65f6\u95f4\u3002<\/p>\n

2.ImageMagick\u5b98\u65b9\u7ed9\u51fa\u4e86\u4e00\u4e2a\u4e34\u65f6\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/span><\/div>\n

\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\uff0c\u7981\u7528ImageMagick\u3002
\n\u5728\u201c\/etc\/ImageMagick\/policy.xml\u201d \u6587\u4ef6\u4e2d\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n

<policymap>\r\n\u00a0\r\n<policy domain=\"coder\" rights=\"none\" pattern=\"EPHEMERAL\" \/>\r\n\u00a0\r\n<policy domain=\"coder\" rights=\"none\" pattern=\"URL\" \/>\r\n\u00a0\r\n<policy domain=\"coder\" rights=\"none\" pattern=\"HTTPS\" \/>\r\n\u00a0\r\n<policy domain=\"coder\" rights=\"none\" pattern=\"MVG\" \/>\r\n\u00a0\r\n<policy domain=\"coder\" rights=\"none\" pattern=\"MSL\" \/>\r\n\u00a0\r\n<\/policymap><\/pre>\n
3.\u5173\u4e8ewordpress\u7684\u4e34\u65f6\u89e3\u51b3\u65b9\u6cd5\u3002<\/strong><\/span><\/div>\n

\u5c06wordpress\u7684\u9ed8\u8ba4\u56fe\u7247\u5904\u7406\u5e93\u4f18\u5148\u987a\u5e8f\u6539\u4e3aGD\u4f18\u5148\uff0c\u8fd9\u4e5f\u662f\u963f\u91cc\u4e91\u7ed9\u51fa\u7684\u4e34\u65f6\u89e3\u51b3\u65b9\u6848\uff1a\uff08\u4e0d\u8fc7\u6211\u5c31\u4e0d\u8981\u94b1\u4e86\uff0c\u5176\u5b9e\u4e5f\u5f88\u7b80\u5355\uff09
\n\u5728wp-includes\/media.php\u4e2d\u641c\u7d22:<\/p>\n

$implementations = apply_filters( 'wp_image_editors', array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' ) );<\/pre>\n

\u4fee\u6539\u4e3a:<\/p>\n

$implementations = apply_filters( 'wp_image_editors', array('WP_Image_Editor_GD','WP_Image_Editor_Imagick' ) );<\/pre>\n

\u95ee\u9898\u4e34\u65f6\u89e3\u51b3\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.wpdaxue.com\/wp_image_editor_imagick.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/imagemagick-loopholes-solution.html<\/a>\u7f16\u8f91\uff1a\u51af\u632f\u534e\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u963f\u91cc\u4e91\u63a8\u9001\u7684\u4e00\u6761\u77ed\u4fe1\u901a\u77e5\uff1a\u5b58\u653e\u5728\u4e0a\u9762\u7684WordPress\u7a0b\u5e8f\u6709WP_Image_Editor_Imagi […]<\/p>\n","protected":false},"author":63,"featured_media":14194,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-14186","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/14186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=14186"}],"version-history":[{"count":11,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/14186\/revisions"}],"predecessor-version":[{"id":253957,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/14186\/revisions\/253957"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/14194"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=14186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=14186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=14186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}