CVE-2017-1000228: ejs is vulnerable to remote code execution due to weak input validation
9.8
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.91115%
CWE
Published
11/30/2017
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:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
ejs | npm | < 2.5.3 | 2.5.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from unsafe merging of user-provided data with template options. Analysis of the patches shows:
- render() and renderFile() both used the vulnerable cpOptsInData function
- cpOptsInData lacked validation for dangerous options like 'root' prior to blacklist
- The commits explicitly modify option handling in these functions
- Exploit would show these functions processing attacker-controlled options
- CVE description specifically implicates renderFile() as the entry point Internal cpOptsInData is included as it appears in execution flow when options are processed from user input.