
Cloud Vulnerability DB
An open project to list all known cloud vulnerabilities and Cloud Service Provider security issues
CVE-2022-31129 affects Moment.js, a JavaScript date library for parsing, validating, manipulating, and formatting dates. The vulnerability was discovered and disclosed on July 6, 2022. The affected versions are 2.18.0 through versions prior to 2.29.4. The issue involves an inefficient parsing algorithm in the moment constructor that makes the library vulnerable to (Re)DoS attacks when processing user-provided strings without proper length checks (GitHub Advisory).
The vulnerability stems from an inefficient regular expression used in the preprocessRFC2822 function for parsing RFC2822 date formats. The original regex pattern '/())|[\n\t]/g' had quadratic (N²) complexity due to its greedy matching behavior. When processing specific inputs, particularly those with many opening parentheses, the parsing algorithm would exhibit significant performance degradation. The issue was fixed in version 2.29.4 by modifying the regex to '/(())|[\n\t]/g' to prevent matching nested parentheses (GitHub PR).
When exploited, this vulnerability can cause a Denial of Service (DoS) condition through excessive CPU consumption. A noticeable slowdown is observed with inputs exceeding 10,000 characters. The vulnerability has a CVSS v3.1 base score of 7.5 (High), indicating significant potential impact on system availability (NVD).
The primary mitigation is to upgrade to Moment.js version 2.29.4 or later, which contains the security fix. For users unable to upgrade immediately, it is recommended to implement input length validation before passing strings to the moment constructor. A suggested limit is 200 characters, as legitimate date-time strings rarely exceed this length. This length restriction helps prevent both this vulnerability and potential future ReDoS attacks (GitHub Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
An open project to list all known cloud vulnerabilities and Cloud Service Provider security issues
A comprehensive threat intelligence database of cloud security incidents, actors, tools and techniques
A step-by-step framework for modeling and improving SaaS and PaaS tenant isolation
Get a personalized demo
“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
“We know that if Wiz identifies something as critical, it actually is.”