Miggo Logo

CVE-2017-1000189: ejs vulnerable to DoS due to weak input validation

7.5

CVSS Score
3.0

Basic Information

EPSS Score
0.74863%
Published
3/5/2018
Updated
9/8/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
ejsnpm< 2.5.52.5.5

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

no**js *js v*rsion ol**r t**n *.*.* is vuln*r**l* to * **ni*l-o*-s*rvi** *u* to w**k input v*li**tion in `*js.r*n**r*il*()`

Reasoning

T** vuln*r**ility st*ms *rom w**k input v*li**tion in t** `*pOptsIn**t*` *un*tion, w*i** *opi*s options *rom us*r-provi*** **t* into r*n**rin* s*ttin*s. T** *ommit p*t**in* t*is issu* intro*u*** * *l**klist (_OPTS_IN_**T*_*L**KLIST) to *lo*k uns*** o