9.8critical
ejs template injection vulnerability
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 32.8% (higher than 98% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-phwq-j96m-2c2q
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).
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| ejs (npm) | before 3.1.7 | GitHub Advisory Database |
| ejs ejs | 3.1.6 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
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).
NVD (es)
El paquete ejs (también se conoce como plantillas JavaScript Insertadas) versión 3.1.6 para Node.js, permite una inyección de plantillas del lado del servidor en settings[view options][outputFunctionName]. Esto es analizado como una opción interna, y sobrescribe la opción outputFunctionName con un comando arbitrario del Sistema Operativo (que es ejecutada al compilar la plantilla)
References
| https://github.com/mde/ejs/releases | release-notes, third-party-advisory, web | |
| https://eslam.io/posts/ejs-server-side-template-injection-rce/ | exploit, patch, third-party-advisory | |
| 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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-29078 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-phwq-j96m-2c2q changed 2023-11-08 | CC-BY-4.0 |
| NVD | CVE-2022-29078 changed 2026-06-17 | Public domain |