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]

published April 25, 2022

CVSS
โ€”
EPSS
33%
Percentile
98.4
In the wild
Unconfirmed
What it is

๐Ÿšจ A crafty server-side template injection lurks in the ejs package! This sneaky flaw can let attackers execute arbitrary OS commands โ€” a recipe for disaster! ๐Ÿ”ฅ Think of this vulnerability like a restaurant where the chef accepts any special order without checking if it's actually safe to prepare. Just like an unchecked order can lead to a kitchen disaster, an unvalidated template can execute harmful commands on your server. An attacker could hijack your template processing to run any command on your server, leading to devastating consequences like data theft or unauthorized access. This could dramatically compromise your application or even the entire server environment!

Put simply

Think of this vulnerability like a restaurant where the chef accepts any special order without checking if it's actually safe to prepare. Just like an unchecked order can lead to a kitchen disaster, an unvalidated template can execute harmful commands on your server. The ejs package 3.1.6 allows server-side template injection through the settings[view options][outputFunctionName] parameter, which lets attackers overwrite the outputFunctionName option with malicious OS commands executed during template compilation.

What to do

An attacker could hijack your template processing to run any command on your server, leading to devastating consequences like data theft or unauthorized access. This could dramatically compromise your application or even the entire server environment! To mitigate this risk, update the ejs package to version 3.1.7 or later. Additionally, review your template handling processes to ensure that user inputs are properly validated and sanitized before processing. Ensure security best practices are in place in your Node.js applications. You've got this! Fixing this vulnerability is just a few updates away! ๐Ÿ›ก๏ธ

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.32808 ยท 98.4th percentile
Published
2022-04-25T14:13Z
EPSS history
Timeline
  • 25 APR 14:13Z
    The ejs (aka Embedded JavaScript templates) package 3.1.6 for Node.js allows server-side template injection in settings[view options][outputFunctionName]
    cvelistv5