Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!