Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda