{"id":"UBUNTU-CVE-2022-29078","details":"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).","modified":"2025-10-24T04:53:38Z","published":"2022-04-25T15:15:00Z","upstream":["CVE-2022-29078"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2022-29078"},{"type":"REPORT","url":"https://eslam.io/posts/ejs-server-side-template-injection-rce/"},{"type":"REPORT","url":"https://github.com/mde/ejs/commit/15ee698583c98dadc456639d6245580d17a24baf"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2022-29078"}],"affected":[{"package":{"name":"node-ejs","ecosystem":"Ubuntu:18.04:LTS","purl":"pkg:deb/ubuntu/node-ejs@2.5.7-1?arch=source&distro=bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.5.2-1","2.5.7-1"],"ecosystem_specific":{"binaries":[{"binary_name":"node-ejs","binary_version":"2.5.7-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-29078.json"}},{"package":{"name":"node-ejs","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/node-ejs@2.5.7-1?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.5.7-1"],"ecosystem_specific":{"binaries":[{"binary_name":"node-ejs","binary_version":"2.5.7-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-29078.json"}},{"package":{"name":"node-ejs","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/node-ejs@3.1.6-2?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.5.7-3","3.1.6-2"],"ecosystem_specific":{"binaries":[{"binary_name":"node-ejs","binary_version":"3.1.6-2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-29078.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}