CVE-2023-29827

ejs v3.1.9 is vulnerable to server-side template injection

Critical · published May 4, 2023

CVSS v3.1
9.8
EPSS
6%
Percentile
92.8
In the wild
Unconfirmed
What it is

🔥 A sneaky server-side template injection in ejs v3.1.9 could let attackers manipulate your templates like a DJ remixing a song—if they can control the ejs file!⚡ Think of this vulnerability as a restaurant chef who accidentally leaves the recipe book in view of a savvy diner. That diner could swap ingredients around, creating dishes that were never intended by the chef—a recipe for disaster! An attacker could exploit this to craft malicious templates, leading to unauthorized server access or data leakage. This could result in devastating consequences like exposure of sensitive information or even remote code execution!

Put simply

Think of this vulnerability as a restaurant chef who accidentally leaves the recipe book in view of a savvy diner. That diner could swap ingredients around, creating dishes that were never intended by the chef—a recipe for disaster! This vulnerability allows template injection through unsafe configuration of the closeDelimiter parameter, where untrusted input can manipulate the rendering process. While the vendor disputes this risk, the potential for abuse exists if the ejs file is controllable.

What to do

An attacker could exploit this to craft malicious templates, leading to unauthorized server access or data leakage. This could result in devastating consequences like exposure of sensitive information or even remote code execution! To protect your application, upgrade to ejs version 3.1.10 or later. Review your template files to ensure they aren't exposed to untrusted input, and implement strict validation on any configuration settings! You've got this! With these steps, you can safeguard your application and keep your templates secure! 🛡️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.05552 · 92.8th percentile
Published
2023-05-04T00:00Z
EPSS history
Timeline
  • 04 MAY 00:00Z
    ejs v3.1.9 is vulnerable to server-side template injection
    cvelistv5