RCE in Ejs
CVE-2022-29078
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).
Vulnerability class: RCE (Remote Code Execution)
Published · last modified .
CVSS v3 metric
CVSS v3 base score 9.8 (Critical). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
EPSS exploit prediction
EPSS 0.328, 98.4th percentile (scored ); unchanged over 30 days. About EPSS.
Affected products
- Ejs — versions 3.1.6
Weakness classification (CWE)
Public exploits and proof-of-concept code
13 public repositories with exploit or proof-of-concept code for this CVE:
- miko550/CVE-2022-29078 (8 stars, last pushed 2022-09-07): vuln ejs 3.1.6 docker
- l0n3m4n/CVE-2022-29078 (3 stars, last pushed 2024-11-08): Serverside Template Injection (SSTI) RCE - THM challenge "whiterose"
- test-avm-714877d2df585126/C-test-2 (last pushed 2026-10-22): Dependabot security automerge test - ejs CVE-2022-29078
- seal-sec-demo-2/JavaScript-Example (last pushed 2026-08-03): Seal Security example — vulnerable npm app (EJS CVE-2022-29078) remediated to sealed versions; GitHub Actions + Jenkins integration
- taka3636/CVE-2022-29078 (last pushed 2026-07-11)
- test-avm-714877d2df585126/vuln-ejs-critical (last pushed 2026-07-02): npm repo with ejs CVE-2022-29078 (CVSS 9.8, EPSS 32%) for Dependabot automerge testing
- seal-sec-demo-2/npm-demo (last pushed 2026-04-16): Browser demo: EJS template injection (CVE-2022-29078) with Seal Security remediation
- amusedx/CVE-2022-29078 (last pushed 2026-04-12)
- AlonNavon/npm-demo (last pushed 2026-02-15): Browser demo: EJS template injection (CVE-2022-29078) with Seal Security remediation
- chuckdu21/CVE-2022-29078 (last pushed 2025-01-07): PoC for CVE-2022-29078
3 more are listed on the interactive page.
Also mentioned in 43 other repositories (0pensrcerer/JfrogAdvSec-demo, 0xTeles/cwchallenge, alarmant0/Vulnerability-Assessment-ISCTE, …). These reference the CVE in a list, notes or a scanner and are not exploit code for it.
References
- github.com/mde/ejs/releases (Third Party Advisory, Release Notes)
- eslam.io/posts/ejs-server-side-template-injection-rce/ (Exploit, Patch, Third Party Advisory)
- security.netapp.com/advisory/ntap-20220804-0001/ (Third Party Advisory)
This CVE has public exploit evidence. See the latest CVEs with public exploits.