CVE-2017-1000189: ejs denial of service via weak input validation

CVE-2017-1000189 · Severity: low · CVSS 3 · Published 2018-03-05

ejs is a popular Node.js templating engine used to generate dynamic content in web applications. A vulnerability in versions before 2.5.5 allows an attacker to crash the application by sending specially crafted input to the renderFile() function, resulting in service outage without requiring authentication.

Technologies: ejs (npm). Vendors: npm.

Quick answers

Is CVE-2017-1000189 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2017-1000189 being exploited in the wild.
How severe is CVE-2017-1000189?
Low severity, with a CVSS score of 3, published 5 March 2018.
Which products and versions are affected?
ejs (npm) SEMVER:introduced=0,fixed=2.5.5.
Is there a fix for CVE-2017-1000189?
Yes. ejs (npm): upgrade to 2.5.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2017-1000189 attacked?
It is attacked over the network.
Am I affected by CVE-2017-1000189?
Check whether you run ejs (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • ejs (npm): upgrade to 2.5.5 or later
    npm install ejs@2.5.5

Technical details

The vulnerability is a denial-of-service (CWE-20: improper input validation) in ejs.renderFile() caused by insufficient validation of user-supplied input. The renderFile() function accepts options parameters that were not properly sanitized, allowing an attacker to pass unsafe options through the data object. No authentication is required and the vulnerability is network-accessible. An attacker can exploit this to trigger an unhandled exception or resource exhaustion, crashing the application and disrupting service availability. The fix was released in version 2.5.5, which implements a blacklist of unsafe options to prevent them from being passed via the data object.

Affected products

  • ejs ejs < 2.5.5

Identifiers

  • CVE-2017-1000189
  • GHSA-6x77-rpqf-j6mw

Timeline

  • 2018-03-05: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.