【发布时间】:2021-09-24 19:51:34
【问题描述】:
我总是在 exprees 路由器中看到 checkmarx XSS 漏洞,不知道用什么其他功能来修复它。我使用了 express 验证器,但到目前为止没有运气。
const express = require("express");
const router = express.Router();
const { body, validationResult } = require("express-validator");
router.post(
`/testData`,
body("empName").trim().escape().not().isEmpty(),
async (req, res, next) => {
try {
//getting checkmarx xss reflected vulnerability at req.body
const callTags = req.body
const errors = validationResult(req);
if (!errors.isEmpty()) {
return res.status(400).json({ errors: errors.array() });
}
res.status(response.statusCode).json(''hello);
} catch (ex) {
next(ex);
}
}
);
module.exports = router;
}
【问题讨论】:
标签: node.js express xss checkmarx