CVE-2022-29078
ejs template injection vulnerability
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).
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
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).
- Record
CVE-2022-29078- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-94
- Updated
- 2026-11-02
CVE List No score
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).
- Record
CVE-2022-29078- Updated
- 2026-11-02
EUVDEUVD-2022-1801 No score
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).
- Record
EUVD-2022-1801- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-phwq-j96m-2c2q
9.8
ejs template injection vulnerability
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).
- Record
GHSA-phwq-j96m-2c2q- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-74
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2022-29078
9.8
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).
- Record
DEBIAN-CVE-2022-29078- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
OSVGHSA-phwq-j96m-2c2q
9.8
ejs template injection vulnerability
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).
- Record
GHSA-phwq-j96m-2c2q- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-74
- Updated
- 2026-11-02
Show 5 moreShow less
OSVUBUNTU-CVE-2022-29078
9.8
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).
- Record
UBUNTU-CVE-2022-29078- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVCLSA-2026-1774570929 No score
TuxCare security update for ejs (5 CVEs)
TuxCare rebuilt ejs to address 5 CVEs. Fixed in 1.0.0-tuxcare.1.
- Record
CLSA-2026-1774570929- Updated
- 2026-11-02
OSVCLSA-2026-1774570931 No score
TuxCare security update for ejs (2 CVEs)
TuxCare rebuilt ejs to address 2 CVEs. Fixed in 2.7.4-tuxcare.1.
- Record
CLSA-2026-1774570931- Updated
- 2026-11-02
OSV No score
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).
- Record
CVE-2022-29078- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2022-29078 No score
CVE-2022-29078 in @rootio/ejs - Patched by Root
Root has patched CVE-2022-29078 in the @rootio/ejs package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2022-29078- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
ejsnpm |
before 3.1.7 | 3.1.7 |
ejsTuxCare:npm From an advisory covering 5 CVEs |
1.0.0-tuxcare.0 up to 1.0.0-tuxcare.1, plus listed versions 1.0.0 |
1.0.0-tuxcare.1 |
ejsTuxCare:npm From an advisory covering 2 CVEs |
2.7.4-tuxcare.0 up to 2.7.4-tuxcare.1, plus listed versions 2.7.4 |
2.7.4-tuxcare.1 |
node-ejsDebian:12 |
before 3.1.7-1 | 3.1.7-1 |
node-ejsDebian:13 |
before 3.1.7-1 | 3.1.7-1 |
node-ejsDebian:14 |
before 3.1.7-1 | 3.1.7-1 |
@rootio/ejsRoot:npm |
before 2.7.4-root.io.1 | 2.7.4-root.io.1 |
ejsRoot:npm |
before 2.7.4-aikido.1 | 2.7.4-aikido.1 |
node-ejsUbuntu:18.04:LTS |
All versions, plus listed versions 2.5.2-12.5.7-1 |
None known |
node-ejsUbuntu:20.04:LTS |
All versions, plus listed versions 2.5.7-1 |
None known |
node-ejsUbuntu:22.04:LTS |
All versions, plus listed versions 2.5.7-33.1.6-2 |
None known |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | miko550/CVE-2022-29078 | 2022-07-20 |
| PoC in GitHub | shurochka1396/expluatation_CVE-2022-29078 | 2023-07-26 |
| PoC in GitHub | l0n3m4n/CVE-2022-29078 | 2024-11-05 |
| PoC in GitHub | chuckdu21/CVE-2022-29078 | 2025-01-07 |
| PoC in GitHub | AlonNavon/npm-demo | 2026-02-15 |
| PoC in GitHub | amusedx/CVE-2022-29078 | 2026-04-12 |
| PoC in GitHub | test-avm-714877d2df585126/C-test-2 | 2026-06-24 |
| PoC in GitHub | test-avm-714877d2df585126/vuln-ejs-critical | 2026-06-24 |
| PoC in GitHub | taka3636/CVE-2022-29078 | 2026-07-11 |
| Nuclei | Node.js Embedded JavaScript 3.1.6 - Template Injection |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | OSV | |
| exploits | OSV | |
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, Nuclei, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-29078 is a critical vulnerability (CVSS 9.8) in Ejs, published April 25, 2022. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 32.8%, the 98th percentile. Fixed in ejs 3.1.7.