--- title: X-XSS-Protection slug: Web/HTTP/Headers/X-XSS-Protection translation_of: Web/HTTP/Headers/X-XSS-Protection ---
HTTP X-XSS-Protection
헤더는 Internet Explorer, Chrome 및 Safari에서 제공하는 기능으로서, ({{Glossary("XSS")}}) 공격을 감지 할 때 페이지 로드를 중지시킬 수 있습니다. 최신 브라우저에서는 Inline Javascript('unsafe-inline')
사용을 못하게 하는 CSP(Content-Security-Policy) 보호기능이 있으나, 해당 기능을 지원하지 않는 구형 웹브라우저에서 사용자를 보호 할수 있는 기능을 제공할 수 있습니다.
Header type | {{Glossary("Response header")}} |
---|---|
{{Glossary("Forbidden header name")}} | no |
X-XSS-Protection: 0 X-XSS-Protection: 1 X-XSS-Protection: 1; mode=block X-XSS-Protection: 1; report=<reporting-uri>
XSS 공격을 감지하면 페이지로드를 차단합니다.
X-XSS-Protection: 1; mode=block
PHP
header("X-XSS-Protection: 1; mode=block");
Apache (.htaccess)
<IfModule mod_headers.c> Header set X-XSS-Protection "1; mode=block" </IfModule>
Nginx
add_header "X-XSS-Protection" "1; mode=block";
Not part of any specifications or drafts.
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
{{Compat("http.headers.X-XSS-Protection")}}