CVE-2017-1000228
remote code execution vulnerability in ejs (npm)
What is CVE-2017-1000228 About?
This vulnerability in nodejs `ejs` versions older than 2.5.3 allows for remote code execution. It is caused by weak input validation in the `ejs.renderFile()` function, enabling attackers to inject and execute arbitrary code. Exploitation is straightforward, requiring malicious input to the templating function.
Affected Software
Technical Details
The vulnerability in ejs (Embedded JavaScript templating) versions older than 2.5.3 lies within the ejs.renderFile() function. This function suffers from weak input validation, specifically when processing input that populates a template. An attacker can craft malicious input that, when passed through ejs.renderFile(), is not properly sanitized or escaped. This allows the attacker to inject and execute arbitrary JavaScript code on the server where the ejs template is being rendered, leading to remote code execution (RCE).
What is the Impact of CVE-2017-1000228?
Successful exploitation may allow attackers to execute arbitrary code on the server, potentially leading to full system compromise, data theft, or further network penetration.
What is the Exploitability of CVE-2017-1000228?
Exploitation is of low to moderate complexity. The primary requirement is that an attacker can submit malicious input to an application that then processes it using the vulnerable ejs.renderFile() function without adequate sanitization. Authentication requirements depend on whether the target application allows unauthenticated users to submit data that feeds into template rendering. In many cases, no specific privileges are needed beyond being able to interact with the application's input fields. The attack is remote, targeting the server-side rendering process. The primary risk factor is any Node.js application using an affected ejs version to render user-supplied data.
What are the Known Public Exploits?
| PoC Author | Link | Commentary |
|---|---|---|
| No known exploits | ||
What are the Available Fixes for CVE-2017-1000228?
About the Fix from Resolved Security
Available Upgrade Options
- ejs
- <2.5.5 → Upgrade to 2.5.5
Struggling with dependency upgrades?
See how Resolved Security's drop-in replacements make it simple.
Book a demoAdditional Resources
What are Similar Vulnerabilities to CVE-2017-1000228?
Similar Vulnerabilities: CVE-2022-0262 , CVE-2022-24754 , CVE-2022-31005 , CVE-2022-37434 , CVE-2023-28155
