CriticalGHSA-phwq-j96m-2c2qCVE-2022-29078

ejs template injection vulnerability

Published 26 Apr 2022 · Updated 8 Nov 2023

Affected package

ejsnpm
Affected
<3.1.7
Fixed in
3.1.7
Update to the fixed version for your release line, for example:npm install ejs@3.1.7

Details

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).

Is GHSA-phwq-j96m-2c2q in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected ejs, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.