X-XSS-Protection Not Implemented

Published on 19 Jun 2018
1 min read
Vulnerability
X-XSS-Protection

The X-XSS-Protection response header is one of the major feature of Internet Explorer, Chrome and Safari to stop cross-site scripting. It stops the pages from loading, when they detect reflected cross-site scripting attacks. In this webpage X-XSS-Protection header is not found.The X-XSS-Protection header is designed to enable the cross-site scripting filter, which is builtin to modern web browsers.This vulnerablility exposes the application to a Cross site Scripting attacks.

    X-XSS-Protection: 0                              # Disable XSS filtering
    X-XSS-Protection: 1                              # Enables filtering. If cross site scripting detected - the browser will sanitise
    X-XSS-Protection: 1; mode=block                  # Under this mode, when cross site scripting detected - the browser wont render the page
    X-XSS-Protection: 1; report=<reporting-uri>        # Enables filtering, when detected - the browser will sanitise and report the violation

  

Example

    X-XSS-Protection: 1; mode=block

  

Impact

The major impact for this violation is cross-scripting attacks.

Mitigation / Precaution

The only mitigation is to enable the X-XSS-Protection and set the value to 1.

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";

  
Sooraj V Nair
Written by
Cyber Security Engineer

Sooraj was probably the kid who opened up a remote control just to see what was inside, then had to figure out how to put it back together before anyone noticed. That curiosity eventually found its way into cybersecurity, where breaking things is actually part of the job description. Today, he explores vulnerabilities, analysis threats, and helps build safer digital spaces. His favourite question remains the same: “What happens if I try this?”

Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 14 days
4.8 on G2 • ISO 27001 certified
See How Beagle Security Works
No credit card • No setup required
Launch interactive demo