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

224
Views
Vulnerability with node EJS package?

I would like to know if it is safe to use EJS in a Node Express web server, to let users create customizable content, that would be then rendered server side by EJS (https://www.npmjs.com/package/ejs).

For instance, a user could create a template where he would specify {%= product.category %} in a product description webpage.

But then, he could specify {%= process.exit(0) %} which would cause the web server to exit! He could also get access to the server file system, I guess.

One way to add some security would be to specify { process: null } in the context parameter of the render method, but I imagine there are many other dangerous entries?

So is it safe to do this? Are there some workarounds (maybe some EJS options, but I did not see them)? Or some alternative packages?

Edit: I have found the following issue on the package repository: https://github.com/mde/ejs/issues/632 which recommends not using EJS for such a use case.

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!