CVE-2017-1000189: ejs vulnerable to DoS due to weak input validation
7.5
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.74863%
CWE
Published
3/5/2018
Updated
9/8/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
ejs | npm | < 2.5.5 | 2.5.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from weak input validation in the cpOptsInData
function, which copies options from user-provided data into rendering settings. The commit patching this issue introduced a blacklist (_OPTS_IN_DATA_BLACKLIST) to block unsafe options like 'root' and 'filename'. In vulnerable versions, this validation was missing, allowing attackers to pass these options via the data object in ejs.renderFile()
, leading to DoS. While ejs.renderFile()
is the entry point, the root cause is the insecure handling of options in cpOptsInData
.