Rule Definition
In Node.js, enable X-XSS-Protection to enable the Cross-site scripting (XSS) filter in most recent web browsers.
Remediation
Ensure you have enabled the X-XSS-Protection in your express instance or use third-party helmet package
Violation Code Sample
var express = require('express');
var app = express();
app.listen(3000);
Fixed Code Sample
var express = require('express');
var app = express();
var xssFilter = require('x-xss-protection')
app.use(xssFilter())
// or with helmet
var helmet = require('helmet');
app.use(helmet())
app.listen(3000);
Reference
https://expressjs.com/en/advanced/best-practice-security.html
https://www.owasp.org/index.php/XSS
Related Technologies
Technical Criterion
Secure Coding - Input Validation
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.