CVE-2022-29078Ejs
Critical 9.8 No auth neededHigh EPSS
Follow: this CVE · Ejs · Ejs We alert you by email or Slack (account required).
- Priority
- 77
- CVSS 3.1
- 9.8
- EPSS
- 27.9% probability of exploitation in 30 days · percentile 99
- Auth required
- No
- Published
- Apr 25, 2022
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-94
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
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).
What to do
- Apply the vendor's security update for Ejs.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | ejs |
< 3.1.7 |
3.1.7 |
npm install ejs@3.1.7 |
Per OSV / GitHub Advisories (GHSA-phwq-j96m-2c2q). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| ejs | ejs | 3.1.6 |
Official sources
References
Links published by the sources. Open them with care.
- eslam.io Exploit Patch Third Party Advisory
- github.com Release Notes Third Party Advisory
- security.netapp.com Third Party Advisory