{"id":282595,"date":"2016-12-16T11:00:04","date_gmt":"2016-12-16T08:00:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=282595"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=282595","title":{"rendered":"\u042d\u043a\u0437\u043e\u0442\u0438\u0447\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 HTTP"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/0e9\/205\/ad6\/0e9205ad6abaf074912779548ad43610.png\"\/><br \/>  \u041f\u0440\u0438\u0432\u0435\u0442 \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440, <\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u0438 \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u043d\u044b\u0445 HTTP \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h1>X-XSS-Protection<\/h1>\n<p>  \u0410\u0442\u0430\u043a\u0430 XSS (\u043c\u0435\u0436\u0441\u0430\u0439\u0442\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442\u0438\u043d\u0433) \u044d\u0442\u043e \u0442\u0438\u043f \u0430\u0442\u0430\u043a\u0438, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u043d\u0435\u0434\u0440\u0451\u043d \u0432 \u0430\u0442\u0430\u043a\u0443\u0435\u043c\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. <\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code>&lt;h1&gt;Hello, &lt;script&gt;alert('hacked')&lt;\/script&gt;&lt;\/h1&gt;<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0430\u0442\u0430\u043a\u0438 \u043b\u0435\u0433\u043a\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441 \u044d\u0442\u0438\u043c \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f: \u0435\u0441\u043b\u0438 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0443\u0433\u0440\u043e\u0437\u043e\u0439.<\/p>\n<p>  \u0418 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a <b>X-XSS-Protection<\/b> \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u0438\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<\/p>\n<p>  \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:  <\/p>\n<ul>\n<li><b>0<\/b> \u0444\u0438\u043b\u044c\u0442\u0440 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d  <\/li>\n<li><b>1<\/b> \u0444\u0438\u043b\u044c\u0442\u0440 \u0432\u043a\u043b\u044e\u0447\u0435\u043d. \u0415\u0441\u043b\u0438 \u0430\u0442\u0430\u043a\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430, \u0442\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0443\u0434\u0430\u043b\u0438\u0442 \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u044b\u0439 \u043a\u043e\u0434.   <\/li>\n<li><b>1; mode=block<\/b>. \u0424\u0438\u043b\u044c\u0442\u0440 \u0432\u043a\u043b\u044e\u0447\u0435\u043d, \u043d\u043e \u0435\u0441\u043b\u0438 \u0430\u0442\u0430\u043a\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u0441\u044f, \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c.   <\/li>\n<li><b>1; report=http:\/\/domain\/url<\/b>. \u0444\u0438\u043b\u044c\u0442\u0440 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043e\u0447\u0438\u0441\u0442\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e\u0442 \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0438\u0432 \u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0430\u0442\u0430\u043a\u0438. \u0422\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f Chromium \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043e\u0442\u0447\u0451\u0442\u0430 \u043e \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0437\u0430\u0449\u0438\u0442\u044b \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 (CSP) \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441.   <\/li>\n<\/ul>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443 \u043d\u0430 node.js, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.  <\/p>\n<pre><code class=\"javascript\">var express = require('express') var app = express()  app.use((req, res) =&gt; {  \u00a0if (req.query.xss) res.setHeader('X-XSS-Protection', req.query.xss)  \u00a0res.send(`&lt;h1&gt;Hello, ${req.query.user || 'anonymous'}&lt;\/h1&gt;`) })  app.listen(1234)<\/code><\/pre>\n<p>  \u0411\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Google Chrome 55.<\/p>\n<h3>\u0411\u0435\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430<\/h3>\n<p>  <\/p>\n<pre><code>http:\/\/localhost:1234\/?user=%3Cscript%3Ealert(%27hacked%27)%3C\/script%3E<\/code><\/pre>\n<p>  \u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0430\u0442\u0430\u043a\u0443. Chrome, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0443\u0433\u0440\u043e\u0437\u0443 \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/183\/72c\/803\/18372c803f742576162d29888b75f185.png\"\/><\/p>\n<p>  \u041e\u043d \u0434\u0430\u0436\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/807\/7ac\/06d\/8077ac06d960fe4e9d46afd25faece3c.png\"\/><\/p>\n<h3>X-XSS-Protection: 0<\/h3>\n<p>  <\/p>\n<pre><code>http:\/\/localhost:1234\/?user=%3Cscript%3Ealert(%27hacked%27)%3C\/script%3E&xss=0<\/code><\/pre>\n<p>  \u041e \u043d\u0435\u0442!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/462\/335\/628\/46233562803227d7a7c01ff47de11048.png\"\/><\/p>\n<h3>X-XSS-Protection: 1<\/h3>\n<p>  <\/p>\n<pre><code>http:\/\/localhost:1234\/?user=%3Cscript%3Ealert(%27hacked%27)%3C\/script%3E&xss=1<\/code><\/pre>\n<p>  \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0431\u044b\u043b\u0430 \u043e\u0447\u0438\u0449\u0435\u043d\u0430 \u0438\u0437-\u0437\u0430 \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/3d8\/cee\/9a3\/3d8cee9a3ee9f7f02c6cc89e653697ad.png\"\/><\/p>\n<h3>X-XSS-Protection: 1; mode=block<\/h3>\n<p>  <\/p>\n<pre><code>http:\/\/localhost:1234\/?user=%3Cscript%3Ealert(%27hacked%27)%3C\/script%3E&xss=1;%20mode=block<\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u0442\u0430\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0430 \u043f\u0443\u0442\u0451\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/5e4\/0ab\/87f\/5e40ab87f2c5bd37b1ec01ab09a3151f.png\"\/><\/p>\n<h3>X-XSS-Protection: 1; report=http:\/\/localhost:1234\/report<\/h3>\n<p>  <\/p>\n<pre><code>http:\/\/localhost:1234\/?user=%3Cscript%3Ealert(%27hacked%27)%3C\/script%3E&xss=1;%20report=http:\/\/localhost:1234\/report<\/code><\/pre>\n<p>  \u0410\u0442\u0430\u043a\u0430 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0430 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/238\/cbf\/61c\/238cbf61cde686c134f704efc90ca2a6.png\"\/><\/p>\n<h1>X-Frame-Options<\/h1>\n<p>  \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u041a\u043b\u0438\u043a\u0434\u0436\u0435\u043a\u0438\u043d\u0433\u0430 [Clickjacking]. <\/p>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0443 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430 \u0435\u0441\u0442\u044c \u043a\u0430\u043d\u0430\u043b \u043d\u0430 YouTube \u0438 \u0435\u043c\u0443 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432. <\/p>\n<p>  \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u00ab\u041d\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0442\u044c\u00bb, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043d\u0430 \u043d\u0435\u0451 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0436\u043c\u0443\u0442. \u041d\u043e \u043f\u043e\u0432\u0435\u0440\u0445 \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 iframe \u0438 \u0432 \u044d\u0442\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0435 \u043f\u0440\u044f\u0447\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043a\u0430\u043d\u0430\u043b\u0430 \u0441 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u043d\u0430\u043b, \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u043d \u0431\u044b\u043b \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d \u0432 YouTube.<\/p>\n<p>  \u041f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u043e. <\/p>\n<p>  \u0421\u043f\u0435\u0440\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/ignore-x-frame-headers\/gleekbfjekiniecknbkamfmkohkpodhe\/\">\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435<\/a> \u0434\u043b\u044f \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430. <\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443.   <\/p>\n<pre><code>&lt;style&gt; button { background: red; color: white; padding: 10px 20px; border: none; cursor: pointer; } iframe { opacity: 0.8; z-index: 1; position: absolute; top: -570px; left: -80px; width: 500px; height: 650px; } &lt;\/style&gt;  &lt;button&gt;Do not click his button!&lt;\/button&gt; &lt;iframe src=&quot;https:\/\/youtu.be\/dQw4w9WgXcQ?t=3m33s&quot;&gt;&lt;\/iframe&gt;<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cd7\/ba1\/915\/cd7ba1915274453da06427b63af9bbd2.png\"\/><\/p>\n<p>  \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u044f \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b \u0444\u0440\u0435\u0439\u043c \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u043e\u0439 \u043f\u0440\u044f\u043c \u043d\u0430\u0434 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 (<b>z-index: 1<\/b>) \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0451 \u043d\u0430\u0436\u0430\u0442\u044c, \u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0430\u0436\u043c\u0451\u0442\u0441\u044f \u0444\u0440\u0435\u0439\u043c. \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0444\u0440\u0435\u0439\u043c \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u0435\u043d, \u043d\u043e \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <b>opacity: 0<\/b>.<\/p>\n<p>  \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0442\u0430\u043a\u043e\u0435 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 YouTube \u0437\u0430\u0434\u0430\u043d \u043d\u0443\u0436\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u043d\u043e \u0441\u043c\u044b\u0441\u043b \u0443\u0433\u0440\u043e\u0437\u044b, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043f\u043e\u043d\u044f\u0442\u0435\u043d. <\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a <b>X-Frame-Options<\/b>.<\/p>\n<p>  \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:  <\/p>\n<ul>\n<li><b>deny<\/b> \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u043e\u043e\u0431\u0449\u0435.<\/li>\n<li><b>sameorigin<\/b> \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442.<\/li>\n<li><b>allow-from: \u0414\u041e\u041c\u0415\u041d<\/b> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0435. <\/li>\n<\/ul>\n<p>  \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438  <\/p>\n<pre><code class=\"javascript\">var express = require('express')  for (let port of [1234, 4321]) {  \u00a0var app = express()  \u00a0app.use('\/iframe', (req, res) =&gt; res.send(`&lt;h1&gt;iframe&lt;\/h1&gt;&lt;iframe src=&quot;\/\/localhost:1234?h=${req.query.h || ''}&quot;&gt;&lt;\/iframe&gt;`))  \u00a0app.use((req, res) =&gt; {  \u00a0\u00a0\u00a0if (req.query.h) res.setHeader('X-Frame-Options', req.query.h)  \u00a0\u00a0\u00a0res.send('&lt;h1&gt;Website&lt;\/h1&gt;')  \u00a0})  \u00a0app.listen(port) }<\/code><\/pre>\n<p>  <\/p>\n<h3>\u0411\u0435\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430<\/h3>\n<p>  \u0412\u0441\u0435 \u0441\u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0448 \u0441\u0430\u0439\u0442 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <b>localhost:1234<\/b> \u0432\u043e \u0444\u0440\u0435\u0439\u043c. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/296\/987\/7e9\/2969877e936f709b69d6c7d44ae7f1d8.png\"\/><\/p>\n<h3>X-Frame-Options: deny<\/h3>\n<p>  \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0435. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/222\/a5a\/8d4\/222a5a8d448326802fb3a16281f2937d.png\"\/><\/p>\n<h3>X-Frame-Options: sameorigin<\/h3>\n<p>  \u0422\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0441\u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0432\u043e \u0444\u0440\u0435\u0439\u043c. \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0435\u0441\u043b\u0438 \u0434\u043e\u043c\u0435\u043d, \u043f\u043e\u0440\u0442 \u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f95\/25a\/78c\/f9525a78cc65a1aa5ef664b122f8bcac.png\"\/><\/p>\n<h3>X-Frame-Options: allow-from <a href=\"http:\/\/localhost\">localhost<\/a>:4321<\/h3>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e Chrome \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u043a\u0443\u044e \u043e\u043f\u0446\u0438\u044e, \u0442.\u043a. \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a Content-Security-Policy (\u043e \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435). \u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e \u0438 \u0432 Microsoft Edge. <\/p>\n<p>  \u041d\u0438\u0436\u0435 Mozilla Firefox.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ed9\/b6b\/2d1\/ed9b6b2d12c28d82040fd8ecfdff9132.png\"\/><\/p>\n<h1>X-Content-Type-Options<\/h1>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u0442\u0430\u043a\u0438 \u0441 \u043f\u043e\u0434\u043c\u0435\u043d\u043e\u0439 \u0442\u0438\u043f\u043e\u0432 MIME (<b>&lt;script src=\u00abscript.txt\u00bb&gt;<\/b>) \u0438\u043b\u0438 \u043d\u0435\u0441\u0430\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0445\u043e\u0442\u043b\u0438\u043d\u043a\u0430 (<b>&lt;script src=\u00abhttps:&sol;\/raw.githubusercontent.com\/user\/repo\/branch\/file.js\u00bb&gt;<\/b>)  <\/p>\n<pre><code class=\"javascript\">var express = require('express') var app = express()  app.use('\/script.txt', (req, res) =&gt; {  \u00a0if (req.query.h) res.header('X-Content-Type-Options', req.query.h)  \u00a0res.header('content-type', 'text\/plain')  \u00a0res.send('alert(&quot;hacked&quot;)') })  app.use((req, res) =&gt; {  \u00a0res.send(`&lt;h1&gt;Website&lt;\/h1&gt;&lt;script src=&quot;\/script.txt?h=${req.query.h || ''}&quot;&gt;&lt;\/script&gt;`) })  app.listen(1234) <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0411\u0435\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430<\/h3>\n<p>  <\/p>\n<pre><code>http:\/\/localhost:1234\/<\/code><\/pre>\n<p>  \u0425\u043e\u0442\u044c <b>script.txt<\/b> \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c \u0441 \u0442\u0438\u043f\u043e\u043c <b>text\/plain<\/b>, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043a\u0430\u043a \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6c1\/232\/9a3\/6c12329a31ba23eccadb7f7a4ef8ff02.png\"\/><\/p>\n<h3>X-Content-Type-Options: nosniff<\/h3>\n<p>  <\/p>\n<pre><code>http:\/\/localhost:1234\/?h=nosniff<\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0442\u0438\u043f\u044b \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/57e\/346\/af1\/57e346af1ea05595e4ebb33b0b5858c1.png\"\/><\/p>\n<h1>Content-Security-Policy<\/h1>\n<p>  \u042d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u043b\u043e\u0434\u043e\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0438\u0441\u043a\u0438 \u0430\u0442\u0430\u043a\u0438 XSS \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 \u043f\u0443\u0442\u0451\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0434\u0440\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. <\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c inline-\u0441\u043a\u0440\u043f\u0438\u0442\u044b \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430. Inline-\u0441\u043a\u0440\u043f\u0438\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a <b>&lt;script&gt;&#8230;&lt;\/script&gt;<\/b>, \u043d\u043e \u0438 \u043a\u0430\u043a <b>&lt;h1 onclick=&quot;&#8230;&quot;&gt;<\/b>.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.   <\/p>\n<pre><code class=\"javascript\">var request = require('request') var express = require('express')  for (let port of [1234, 4321]) {  \u00a0var app = express()  \u00a0app.use('\/script.js', (req, res) =&gt; {  \u00a0\u00a0\u00a0res.send(`document.querySelector('#${req.query.id}').innerHTML = '\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043e ${req.query.id}-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c'`)  \u00a0})  \u00a0app.use((req, res) =&gt; {  \u00a0\u00a0\u00a0var csp = req.query.csp  \u00a0\u00a0\u00a0if (csp) res.header('Content-Security-Policy', csp)  \u00a0\u00a0\u00a0res.send(`  \u00a0\u00a0\u00a0\u00a0\u00a0&lt;html&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0&lt;body&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;h1&gt;Hello, ${req.query.user || 'anonymous'}&lt;\/h1&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;p id=&quot;inline&quot;&gt;\u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043e inline-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c?&lt;\/p&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;p id=&quot;origin&quot;&gt;\u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043e origin-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c?&lt;\/p&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;p id=&quot;remote&quot;&gt;\u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043e remote-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c?&lt;\/p&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;script&gt;document.querySelector('#inline').innerHTML = '\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043e inline-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c'&lt;\/script&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;script src=&quot;\/script.js?id=origin&quot;&gt;&lt;\/script&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;script src=&quot;\/\/localhost:1234\/script.js?id=remote&quot;&gt;&lt;\/script&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/body&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/html&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0`)  \u00a0})  \u00a0app.listen(port) }<\/code><\/pre>\n<p>  <\/p>\n<h3>\u0411\u0435\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430<\/h3>\n<p>  \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a, \u043a\u0430\u043a \u0432\u044b \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u0438<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/4eb\/5ba\/20e\/4eb5ba20e0edc142d395ac8f5f5ff54d.png\"\/><\/p>\n<h3>Content-Security-Policy: default-src &#8216;none&#8217;<\/h3>\n<p>  <\/p>\n<pre><code>http:\/\/localhost:4321\/?csp=default-src%20%27none%27&user=%3Cscript%3Ealert(%27hacked%27)%3C\/script%3E<\/code><\/pre>\n<p>  <b>default-src<\/b> \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0444\u0440\u0435\u0439\u043c\u044b \u0438 \u0442.\u0434.), \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <b>&#8216;none&#8217;<\/b> \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0451. \u041d\u0438\u0436\u0435 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/936\/d51\/002\/936d51002cfc365c016621841ab273c6.png\"\/><br \/>  Chrome \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c <b>favicon.ico<\/b>.<\/p>\n<h3>Content-Security-Policy: default-src &#8216;self&#8217;<\/h3>\n<p>  <\/p>\n<pre><code>http:\/\/localhost:4321\/?csp=default-src%20%27self%27&user=%3Cscript%3Ealert(%27hacked%27)%3C\/script%3E<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430, \u043d\u043e \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0438 inline-\u0441\u043a\u0440\u0438\u043f\u0442\u044b. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f53\/54b\/3c9\/f5354b3c9f4a563574325d824e125bc3.png\"\/><\/p>\n<h3>Content-Security-Policy: default-src &#8216;self&#8217;; script-src &#8216;self&#8217; &#8216;unsafe-inline&#8217;<\/h3>\n<p>  <\/p>\n<pre><code>http:\/\/localhost:4321\/?csp=default-src%20%27self%27;%20script-src%20%27self%27%20%27unsafe-inline%27&user=%3Cscript%3Ealert(%27hacked%27)%3C\/script%3E<\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438 inline-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e XSS \u0430\u0442\u0430\u043a\u0430 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0442\u043e\u0436\u0435 \u0431\u044b\u043b\u0430 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0430. \u041d\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0435\u0441\u043b\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438 <b>unsafe-inline<\/b>, \u0438 <b>X-XSS-Protection: 0<\/b>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2d0\/53d\/e65\/2d053de65445f00fdeb2a81fd3a578f6.png\"\/><\/p>\n<h3>\u0414\u0440\u0443\u0433\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/h3>\n<p>  \u041d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/content-security-policy.com\/\">content-security-policy.com<\/a> \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<ul>\n<li><b>default-src &#8216;self&#8217;<\/b> \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430  <\/li>\n<li><b>script-src &#8216;self&#8217; <a href=\"http:\/\/www.google-analytics.com\">www.google-analytics.com<\/a> ajax.googleapis.com<\/b> \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442 Google Analytics, Google AJAX CDN \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430.  <\/li>\n<li><b>default-src &#8216;none&#8217;; script-src &#8216;self&#8217;; connect-src &#8216;self&#8217;; img-src &#8216;self&#8217;; style-src &#8216;self&#8217;;<\/b> \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0441\u043a\u0440\u0438\u043f\u0442\u044b, AJAX \u0438 CSS \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u0433\u0443 \u043b\u044e\u0431\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0441\u0430\u0439\u0442\u043e\u0432 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430.   <\/li>\n<\/ul>\n<p>  \u042f \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b, \u043d\u043e \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u044b:  <\/p>\n<ul>\n<li><b>frame-ancestors &#8216;none&#8217;<\/b> \u0438 <b>X-Frame-Options: deny<\/b>  <\/li>\n<li><b>frame-ancestors &#8216;self&#8217;<\/b> \u0438 <b>X-Frame-Options: sameorigin<\/b>  <\/li>\n<li><b>frame-ancestors localhost:4321<\/b> \u0438 <b>X-Frame-Options: allow-from <a href=\"http:\/\/localhost\">localhost<\/a>:4321<\/b>  <\/li>\n<li><b>script-src &#8216;self&#8217;<\/b> \u0431\u0435\u0437 <b>&#8216;unsafe-inline&#8217;<\/b> \u0438 <b>X-XSS-Protection: 1<\/b>  <\/li>\n<\/ul>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 facebook.com \u0438\u043b\u0438 twitter.com, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u0438 \u0441\u0430\u0439\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043c\u043d\u043e\u0433\u043e CSP.<\/p>\n<h1>Strict-Transport-Security<\/h1>\n<p>  HTTP Strict Transport Security (HSTS) \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u0441\u0430\u0439\u0442 \u043e\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f. <\/p>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a <b>facebook.com<\/b>. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0431\u0440\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c <b>https:\/\/<\/b>, \u0442\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d HTTP \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u043a <b><a href=\"http:\/\/facebook.com\">facebook.com<\/a><\/b>.  <\/p>\n<pre><code class=\"bash\">$ curl -I facebook.com HTTP\/1.1 301 Moved Permanently Location: https:\/\/facebook.com\/<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Facebook.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 WiFi \u0442\u043e\u0447\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0443, \u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d \u0438 \u0432\u043c\u0435\u0441\u0442\u043e facebook.com \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c. <\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0430\u0442\u0430\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043a\u0430\u0436\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <b>https<\/b> \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0430\u0439\u0442\u0430.  <\/p>\n<pre><code class=\"bash\">$ curl -I https:\/\/www.facebook.com\/ HTTP\/1.1 200 OK Strict-Transport-Security: max-age=15552000; preload<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u044b\u043b \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d \u0432 Facebook \u0434\u043e\u043c\u0430, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0435\u0433\u043e \u0438\u0437 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0442\u043e \u0435\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u0433\u0440\u043e\u0436\u0430\u0435\u0442, \u0442.\u043a. \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442 \u044d\u0442\u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a. <\/p>\n<p>  \u041d\u043e \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437? \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. <\/p>\n<p>  \u041d\u043e \u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 \u0435\u0441\u0442\u044c \u043a\u043e\u0437\u044b\u0440\u044c \u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439. \u0412 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u043c\u0435\u043d\u043e\u0432, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e HTTPS.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d \u043f\u043e <a href=\"https:\/\/hstspreload.appspot.com\/\">\u044d\u0442\u043e\u043c\u0443<\/a> \u0430\u0434\u0440\u0435\u0441\u0443. \u0422\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a.<\/p>\n<p>  \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:  <\/p>\n<ul>\n<li><b>max-age=15552000<\/b> \u0432\u0440\u0435\u043c\u044f, \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435.  <\/li>\n<li><b>includeSubDomains<\/b> \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u043d\u0430 \u0432\u0441\u0435 \u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u044b.   <\/li>\n<li><b>preload<\/b> \u0435\u0441\u043b\u0438 \u0432\u043b\u0430\u0434\u0435\u043b\u0435\u0446 \u0441\u0430\u0439\u0442\u0430 \u0445\u043e\u0447\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u043c\u0435\u043d \u043f\u043e\u043f\u0430\u043b \u0432 \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 Chrome (\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 Firefox \u0438 Safari).  <\/li>\n<\/ul>\n<p>  \u0410 \u0435\u0441\u043b\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 HTTP \u043f\u0435\u0440\u0435\u0434 \u0441\u0440\u043e\u043a\u043e\u043c \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044f <b>max-age<\/b> \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d <b>preload<\/b>? \u041d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u042d\u0442\u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0433\u043e \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. <\/p>\n<h1>Public-Key-Pins<\/h1>\n<p>  HTTP Public Key Pinning (HPKP) \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 HTTPS \u0441\u0430\u0439\u0442\u0430\u043c \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430\u043c\u0438 \u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043b\u0438 \u043e\u0431\u043c\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432.<\/p>\n<p>  \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:  <\/p>\n<ul>\n<li><b>pin-sha256=&quot;&lt;sha256&gt;&quot;<\/b> \u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u0445 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Base64 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043e\u043a Subject Public Key Information (SPKI). \u041c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u043c\u0438\u043c\u043e SHA-256.  <\/li>\n<li><b>max-age=&lt;seconds&gt;<\/b> \u0432\u0440\u0435\u043c\u044f, \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0447\u0442\u043e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0430\u0439\u0442\u0443 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438.  <\/li>\n<li><b>includeSubDomains<\/b> \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u043d\u0430 \u0432\u0441\u0435 \u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u044b.  <\/li>\n<li><b>report-uri=&quot;&lt;URL&gt;&quot;<\/b> \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c URL, \u0442\u043e \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043b\u044e\u0447\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.   <\/li>\n<\/ul>\n<p>  \u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 <b>Public-Key-Pins<\/b> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <b>Public-Key-Pins-Report-Only<\/b>, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439, \u043d\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. <\/p>\n<p>  \u0422\u0430\u043a \u0434\u0435\u043b\u0430\u0435\u0442 Facebook:  <\/p>\n<pre><code class=\"bash\">$ curl -I https:\/\/www.facebook.com\/ HTTP\/1.1 200 OK ... Public-Key-Pins-Report-Only:   \u00a0\u00a0\u00a0\u00a0\u00a0max-age=500;   \u00a0\u00a0\u00a0\u00a0\u00a0pin-sha256=&quot;WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=&quot;;   \u00a0\u00a0\u00a0\u00a0\u00a0pin-sha256=&quot;r\/mIkG3eEpVdm+u\/ko\/cwxzOMo1bk4TyHIlByibiA5E=&quot;;   \u00a0\u00a0\u00a0\u00a0\u00a0pin-sha256=&quot;q4PO2G2cbkZhZ82+JgmRUyGMoAeozA+BSXVXQWB8XWQ=&quot;;   \u00a0\u00a0\u00a0\u00a0\u00a0report-uri=&quot;http:\/\/reports.fb.com\/hpkp\/&quot;<\/code><\/pre>\n<p>  \u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e? \u041d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u0446\u0435\u043d\u0442\u0440\u043e\u0432 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 (CA)?<\/p>\n<p>  \u0417\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f facebook.com \u0438 \u043f\u0443\u0442\u0451\u043c \u043e\u0431\u043c\u0430\u043d\u0430 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0432\u043e\u0451 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u043b\u0438\u0431\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c.<\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f facebook.  <\/p>\n<pre><code class=\"bash\">sudo mkdir \/etc\/certs echo -e 'US\\nCA\\nSF\\nFB\\nXX\\nwww.facebook.com\\nno@spam.org' | \\  \u00a0sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \\  \u00a0\u00a0\u00a0-keyout \/etc\/certs\/facebook.key \\  \u00a0\u00a0\u00a0-out \/etc\/certs\/facebook.crt<\/code><\/pre>\n<p>  \u0418 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u043c \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.  <\/p>\n<pre><code class=\"bash\"># curl sudo cp \/etc\/certs\/*.crt \/usr\/local\/share\/ca-certificates\/ sudo update-ca-certificates # Google Chrome sudo apt install libnss3-tools -y certutil -A -t &quot;C,,&quot; -n &quot;FB&quot; -d sql:$HOME\/.pki\/nssdb -i \/etc\/certs\/facebook.crt # Mozilla Firefox #certutil -A -t &quot;CP,,&quot; -n &quot;FB&quot; -d sql:`ls -1d $HOME\/.mozilla\/firefox\/*.default | head -n 1` -i \/etc\/certs\/facebook.crt<\/code><\/pre>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u043e\u0442 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442.  <\/p>\n<pre><code class=\"javascript\">var fs = require('fs') var https = require('https') var express = require('express')  var options = {  \u00a0key: fs.readFileSync(`\/etc\/certs\/${process.argv[2]}.key`),  \u00a0cert: fs.readFileSync(`\/etc\/certs\/${process.argv[2]}.crt`) }  var app = express() app.use((req, res) =&gt; res.send(`&lt;h1&gt;hacked&lt;\/h1&gt;`)) https.createServer(options, app).listen(443)<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440  <\/p>\n<pre><code class=\"bash\">echo 127.0.0.1 www.facebook.com | sudo tee -a \/etc\/hosts sudo node server.js facebook<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c  <\/p>\n<pre><code class=\"bash\">$ curl https:\/\/www.facebook.com &lt;h1&gt;hacked&lt;\/h1&gt;<\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e. <b>curl<\/b> \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442. <\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0437\u0430\u0445\u043e\u0434\u0438\u043b \u043d\u0430 Facebook \u0438 Google Chrome \u0432\u0438\u0434\u0435\u043b \u0435\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0442\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e\u0431 \u0430\u0442\u0430\u043a\u0435 \u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0442\u0430\u043a?<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/8bb\/143\/0dc\/8bb1430dc8d261f0b541f16176906c80.png\"\/><\/p>\n<p>  \u041d\u0435\u0430. \u041a\u043b\u044e\u0447\u0438 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438\u0441\u044c \u0438\u0437-\u0437\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 [Public-key pinning bypassed]. \u042d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u2026 <\/p>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u0430 \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0451\u0442 <a href=\"http:\/\/www.google.com\">www.google.com<\/a>?  <\/p>\n<pre><code class=\"bash\">echo -e 'US\\nCA\\nSF\\nGoogle\\nXX\\nwww.google.com\\nno@spam.org' | \\  \u00a0sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \\  \u00a0\u00a0\u00a0-keyout \/etc\/certs\/google.key \\  \u00a0\u00a0\u00a0-out \/etc\/certs\/google.crt sudo cp \/etc\/certs\/*.crt \/usr\/local\/share\/ca-certificates\/ sudo update-ca-certificates certutil -A -t &quot;C,,&quot; -n &quot;Google&quot; -d sql:$HOME\/.pki\/nssdb -i \/etc\/certs\/google.crt echo 127.0.0.1 www.google.com | sudo tee -a \/etc\/hosts sudo node server.js google<\/code><\/pre>\n<p>  \u0422\u043e\u0442 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0414\u0443\u043c\u0430\u044e \u044d\u0442\u043e \u0444\u0438\u0447\u0430. <\/p>\n<p>  \u041d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u044d\u0442\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u0430\u0439\u0442\u044b \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043f\u0446\u0438\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432 Chrome \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432 Firefox \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/dae\/d44\/06c\/daed4406c111ea9c96d3d12b04a7d5dc.png\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/0a2\/b0d\/1b2\/0a2b0d1b2fe197e341551ccc8aef667b.png\"\/><\/p>\n<h1>Content-Encoding: br<\/h1>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u0441\u0436\u0430\u0442\u044b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/github.com\/google\/brotli\">Brotli<\/a>.<\/p>\n<p>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435\u0435 \u0441\u0436\u0430\u0442\u0438\u0435 \u0447\u0435\u043c gzip \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. <a href=\"https:\/\/www.chromestatus.com\/feature\/5420797577396224\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f Google Chrome<\/a>.<\/p>\n<p>  \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0432 node.js.   <\/p>\n<pre><code class=\"javascript\">var shrinkRay = require('shrink-ray') var request = require('request') var express = require('express')  request('https:\/\/www.gutenberg.org\/files\/1342\/1342-0.txt', (err, res, text) =&gt; {  \u00a0if (err) throw new Error(err)  \u00a0var app = express()  \u00a0app.use(shrinkRay())  \u00a0app.use((req, res) =&gt; res.header('content-type', 'text\/plain').send(text))  \u00a0app.listen(1234) })<\/code><\/pre>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440: 700 \u041a\u0431<br \/>  Brotli: 204 \u041a\u0431<br \/>  Gzip: 241 \u041a\u0431<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6d9\/e38\/d00\/6d9e38d008f7f6b59bde1db852c407ec.png\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d1b\/bf0\/784\/d1bbf0784fee4c85257cd33856752340.png\"\/><\/p>\n<h1>Timing-Allow-Origin<\/h1>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Resource_Timing_API\/Using_the_Resource_Timing_API\">Resource Timing API<\/a> \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u043d\u044f\u043b\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. \u00a0<\/p>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0441\u0435\u0449\u0430\u043b \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0434\u043e \u044d\u0442\u043e\u0433\u043e (\u043e\u0431\u0440\u0430\u0449\u0430\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f), \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u044b\u043c, \u0435\u0441\u043b\u0438 \u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043b\u044e\u0431\u044b\u043c \u0445\u043e\u0441\u0442\u0430\u043c.   <\/p>\n<pre><code>&lt;script&gt; setTimeout(function() {  \u00a0console.log(window.performance.getEntriesByType('resource')) }, 1000) &lt;\/script&gt;  &lt;img src=&quot;http:\/\/placehold.it\/350x150&quot;&gt; &lt;img src=&quot;\/local.gif&quot;&gt;<\/code><\/pre>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c <b>Timing-Allow-Origin<\/b>, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 (\u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043e\u043c\u0435\u043d\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440) \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6cd\/347\/6e5\/6cd3476e538418ad2b4a10333b96cbea.png\"\/><\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:  <\/p>\n<ul>\n<li>Timing-Allow-Origin: *  <\/li>\n<li>Timing-Allow-Origin: <a href=\"http:\/\/foo.com\">foo.com<\/a> <a href=\"http:\/\/bar.com\">bar.com<\/a>  <\/li>\n<\/ul>\n<h1>Alt-Svc<\/h1>\n<p>  \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0421\u0435\u0440\u0432\u0438\u0441\u044b [Alternative Services] \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u0441\u0435\u0442\u0438 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430. <\/p>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 Google:  <\/p>\n<ul>\n<li>alt-svc: quic=&quot;:443&quot;; ma=2592000; v=\u00ab36,35,34\u00bb  <\/li>\n<\/ul>\n<p>  \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0435\u0441\u043b\u0438 \u0437\u0430\u0445\u043e\u0447\u0435\u0442, \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/ma.ttias.be\/googles-quic-protocol-moving-web-tcp-udp\/\">QUIC<\/a>, \u044d\u0442\u043e HTTP \u043d\u0430\u0434 UDP, \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442 443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 30 \u0434\u043d\u0435\u0439 (ma = 2592000 \u0441\u0435\u043a\u0443\u043d\u0434, \u0438\u043b\u0438 720 \u0447\u0430\u0441\u043e\u0432, \u0442.\u0435 30 \u0434\u043d\u0435\u0439). \u041f\u043e\u043d\u044f\u0442\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u044e \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b>v<\/b>, \u0432\u0435\u0440\u0441\u0438\u044f?<\/p>\n<h1>P3P<\/h1>\n<p>  \u041d\u0438\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e P3P \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b:  <\/p>\n<ul>\n<li>P3P: CP=\u00abThis is not a P3P policy! See <a href=\"https:\/\/support.google.com\/accounts\/answer\/151657?hl=en\">support.google.com\/accounts\/answer\/151657?hl=en<\/a> for more info.\u00bb  <\/li>\n<li>P3P: CP=\u00abFacebook does not have a P3P policy. Learn why here: <a href=\"http:\/\/fb.me\/p3p\">fb.me\/p3p<\/a>\u00bb  <\/li>\n<\/ul>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442, \u0447\u0442\u043e\u0431\u044b cookies \u0442\u0440\u0435\u0442\u044c\u0438\u0445 \u043b\u0438\u0446 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b P3P \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. <\/p>\n<p>  \u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f, \u043e\u0441\u043d\u043e\u0432\u0430\u0432\u0448\u0430\u044f P3P, \u041a\u043e\u043d\u0441\u043e\u0440\u0446\u0438\u0443\u043c \u0412\u0441\u0435\u043c\u0438\u0440\u043d\u043e\u0439 \u043f\u0430\u0443\u0442\u0438\u043d\u044b (W3C), \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0434 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u043d\u0435 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, P3P \u0443\u0441\u0442\u0430\u0440\u0435\u043b \u0438 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0441\u0435\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0430\u0439\u0442\u043e\u0432 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 P3P.<\/p>\n<p>  \u042f \u043d\u0435 \u0441\u0442\u0430\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f, \u043d\u043e \u0432\u0438\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f IE8 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c cookies \u0442\u0440\u0435\u0442\u044c\u0438\u0445 \u043b\u0438\u0446.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432 IE \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0441\u043e\u043a\u0430\u044f, \u0442\u043e \u0432\u0441\u0435 cookies \u0441 \u0441\u0430\u0439\u0442\u043e\u0432, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0439 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0431\u0443\u0434\u0443\u0442 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u043d\u043e \u0442\u0435 \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043d\u0430 \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435, \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442.<br \/> \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\/317720\/\"> https:\/\/habrahabr.ru\/post\/317720\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/0e9\/205\/ad6\/0e9205ad6abaf074912779548ad43610.png\"\/><br \/>  \u041f\u0440\u0438\u0432\u0435\u0442 \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440, <\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u0438 \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u043d\u044b\u0445 HTTP \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e.   <\/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-282595","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282595","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=282595"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282595\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}