Skip to content

X-XSS-Protection Header Set to 0

Description

The X-XSS-Protection header is set to 0, which disables the browser's XSS Filter. This could make the application more vulnerable to cross-site scripting attacks.

Examples

Insecure Code

javascript
res.header('X-XSS-Protection', 0);

Secure Code

javascript
res.header('X-XSS-Protection', '1; mode=block');

Remediation

Set the X-XSS-Protection header to '1; mode=block' to enable the browser's XSS Filter.

Rule Details

FieldValue
IDCODE-0398
CategoryWeb
SeverityMEDIUM
CWECWE-358
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityEASY
TagsXSS, Security Misconfiguration
OWASPA6:2017-Security Misconfiguration, A05:2021-Security Misconfiguration