# CVE-2022-29078: ejs template injection vulnerability

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 32.8%, higher than 98% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-04-25T14:13:32.000Z
- Modified: 2026-06-17T04:39:32.440Z
- Also known as: GHSA-phwq-j96m-2c2q
- Weaknesses: CWE-74, CWE-94
- Assigned by: mitre

## Description

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

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- ejs (npm): before 3.1.7
- ejs ejs: 3.1.6

## Every score

- GitHub: 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`
- NVD: 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`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://eslam.io/posts/ejs-server-side-template-injection-rce/> (exploit, patch, third-party-advisory)
- <https://github.com/mde/ejs/releases> (release-notes, third-party-advisory, web)
- <https://security.netapp.com/advisory/ntap-20220804-0001/> (third-party-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-29078> (advisory)
- <https://github.com/mde/ejs/commit/15ee698583c98dadc456639d6245580d17a24baf> (web)
- <https://eslam.io/posts/ejs-server-side-template-injection-rce> (web)
- <https://github.com/mde/ejs> (package)
- <https://security.netapp.com/advisory/ntap-20220804-0001> (web)

## Sources

- CVE List: [CVE-2022-29078](https://www.cve.org/CVERecord?id=CVE-2022-29078), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-phwq-j96m-2c2q](https://github.com/advisories/GHSA-phwq-j96m-2c2q), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-29078](https://nvd.nist.gov/vuln/detail/CVE-2022-29078), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-29078 · Whole record: https://cve.day/CVE-2022-29078.json · Rebuilt by cve.day 2026-11-25T22:58:11.226Z
