{"id":"CVE-2022-29078","aliases":["CVE-2022-29078","GHSA-phwq-j96m-2c2q"],"related":[],"kind":"vulnerability","state":"published","title":"ejs template injection vulnerability","summary":"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).","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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).","source":"cvelist"},{"lang":"es","text":"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)","source":"nvd"}],"published":"2022-04-25T14:13:32.000Z","modified":"2026-06-17T04:39:32.440Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-74","CWE-94"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.1.7"}],"ecosystem":"npm","package":"ejs","purl":"pkg:npm/ejs","source":"ghsa"},{"ranges":[{"status":"affected","version":"3.1.6"}],"vendor":"ejs","product":"ejs","cpe":"cpe:2.3:a:ejs:ejs:3.1.6:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/mde/ejs/releases","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://eslam.io/posts/ejs-server-side-template-injection-rce/","tags":["exploit","patch","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://security.netapp.com/advisory/ntap-20220804-0001/","tags":["third-party-advisory","x-refsource-confirm","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-29078","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/mde/ejs/commit/15ee698583c98dadc456639d6245580d17a24baf","tags":["web"],"sources":["ghsa"]},{"url":"https://eslam.io/posts/ejs-server-side-template-injection-rce","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/mde/ejs","tags":["package"],"sources":["ghsa"]},{"url":"https://security.netapp.com/advisory/ntap-20220804-0001","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-29078","url":"https://www.cve.org/CVERecord?id=CVE-2022-29078","licence":"CVE Terms of Use","modified":"2024-08-03T06:10:58.967Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-phwq-j96m-2c2q","url":"https://github.com/advisories/GHSA-phwq-j96m-2c2q","licence":"CC-BY-4.0","modified":"2023-11-08T04:09:07.883Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-29078","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-29078","licence":"Public domain","modified":"2026-06-17T04:39:32.440Z"}],"updatedAt":"2026-11-25T22:58:11.226Z","epss":{"score":0.32808,"percentile":0.98381,"date":"2026-12-01T12:00:22.000Z"}}