on-internet
← Community

This can enable a Reflected Cross-Site Scripting (XSS) attack

Stack Overflow ·

I have this code: const implementation = async (req, res, next) => { const rut = req.user && req.user.nickname.toUpperCase(); const data = req.body; // ERROR !!! if (!rut || !data) res.send(400, {message: 'Error al recibir los datos'}); let MetaData = await UserMetadata.findOneAndUpdate({rut}, {emergencyContact: data}, {new: true}); if (!MetaData) res.send(400, {message: 'Ha ocurrido un error'}); return res.send(200, MetaData); }; Codegate is giving me a security error in the line 3: The application's async embeds untrusted data in the generated output with send, at line 3 of "my file". This u

Comments

Sign in or sign up to comment and upvote.

No comments yet.