diff options
Diffstat (limited to 'files/it/web/http/headers/x-xss-protection/index.html')
| -rw-r--r-- | files/it/web/http/headers/x-xss-protection/index.html | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/files/it/web/http/headers/x-xss-protection/index.html b/files/it/web/http/headers/x-xss-protection/index.html new file mode 100644 index 0000000000..89ef4c0bc2 --- /dev/null +++ b/files/it/web/http/headers/x-xss-protection/index.html @@ -0,0 +1,90 @@ +--- +title: X-XSS-Protection +slug: Web/HTTP/Headers/X-XSS-Protection +tags: + - HTTP + - Sicurezza + - XSS + - header +translation_of: Web/HTTP/Headers/X-XSS-Protection +--- +<div>{{HTTPSidebar}}</div> + +<p>L'header HTTP di risposta <strong><code>X-XSS-Protection</code></strong> è una funzionalità di Internet Explorer, Chrome e Safari che impedisce alle pagine di caricarsi quando rilevano attacchi di tipo cross-site scripting reflected ({{Glossary("XSS")}}). Anche se queste protezioni sono largamente non necessarie nei browser moderni, quando i siti web implementano una {{HTTPHeader("Content-Security-Policy")}} restrittiva che disabilita l'uso di JavaScript inline (<code>'unsafe-inline'</code>), possono ancora fornire protezione agli utenti di browser datati che non supportano {{Glossary("CSP")}}.</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">Header type</th> + <td>{{Glossary("Response header")}}</td> + </tr> + <tr> + <th scope="row">{{Glossary("Forbidden header name")}}</th> + <td>no</td> + </tr> + </tbody> +</table> + +<h2 id="Sintassi">Sintassi</h2> + +<pre class="syntaxbox">X-XSS-Protection: 0 +X-XSS-Protection: 1 +X-XSS-Protection: 1; mode=block +X-XSS-Protection: 1; report=<reporting-uri> +</pre> + +<dl> + <dt>0</dt> + <dd>Disabilita il filtro XSS.</dd> + <dt>1</dt> + <dd>Ablita il filtro XSS (solitamente il valore di default dei browser). Se un attacco di tipo cross-site scripting viene rilevato, il browser sanitizzerà la pagina web (rimuovendo il contenuto non sicuro).</dd> + <dt>1; mode=block</dt> + <dd>Abilita il filtro XSS. Piuttosto che sanitizzare la pagina web, il browser eviterà di mostrare la pagina quando un attacco viene rilevato.</dd> + <dt>1; report=<reporting-URI> (Solo Chromium)</dt> + <dd>Abilita il filtro XSS. Se un attacco di tipo cross-site scripting viene rilevato, il browser sanitizzerà la pagina e riporterà la violazione. Questo sistema utilizza la funzionalità della direttiva CSP {{CSP("report-uri")}} per segnalare la violazione.</dd> +</dl> + +<h2 id="Esempio">Esempio</h2> + +<p>Impedisce alle pagine di caricare quando viene rilevato un attacco di tipo XSS reflected:</p> + +<pre class="brush: bash">X-XSS-Protection: 1; mode=block</pre> + +<p>PHP</p> + +<pre class="brush: php">header("X-XSS-Protection: 1; mode=block");</pre> + +<p>Apache (.htaccess)</p> + +<pre class="brush: bash"><IfModule mod_headers.c> + Header set X-XSS-Protection "1; mode=block" +</IfModule></pre> + +<p>Nginx</p> + +<pre class="brush: bash">add_header "X-XSS-Protection" "1; mode=block";</pre> + +<h2 id="Specifiche">Specifiche</h2> + +<p>Non parte di nessuna specifica o bozza.</p> + +<h2 id="Compatibilità_Browser"><font face="x-locale-heading-primary, zillaslab, Palatino, Palatino Linotype, x-locale-heading-secondary, serif"><span style="font-size: 40px;"><strong>Compatibilità Browser</strong></span></font></h2> + +<p> </p> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("http.headers.X-XSS-Protection")}}</p> + +<h2 id="Vedi_anche"><font face="x-locale-heading-primary, zillaslab, Palatino, Palatino Linotype, x-locale-heading-secondary, serif"><span style="font-size: 40px;"><strong>Vedi anche</strong></span></font></h2> + +<ul> + <li>{{HTTPHeader("Content-Security-Policy")}}</li> + <li><a href="https://blogs.msdn.microsoft.com/ieinternals/2011/01/31/controlling-the-xss-filter/">Controlling the XSS Filter – Microsoft</a></li> + <li><a href="https://www.virtuesecurity.com/blog/understanding-xss-auditor/">Understanding XSS Auditor – Virtue Security</a></li> + <li> + <p><a href="http://blog.innerht.ml/the-misunderstood-x-xss-protection/">The misunderstood X-XSS-Protection – blog.innerht.ml</a></p> + </li> +</ul> + +<p> </p> |
