mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-18 21:21:03 +02:00
15 lines
544 B
JavaScript
15 lines
544 B
JavaScript
// Cross-file sanitizer applied before a sink: no XSS finding expected.
|
|||
// The cross-file summary path already recognises encodeURIComponent
|
|||
// as a sanitizer; the regression guard here is that cross-file inline
|
|||
// re-analysis does not *introduce* a finding by mis-resolving taint.
|
|||
|
|||
const { xssSafe } = require('./security');
|
|||
const express = require('express');
|
|||
const app = express();
|
|||
|
|||
app.get('/profile', function (req, res) {
|
|||
const name = req.query.name;
|
|||
const clean = xssSafe(name);
|
|||
res.send('<h1>Hello ' + clean + '</h1>');
|
|||
});
|