Live threats

All CVEs / Ejs

CVE-2022-29078Ejs

Critical 9.8 No auth neededHigh EPSS

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

Original NVD text.

What to do

  1. Apply the vendor's security update for Ejs.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow 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)

VendorProductVersions
ejsejs3.1.6

Official sources

References

Links published by the sources. Open them with care.