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 scanRelated Issues
- Valine code injection vulnerability - CVE-2022-38545
- Nadesiko3 OS Command Injection vulnerability - CVE-2022-41642
- XSS/HTML Injection Vulnerability in Umbraco Backoffice Components - CVE-2025-24012
- matrix-js-sdk Prototype Pollution vulnerability - CVE-2022-36059


