CVE-2017-18214 in Moment Moduleinfo

Summary

by MITRE

The moment module before 2.19.3 for Node.js is prone to a regular expression denial of service via a crafted date string, a different vulnerability than CVE-2016-4055.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 02/12/2025

The vulnerability identified as CVE-2017-18214 affects the moment.js library version 2.19.2 and earlier in Node.js environments, representing a significant security concern that falls under the category of regular expression denial of service attacks. This vulnerability specifically manifests when the library processes crafted date strings that contain maliciously constructed regular expressions designed to exploit performance weaknesses in the parsing logic. The flaw is particularly concerning because it allows attackers to craft input that causes the regular expression engine to enter into a computationally expensive state, leading to resource exhaustion and potential system instability.

The technical implementation of this vulnerability stems from the moment.js library's date parsing mechanisms, which utilize regular expressions to identify and interpret various date formats. When a maliciously crafted date string is processed, the regular expression patterns used by the library can be manipulated to cause catastrophic backtracking in the regular expression engine. This occurs when the regular expression contains constructs that create exponential time complexity during pattern matching, causing the system to consume excessive CPU resources and potentially leading to denial of service conditions. The vulnerability is distinct from CVE-2016-4055, indicating that while both involve regular expression issues in date parsing, they affect different code paths within the moment.js library.

From an operational impact perspective, this vulnerability poses serious risks to applications that rely on moment.js for date processing, particularly those handling user-provided input or external data sources. An attacker could exploit this vulnerability by sending carefully crafted date strings to applications, causing them to become unresponsive or crash, effectively rendering services unavailable to legitimate users. The attack vector is particularly dangerous in web applications where date inputs are commonly accepted from users, making this vulnerability a prime target for exploitation in distributed denial of service attacks or service disruption campaigns. The vulnerability affects systems across multiple platforms since moment.js is a widely used JavaScript library with cross-platform compatibility.

Security professionals should consider this vulnerability in the context of the CWE-400 category, which encompasses weaknesses related to resource exhaustion and denial of service conditions. The specific manifestation of this issue aligns with CWE-1320, which addresses the use of regular expressions that are vulnerable to catastrophic backtracking. Additionally, this vulnerability can be mapped to ATT&CK technique T1499.004, which involves network denial of service attacks, as the exploitation can effectively disrupt service availability. Organizations should prioritize updating their moment.js library to version 2.19.3 or later, as this release contains the necessary patches to mitigate the regular expression denial of service vulnerability. The mitigation strategy should also include input validation measures, implementing rate limiting on date parsing operations, and monitoring for unusual resource consumption patterns that might indicate exploitation attempts.

Reservation

03/04/2018

Disclosure

03/04/2018

Moderation

accepted

CPE

ready

EPSS

0.00230

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!