Vulnerability library
Security checkJanuary 30, 2023

ejs template injection vulnerability

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

High severitynpmejs

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

The ejs (aka Embedded JavaScript templates) package 3.1.6 for Node.js allows server-side template injection in settings[view options][outputFunctionName]. This is parsed as an internal option, and overwrites the outputFunctionName option with an arbitrary OS command (which is executed upon template compilation).

Recommendation

Update the ejs package to the latest compatible version. Followings are version details:

  • Affected version(s): < 3.1.7
  • Patched version(s): 3.1.7

References

Could your website be exposed too?

SmartScanner can check your website for ejs template injection vulnerability and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated January 30, 2023