Every CVE Search/ Get API key

CVE-2022-29078

ejs template injection vulnerability

9.8 CriticalPublic exploitFix available

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

32.8%Up 31.9 points since Apr 26, 2022
90%50%10%1%

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 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
7.5 HighAV: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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

Affected packages
PackageAffectedFixed
ejs
npm
before 3.1.7
3.1.7
ejs
TuxCare: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
ejs
TuxCare: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-ejs
Debian:12
before 3.1.7-1
3.1.7-1
node-ejs
Debian:13
before 3.1.7-1
3.1.7-1
node-ejs
Debian:14
before 3.1.7-1
3.1.7-1
@rootio/ejs
Root:npm
before 2.7.4-root.io.1
2.7.4-root.io.1
ejs
Root:npm
before 2.7.4-aikido.1
2.7.4-aikido.1
node-ejs
Ubuntu:18.04:LTS
All versions, plus listed versions
2.5.2-12.5.7-1
None known
node-ejs
Ubuntu:20.04:LTS
All versions, plus listed versions
2.5.7-1
None known
node-ejs
Ubuntu: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.

Public exploits
SourceLinkDate
PoC in GitHubmiko550/CVE-2022-290782022-07-20
PoC in GitHubshurochka1396/expluatation_CVE-2022-290782023-07-26
PoC in GitHubl0n3m4n/CVE-2022-290782024-11-05
PoC in GitHubchuckdu21/CVE-2022-290782025-01-07
PoC in GitHubAlonNavon/npm-demo2026-02-15
PoC in GitHubamusedx/CVE-2022-290782026-04-12
PoC in GitHubtest-avm-714877d2df585126/C-test-22026-06-24
PoC in GitHubtest-avm-714877d2df585126/vuln-ejs-critical2026-06-24
PoC in GitHubtaka3636/CVE-2022-290782026-07-11
NucleiNode.js Embedded JavaScript 3.1.6 - Template Injection

History

History
RecordedChangedSources
affected, factsOSV
exploitsOSV
aliasesEUVD
first indexedCVE 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.

References

Show 5 moreShow less
MoveEnter Open