Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

262
Vistas
Express js Sanitize does not work (Express-validate)

I want to sanitize my user inputs, so that no xss is possible. I know that this works in PHP which is why it has to somehow work in node js aswell. I want to remove htmlchars, stripslashes and trim the userinput, but it somehow does not work.

I've tried express-validate, but with no effect at all. I've also tried express-sanitizer, which also did not work. And the I also tried a module called xss which didn't work aswell.

Can anyone help?

routing js:

router.post('/register', function(req, res, next) {
  let regemail = req.body.EMailRegister,
      reguser = req.body.UsernameRegister,
      regpass = req.body.PasswordRegister,
      regpassre = req.body.RepeatPasswordRegister;

I want to sanitize those variables, but it won't work.

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda