{"id":283249,"date":"2016-12-29T15:35:04","date_gmt":"2016-12-29T12:35:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283249"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283249","title":{"rendered":"\u041c\u0435\u0442\u043e\u0434\u044b \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 CSRF-\u0430\u0442\u0430\u043a\u0438"},"content":{"rendered":"<h2 id=\"chto-takoe-csrf-ataka\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 CSRF \u0430\u0442\u0430\u043a\u0430?<\/h2>\n<p>  <\/p>\n<p>\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u0430\u043c\u043e\u0439 \u0438\u0434\u0435\u0435\u0439 \u0430\u0442\u0430\u043a\u0438 CSRF \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/www.owasp.org\/index.php\/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet\">OWASP<\/a><\/li>\n<li><a href=\"http:\/\/www.acunetix.com\/websitesecurity\/csrf-attacks\/\">Acunetix<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/11518245\/csrf-attacks-and-double-submitted-cookie\/29622103#29622103\">\u041e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 SO<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h5 id=\"vyderzhka-iz-otveta-na-so\">\u0412\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 SO:<\/h5>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u0430 CSRF \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442, \u043a\u0430\u043a \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0442\u044c, \u0431\u044b\u043b\u043e \u043b\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u044f\u0432\u043d\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c (<em>\u043a\u0430\u043a, \u0441\u043a\u0430\u0436\u0435\u043c, \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430 \u0444\u043e\u0440\u043c\u0435 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/em>) \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 (<em>\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0438 <code>bad.com<\/code>, \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c \u0431\u044b\u043b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 <code>good.com\/some_action<\/code>, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u0431\u044b\u043b \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d \u043d\u0430 <code>good.com<\/code><\/em>).<\/p>\n<p>  <\/p>\n<h2 id=\"kak-ot-nee-zaschititsya\">\u041a\u0430\u043a \u043e\u0442 \u043d\u0435\u0435 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f?<\/h2>\n<p>  <\/p>\n<p>\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0438 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 CSRF-\u0410\u0442\u0430\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>\u0442\u043e\u043a\u0435\u043d<\/strong>. \u041f\u043e\u0434 \u0442\u043e\u043a\u0435\u043d\u043e\u043c \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0443 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0431\u0430\u0439\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443, \u0430 \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0443.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0449\u0438\u0442\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0442\u043e\u043a\u0435\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u0442\u043e\u043a\u0435\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h4 id=\"a-chto-sobstvenno-zaschischat\">\u0410 \u0447\u0442\u043e, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0437\u0430\u0449\u0438\u0449\u0430\u0442\u044c?<\/h4>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u0441\u0432\u043e\u0439 Web-\u0421\u0435\u0440\u0432\u0438\u0441 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c <a href=\"https:\/\/tools.ietf.org\/html\/rfc7231#section-4.2\">RFC7231<\/a>, \u0442\u043e \u043c\u0435\u0442\u043e\u0434\u044b <code>GET<\/code>, <code>HEAD<\/code>, <code>OPTIONS<\/code> \u0438 <code>TRACE<\/code> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438: \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0430\u0449\u0438\u0449\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f: <code>POST<\/code>, <code>PUT<\/code>, <code>DELETE<\/code>, <code>PATCH<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 Habrahabr \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u0442 Yandex, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u043e, <a href=\"https:\/\/habrahabr.ru\/company\/yandex\/blog\/265569\/\">\u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043d\u0443\u0436\u043d\u043e, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443\u044f\u0441\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c<\/a>.<\/p>\n<p>  <\/p>\n<h2 id=\"trebovaniya-k-tokenu\">\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0442\u043e\u043a\u0435\u043d\u0443:<\/h2>\n<p>  <\/p>\n<ul>\n<li>\u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438<\/li>\n<li>\u0414\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b<\/li>\n<li>\u0418\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440, \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 \u043a \u043f\u043e\u0434\u0431\u043e\u0440\u0443<\/li>\n<li>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u043e\u0439\u043a\u0438\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0441\u0435\u0432\u0434\u043e\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b<\/li>\n<li>\u0418\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u0430 <a href=\"https:\/\/www.ptsecurity.com\/ru-ru\/about\/events\/112681\/\">\u043f\u0435\u0440\u0432\u043e\u043c MeetUp&#8217;\u0435 PDUG<\/a> \u0422\u0438\u043c\u0443\u0440 \u042e\u043d\u0443\u0441\u043e\u0432 (<em>\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u043e\u0442\u0434\u0435\u043b\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445<br \/>  \u0441\u0438\u0441\u0442\u0435\u043c Positive Technologies<\/em>) <a href=\"https:\/\/youtu.be\/Zx8HDAW7TKo?t=36m13s\">\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b<\/a>, \u043f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a CSRF-\u0422\u043e\u043a\u0435\u043d\u0443 \u0438 \u0447\u0435\u043c \u0433\u0440\u043e\u0437\u0438\u0442 \u043f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"trebovaniya-k-web-servisu-i-okruzheniyu\">\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a Web-\u0421\u0435\u0440\u0432\u0438\u0441\u0443 \u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044e:<\/h2>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 <strong>XSS<\/strong> \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<p>  <\/p>\n<p>\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u043d\u044b\u0439 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, XSS \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430.<\/p>\n<p>  <\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 <strong>malware<\/strong> \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u043e\u0444\u0442 \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"metody-zaschity\">\u041c\u0435\u0442\u043e\u0434\u044b \u0437\u0430\u0449\u0438\u0442\u044b<\/h2>\n<p>  <\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 3 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b web-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043e\u0442 CSRF \u0430\u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"#synchronizer-tokens\">Synchronizer Tokens<\/a> (<em>Statefull<\/em>)<\/li>\n<li><a href=\"#double-submit-cookie\">Double Submit Cookie<\/a> (<em>Stateless<\/em>)<\/li>\n<li><a href=\"#encrypted-token\">Encrypted Token<\/a> (<em>Stateless<\/em>)<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"synchronizer-tokens\">Synchronizer Tokens<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e. \u0422\u0440\u0435\u0431\u0443\u0435\u0442 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<h6 id=\"sut\">\u0421\u0443\u0442\u044c:<\/h6>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438 <strong>\u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0435\u0441\u0441\u0438\u0438<\/strong> \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043a\u0435\u043d.<\/p>\n<p>  <\/li>\n<li>\n<p>\u0422\u043e\u043a\u0435\u043d \u043a\u043b\u0430\u0434\u0435\u0442\u0441\u044f \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0441\u0441\u0438\u0438 (<em>\u0442.\u0435. \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/em>)<\/p>\n<p>  <\/li>\n<li>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 (<em>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b \u0441\u0435\u0441\u0441\u0438\u044e<\/em>) \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043a\u0435\u043d.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 <strong>\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/strong>, \u0442\u043e \u0442\u043e\u043a\u0435\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 HTML, \u043a\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0434\u043d\u043e \u0438\u0437 \u043f\u043e\u043b\u0435\u0439 \u0444\u043e\u0440\u043c\u044b, \u0438\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 <code>&lt;meta&gt;<\/code> \u0442\u0435\u0433\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <strong>\u0434\u043b\u044f JS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong>, \u0442\u043e\u043a\u0435\u043d \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 header (<em>\u0447\u0430\u0441\u0442\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <code>X-CSRF-Token<\/code><\/em>)<\/p>\n<p>  <\/li>\n<li>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u043a\u043b\u0438\u0435\u043d\u0442 \u043e\u0431\u044f\u0437\u0430\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0435 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0442\u043e\u043a\u0435\u043d \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <strong>\u0432\u043d\u0443\u0442\u0440\u0438 POST \u0434\u0430\u043d\u043d\u044b\u0445<\/strong> \u0444\u043e\u0440\u043c\u044b.<\/p>\n<p>  <\/p>\n<p>JS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u044e\u0442 <strong>XHR \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 header<\/strong> (<code>X-CSRF-Token<\/code>), \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c \u0442\u043e\u043a\u0435\u043d.<\/p>\n<p>  <\/li>\n<li>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c (<code>POST<\/code>, <code>PUT<\/code>, <code>DELETE<\/code>, <code>PATCH<\/code>) \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u044f\u0437\u0430\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043a\u0435\u043d <strong>\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0441\u0441\u0438\u0438<\/strong> \u0438 \u0442\u043e\u043a\u0435\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <strong>\u043f\u0440\u0438\u0441\u043b\u0430\u043b \u043a\u043b\u0438\u0435\u043d\u0442<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u0430 \u0442\u043e\u043a\u0435\u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u0441\u044f CSRF-\u0410\u0442\u0430\u043a\u0435, \u0432 \u0438\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h6 id=\"na-vyhode-imeem\">\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u043c\u0435\u0435\u043c:<\/h6>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u0417\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 CSRF \u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435<\/p>\n<p>  <\/li>\n<li>\n<p>\u0422\u043e\u043a\u0435\u043d \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u0435\u0441\u0441\u0438\u0438<\/strong>, \u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u0441\u0441\u0438\u044f \u0438\u0441\u0442\u0435\u043a\u0430\u0435\u0442<\/p>\n<p>  <\/p>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u043f\u043e <strong>\u043e\u0434\u043d\u043e\u043c\u0443 \u0442\u043e\u043a\u0435\u043d\u0443<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0443\u0442\u0435\u0447\u043a\u0430 \u0442\u043e\u043a\u0435\u043d\u0430, \u0442\u043e \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c CSRF-\u0410\u0442\u0430\u043a\u0443 \u043d\u0430 <strong>\u043b\u044e\u0431\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/strong> \u0438 <strong>\u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0433\u043e\u0433\u043e \u0441\u0440\u043e\u043a\u0430<\/strong>. \u0410 \u044d\u0442\u043e \u043d\u0435 \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p>  <\/li>\n<li>\n<p>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 multi-tab \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u043e\u043a\u0435\u043d \u043d\u0435 \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043d\u0435 \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u043e\u043a\u0435\u043d\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0430\u0431\u0430\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u043e\u043a\u0435\u043d \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0434\u0438\u043d.<\/p>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"double-submit-cookie\">Double Submit Cookie<\/h3>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 <strong>\u043d\u0435<\/strong> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>Stateless<\/strong>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u043c\u0435\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 Web-\u0441\u0435\u0440\u0432\u0438\u0441 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e.<br \/>  \u0418\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0434\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0434\u0432\u0443\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438: <strong>\u0432 \u043a\u0443\u043a\u0430\u0445<\/strong> \u0438 \u0432 <strong>\u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0430<\/strong> (<em>header \u0438\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 HTML<\/em>).<\/p>\n<p>  <\/p>\n<h6 id=\"sut-1\">\u0421\u0443\u0442\u044c:<\/h6>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043a\u0435\u043d. \u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u0442\u043e\u043a\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 <strong>cookie<\/strong> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>X-CSRF-Token<\/code>) \u0438 <strong>\u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0430<\/strong> (<em>\u0432 header \u0438\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 HTML<\/em>).<\/p>\n<p>  <\/li>\n<li>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u043a\u043b\u0438\u0435\u043d\u0442 \u043e\u0431\u044f\u0437\u0430\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c <strong>\u043e\u0431\u0430<\/strong> \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435 \u0442\u043e\u043a\u0435\u043d\u0430. \u041e\u0434\u0438\u043d \u043a\u0430\u043a cookie, \u0434\u0440\u0443\u0433\u043e\u0439 \u043b\u0438\u0431\u043e \u043a\u0430\u043a <strong>header<\/strong>, \u043b\u0438\u0431\u043e <strong>\u0432\u043d\u0443\u0442\u0440\u0438 POST \u0434\u0430\u043d\u043d\u044b\u0445<\/strong> \u0444\u043e\u0440\u043c\u044b.<\/p>\n<p>  <\/li>\n<li>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c (<code>POST<\/code>, <code>PUT<\/code>, <code>DELETE<\/code>, <code>PATCH<\/code>) \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u044f\u0437\u0430\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043a\u0435\u043d <strong>\u0438\u0437 cookie<\/strong> \u0438 \u0442\u043e\u043a\u0435\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043d\u043e <strong>\u043f\u0440\u0438\u0441\u043b\u0430\u043b \u043a\u043b\u0438\u0435\u043d\u0442<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u0430 \u0442\u043e\u043a\u0435\u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u0441\u044f CSRF-\u0410\u0442\u0430\u043a\u0435, \u0432 \u0438\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h6 id=\"na-vyhode-imeem-1\">\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u043c\u0435\u0435\u043c:<\/h6>\n<p>  <\/p>\n<ul>\n<li>\n<p>Stateless CSRF \u0437\u0430\u0449\u0438\u0442\u0443.<\/p>\n<p>  <\/li>\n<li>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u044b \u043c\u043e\u0433\u0443\u0442 \u0447\u0438\u0442\u0430\u0442\u044c cookie \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430, \u0435\u0441\u043b\u0438 \u044f\u0432\u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0442\u044c (\u0442.\u0435. \u0435\u0441\u043b\u0438 cookie \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 <code>.site.ru<\/code>, \u0442\u043e \u0435\u0451 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u043a <code>a.site.ru<\/code>, \u0442\u0430\u043a \u0438 <code>b.site.ru<\/code>).<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 \u0434\u043e\u043c\u0435\u043d\u0435 3-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u0430 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u0434\u043e\u043c\u0435\u043d\u0435 2-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u0442\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0439\u0442\u0435 cookie \u043d\u0430 \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d \u044f\u0432\u043d\u043e.<\/p>\n<p>  <\/li>\n<li>\u041d\u044e\u0430\u043d\u0441\u044b \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"encrypted-token\">Encrypted Token<\/h3>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 Double Submit, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>Stateless<\/strong> \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u2014 \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0448\u0438\u0444\u0440\u0443\u0435\u0442\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u0442\u0435 \u0438\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0443, \u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u0435 \u0437\u043d\u0430\u044f \u043a\u043b\u044e\u0447\u0430. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f cookie. \u0422\u043e\u043a\u0435\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 <strong>\u0442\u043e\u043a\u0435\u043d\u043e\u043c \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u0430\u043a\u0442\u044b, \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u043e\u043c<\/strong>. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0430\u043a\u0442\u044b \u2014 \u044d\u0442\u043e <strong>\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/strong> \u0438 <strong>timestamp<\/strong> \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u043a\u0435\u043d\u0430. \u041a\u043b\u044e\u0447 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043a\u043b\u0438\u0435\u043d\u0442\u0443.<\/p>\n<p>  <\/p>\n<h6 id=\"sut-2\">\u0421\u0443\u0442\u044c:<\/h6>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043a\u0435\u043d.<\/p>\n<p>  <\/p>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0435 \u0444\u0430\u043a\u0442\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0442\u043e\u043a\u0435\u043d\u0430 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.<\/p>\n<p>  <\/p>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0430\u043a\u0442\u044b \u2014 \u044d\u0442\u043e <strong>\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/strong> \u0438 <strong>timestamp<\/strong>. \u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u0442\u043e\u043a\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <strong>\u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0430<\/strong> (<em>\u0412 header \u0438\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 HTML<\/em>).<\/p>\n<p>  <\/li>\n<li>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u043a\u043b\u0438\u0435\u043d\u0442 \u043e\u0431\u044f\u0437\u0430\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u0442\u043e\u043a\u0435\u043d.<\/p>\n<p>  <\/li>\n<li>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c (<code>POST<\/code>, <code>PUT<\/code>, <code>DELETE<\/code>, <code>PATCH<\/code>) \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u044f\u0437\u0430\u043d \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0435 \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0444\u0430\u043a\u0442\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438, \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438. (\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <strong>timestamp<\/strong> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0434\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0436\u0438\u0437\u043d\u0438 \u0442\u043e\u043a\u0435\u043d\u0430)<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043b\u0438\u0431\u043e \u0444\u0430\u043a\u0442\u044b \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u0441\u044f CSRF-\u0410\u0442\u0430\u043a\u0435.<\/p>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h6 id=\"na-vyhode-imeem-2\">\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u043c\u0435\u0435\u043c:<\/h6>\n<p>  <\/p>\n<ul>\n<li>\n<p>Stateless CSRF \u0437\u0430\u0449\u0438\u0442\u0443<\/p>\n<p>  <\/li>\n<li>\n<p>\u041d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 cookie<\/p>\n<p>  <\/li>\n<li>\u041d\u0435\u0442 \u043d\u044e\u0430\u043d\u0441\u043e\u0432 \u0441 \u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u0430\u043c\u0438.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"o-realizacii\">\u041e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u043d\u0430 <strong>\u043a\u0430\u0436\u0434\u044b\u0439<\/strong> \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u0435 \u0432\u0430\u0436\u043d\u043e, \u043a\u0430\u043a\u0438\u043c HTTP-\u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0438 \u0441 \u043a\u0430\u043a\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0434\u0435\u043b\u0430\u043d.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u043a\u0435\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 multi-tab \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  <\/p>\n<p>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0442\u0430\u0431\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Storage\/LocalStorage\">localStorage<\/a> \u0438 \u0435\u0433\u043e <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/StorageEvent\">StorageEvent<\/a><\/p>\n<p>  <\/li>\n<li>\n<p><strong>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438<\/strong> cookie, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043a\u0435\u043d, \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 30 \u043c\u0438\u043d\u0443\u0442.<\/p>\n<p>  <\/li>\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c cookie \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0438\u0437 JS (\u0441\u0442\u0430\u0432\u0438\u043c <strong>HTTPOnly=true<\/strong>)<\/p>\n<p>  <\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <strong>TLS<\/strong> \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Man-in-the-middle_attack\">MITM<\/a><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c cookie \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e HTTPS (\u0441\u0442\u0430\u0432\u0438\u043c <strong>Secure=true<\/strong>)<\/p>\n<p>  <\/li>\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0442\u043e\u043a\u0435\u043d\u0430 <strong>\u043d\u0435 \u043c\u0435\u043d\u0435\u0435 32 \u0431\u0430\u0439\u0442<\/strong>.<\/p>\n<p>  <\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0442\u043e\u043a\u0435\u043d \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u043e\u0439\u043a\u0438\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0441\u0435\u0432\u0434\u043e\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code>Linux =&gt; getrandom(2) \u0435\u0441\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \/dev\/urandom \u0438\u043d\u0430\u0447\u0435 OpenBSD =&gt; getentropy(2) \u041d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 Unix-like \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 =&gt; \/dev\/urandom Windows =&gt; CryptGenRandom API<\/code><\/pre>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"chto-esche-nuzhno-znat\">\u0427\u0442\u043e \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c?<\/h2>\n<p>  <\/p>\n<p>\u0422\u043e\u043a\u0435\u043d\u044b \u2014 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 CSRF.<\/p>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435, \u043d\u043e \u043d\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u0439\u0442\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 <code>X-Requested-With: XMLHttpRequest<\/code><\/p>\n<p>  <\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435, \u043d\u043e \u043d\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u0439\u0442\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438: <code>Host<\/code>, <code>Origin<\/code>, <code>Referer<\/code><\/p>\n<p>  <\/li>\n<li>\n<p>\u041d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0432 URL<\/p>\n<p>  <\/li>\n<li>\u0417\u0430\u0449\u0438\u0449\u0430\u0439\u0442\u0435 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"same-site\">Same Site<\/h2>\n<p>  <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0438\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0434 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;Same-Site&quot; \u0443 cookies (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f <a href=\"https:\/\/tools.ietf.org\/html\/draft-ietf-httpbis-cookie-same-site-00\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>).<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0434\u0430\u0441\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e cookie \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438\u0434\u0435\u0442 \u0441 \u0441\u0430\u0439\u0442\u0430, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c cookie \u0431\u044b\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430. \u0410, \u0437\u043d\u0430\u0447\u0438\u0442, \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0449\u0438\u0449\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043e\u0442 CSRF \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. <\/p>\n<p>  <\/p>\n<p>\u0411\u0440\u0430\u0443\u0437\u0435\u0440 Chrome \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0427\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0430 <a href=\"http:\/\/security.stackexchange.com\/a\/121986\">Stack Exchange<\/a>.<\/p>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/318748\/\"> https:\/\/habrahabr.ru\/post\/318748\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<h2 id=\"chto-takoe-csrf-ataka\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 CSRF \u0430\u0442\u0430\u043a\u0430?<\/h2>\n<p>  <\/p>\n<p>\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u0430\u043c\u043e\u0439 \u0438\u0434\u0435\u0435\u0439 \u0430\u0442\u0430\u043a\u0438 CSRF \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/www.owasp.org\/index.php\/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet\">OWASP<\/a><\/li>\n<li><a href=\"http:\/\/www.acunetix.com\/websitesecurity\/csrf-attacks\/\">Acunetix<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/11518245\/csrf-attacks-and-double-submitted-cookie\/29622103#29622103\">\u041e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 SO<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h5 id=\"vyderzhka-iz-otveta-na-so\">\u0412\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 SO:<\/h5>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u0430 CSRF \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442, \u043a\u0430\u043a \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0442\u044c, \u0431\u044b\u043b\u043e \u043b\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u044f\u0432\u043d\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c (<em>\u043a\u0430\u043a, \u0441\u043a\u0430\u0436\u0435\u043c, \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430 \u0444\u043e\u0440\u043c\u0435 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/em>) \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 (<em>\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0438 <code>bad.com<\/code>, \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c \u0431\u044b\u043b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 <code>good.com\/some_action<\/code>, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u0431\u044b\u043b \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d \u043d\u0430 <code>good.com<\/code><\/em>).<\/p>\n<p>  <\/p>\n<h2 id=\"kak-ot-nee-zaschititsya\">\u041a\u0430\u043a \u043e\u0442 \u043d\u0435\u0435 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f?<\/h2>\n<p>  <\/p>\n<p>\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0438 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 CSRF-\u0410\u0442\u0430\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>\u0442\u043e\u043a\u0435\u043d<\/strong>. \u041f\u043e\u0434 \u0442\u043e\u043a\u0435\u043d\u043e\u043c \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0443 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0431\u0430\u0439\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443, \u0430 \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0443.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0449\u0438\u0442\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0442\u043e\u043a\u0435\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u0442\u043e\u043a\u0435\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-283249","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283249"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283249\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}