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:

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