ZAP でアプリケーションをスキャンしているときに、以下のエラーが発生します。
Web Browser XSS Protection is not enabled, or is disabled by the configuration of the 'X-XSS-Protection' HTTP response header on the web server
CWE ID: 933
WASC ID: 14
web.config ファイルにプロパティを追加してヘッダー プロパティ 'X-XSS-Protection' を有効にすると、エラーは解決します。
しかし、私の要件として、Webページ自体からこれを行う必要があります。
サーバーまたはクライアント サイトからヘッダーを追加する方法はありますか?
以下のコードで試しましたが、動作しません。
Response.Headers.Add("X-XSS-Protection", "1");
HttpContext.Current.Response.Headers["X-XSS-Protection"] = "1";