\u89e3\u51b3\u65b9\u6cd5\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a<\/strong><\/div>\n\u68c0\u67e5 Referer\uff1a\u5728\u670d\u52a1\u5668\u7aef\u68c0\u67e5\u8bf7\u6c42\u5934\u4e2d Referer \u7684\u503c\uff0c\u4e5f\u5c31\u662f\u68c0\u67e5\u8bf7\u6c42\u7684\u6765\u6e90\uff0c\u5982\u679c\u662f\u6765\u81ea\u5141\u8bb8\u7684\u7f51\u7ad9\uff0c\u624d\u4f1a\u6b63\u5e38\u6267\u884c API \u7684\u529f\u80fd\u3002
\nCSRF Token\uff1a\u5728 Cookie \u53ca\u8bf7\u6c42\u53d1\u9001\u7684\u6570\u636e\u4e2d\u90fd\u52a0\u4e0a csrftoken\uff0c\u5e76\u68c0\u67e5\u503c\u662f\u5426\u76f8\u540c\uff0c\u5982\u679c\u8bf7\u6c42\u6765\u6e90\u662f\u81ea\u5df1\u7684\u7f51\u7ad9\u9a8c\u8bc1\u5c31\u4f1a\u901a\u8fc7;\u53cd\u4e4b\uff0c\u7531\u4e8e\u5916\u90e8\u7f51\u7ad9\u65e0\u6cd5\u5728\u4ee3\u7801\u4e2d\u5f97\u5230\u5176\u4ed6\u7f51\u7ad9\u7684 Cookie\uff0c\u56e0\u6b64\u65e0\u6cd5\u5728\u8bf7\u6c42\u4e2d\u5e26\u4e0a csrftoken\u3002
\nSameSite Cookie\uff1a\u5728 Cookie \u4e2d\u52a0\u4e0a SameSite \u5c5e\u6027\uff0c\u786e\u4fdd Cookie \u4ec5\u80fd\u5728\u81ea\u5df1\u7684\u7f51\u7ad9\u4f7f\u7528\u3002
\nJSON \u52ab\u6301<\/p>\n
JSON \u52ab\u6301\u662f\u5229\u7528\u73b0\u4ee3\u7f51\u7ad9\u524d\u540e\u7aef\u901a\u8fc7 API \u8fdb\u884c\u6570\u636e\u4ea4\u6362\u7684\u7279\u6027\uff0c\u53ea\u8981\u80fd\u83b7\u5f97\u4f7f\u7528\u8005\u6743\u9650\uff0c\u5e76\u8c03\u7528\u83b7\u53d6\u8d44\u6599\u7684 API\uff0c\u518d\u52a0\u4e0a\u6539\u5199\u539f\u751f\u7684 JavaScript \u5bf9\u8c61\uff0c\u5c31\u53ef\u4ee5\u7a83\u53d6\u7528\u6237\u7684\u654f\u611f\u4fe1\u606f\u3002<\/p>\n
\u83b7\u5f97\u6743\u9650\u7684\u90e8\u5206\u4e8e CSRF \u76f8\u540c\uff0c\u901a\u8fc7script\u53ef\u4ee5\u8de8\u57df\u7684\u7279\u6027\u76f4\u63a5\u4f7f\u7528\u6d4f\u89c8\u5668\u7528\u6237\u7684 Cookie\uff1b\u653b\u51fb\u8005\u53ea\u9700\u8981\u5728\u7f51\u9875\u4e0a\u901a\u8fc7script\u8c03\u7528\u83b7\u53d6\u6570\u636e\u7684 API \u5b8c\u6210\u5bf9\u6570\u636e\u7684\u7a83\u53d6\u3002
\n\u4f8b\u5982\uff1a<\/p>\n
\r\nObject.prototype.__defineSetter__('user',function(obj){ \r\n for(var i in obj) { \r\n alert(i + '=' + obj[i]); \r\n } \r\n}); \r\n<\/pre>\n\u5f53\u56de\u4f20\u7684\u6570\u636e\u4e2d\u542b\u6709 user \u5c5e\u6027\u65f6\uff0c\u7531\u4e8e Setter \u901a\u8fc7 Object.prototype.__defineSetter__ \u6539\u5199\u4e86\uff0cuser \u4e2d\u7684\u503c\u4f1a\u88ab\u5168\u90e8\u8bfb\u53d6\u3002<\/p>\n
\u7136\u800c Object.prototype.__defineSetter__ \u53ef\u4ee5\u4fee\u6539\u539f\u751f\u5bf9\u8c61\u6240\u9020\u6210\u7684\u95ee\u9898\uff0c\u65e9\u5df2\u7ecf\u5728 ES4 \u4e2d\u5c31\u88ab\u4fee\u590d\u4e86\uff0cJSON \u52ab\u6301\u4e5f\u56e0\u6b64\u9500\u58f0\u533f\u8ff9\uff0c\u4f46\u662f\u4ece ES6 \u5f00\u59cb\u53c8\u6dfb\u52a0\u4e86 Proxy\uff0c\u4f7f JSON \u52ab\u6301\u53c8\u518d\u6b21\u6210\u4e3a\u53ef\u80fd\uff1a<\/p>\n
\r\n Object.setPrototypeOf( \r\n __proto__, \r\n new Proxy(__proto__, { \r\n has: function(target, name) { \r\n alert( \r\n name.replace(\/.\/g, function(c) { \r\n c = c.charCodeAt(0) \r\n return String.fromCharCode(c >> 8, c & 0xff) \r\n }) \r\n ) \r\n } \r\n }) \r\n ) \r\n<\/pre>\n\u770b\u8d77\u6765\u5f88\u6050\u6016\uff0c\u90a3\u4e48\u8be5\u5982\u4f55\u89e3\u51b3\u5462\uff1f\u9664\u4e86\u524d\u9762\u6240\u8bf4\u7684 CSRF Token \u5916\uff0c\u8bb8\u591a\u5927\u516c\u53f8\u8fd8\u91c7\u7528\u4e86\u53e6\u4e00\u79cd\u6709\u8da3\u7684\u89e3\u51b3\u65b9\u5f0f\u3002\u5373 API \u7684\u54cd\u5e94\u5185\u5bb9\u5f00\u5934\u4e3a for (;;);\uff0c\u8fd9\u4e5f\u662f\u5229\u7528\u4e86script\u5f15\u5165\u7684 JavaScript \u4f1a\u7acb\u5373\u6267\u884c\u7684\u7279\u6027\uff0c\u628a\u653b\u51fb\u8005\u7684\u7f51\u7ad9\u5361\u6b7b\u5728\u5faa\u73af\u91cc\u3002<\/p>\n
\u603b\u7ed3<\/strong><\/div>\n\u9664\u4e86\u6587\u4e2d\u63d0\u5230\u7684\u56db\u79cd\u5e38\u89c1\u7684\u7f51\u7ad9\u5b89\u5168\u6f0f\u6d1e\u5916\uff0c\u4e00\u4e2a\u7f51\u7ad9\u8fd8\u6709\u5f88\u591a\u7ec6\u8282\u9700\u8981\u8003\u8651\uff0c\u4f8b\u5982\u4e0d\u8981\u7528\u660e\u7801\u5b58\u50a8\u5bc6\u7801\u7b49\u654f\u611f\u4fe1\u606f\uff0c\u9488\u5bf9\u6765\u6e90 IP \u505a\u6d41\u91cf\u9650\u5236\u9632\u6b62 DOS \u7b49\u7b49\u3002\u6240\u4ee5\u5728\u8fdb\u884c\u7f51\u7ad9\u5f00\u53d1\u65f6\u8981\u4fdd\u6301\u5b89\u5168\u610f\u8bc6\uff0c\u5c3d\u53ef\u80fd\u505a\u597d\u57fa\u672c\u7684\u9632\u62a4\u63aa\u65bd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u7ecf\u8fc7\u4e00\u756a 996\uff0c\u7cbe\u5fc3\u6253\u9020\u7684\u7f51\u7ad9\u773c\u770b\u5c31\u8981\u90e8\u5c5e\u4e0a\u7ebf\u4e86\uff0c\u4f46\u5728\u7f51\u7ad9\u6b63\u5f0f\u4e0a\u7ebf\u4e4b\u524d\uff0c\u4f60\u6709\u6ca1\u6709\u60f3\u8fc7\u81ea\u5df1\u7684\u7f51\u7ad9\u662f\u5426\u5b89\u5168\u5417?\u5c3d […]<\/p>\n","protected":false},"author":1898,"featured_media":204359,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[610],"class_list":["post-204353","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread","tag-610"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/204353","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\/1898"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=204353"}],"version-history":[{"count":10,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/204353\/revisions"}],"predecessor-version":[{"id":204367,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/204353\/revisions\/204367"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/204359"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=204353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=204353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=204353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}