Заголовок X-XSS-Protection не определен - PullRequest
2 голосов
/ 18 января 2020

Я только что добавил эти 2 строки в код своего сервера

header('X-Content-Type-Options: nosniff');
header('x-xss-protection: 1; mode=block');

Я сканирую свой сайт, используя Nikto, но все еще вижу в этом проблемы.

- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target Port:        443
+ Start Time:         2020-01-18 14:54:02 (GMT-5)
---------------------------------------------------------------------------
+ Server: cloudflare
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type

Эти 2 ошибки

  • Заголовок X-XSS-Protection не определен. Этот заголовок может служить подсказкой пользовательскому агенту для защиты от некоторых форм XSS
  • . Заголовок X-Content-Type-Options не задан. Это может позволить агенту пользователя отображать содержимое сайта иначе, чем MIME-тип

Это ложный отчет? или мой синтаксис неправильный


Обновление

⚡️  Desktop  curl -I app.com
HTTP/1.1 301 Moved Permanently
Date: Sat, 18 Jan 2020 20:17:26 GMT
Content-Type: text/html; charset=iso-8859-1
Connection: keep-alive
Set-Cookie: __cfduid=de78c7d75c4277a60649fb1d63d00ac531579378646; expires=Mon, 17-Feb-20 20:17:26 GMT; path=/; domain=.app.com; HttpOnly; SameSite=Lax
Location: https://app.com/
CF-Cache-Status: DYNAMIC
Server: cloudflare
CF-RAY: 5573409b9a45f051-EWR
...