Cloudanix VulnDB

CVE-2016-4055

Medium · 6.5

CVSS

6.5

EPSS

9.9%

Published

Jan 23, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in a date handling library can let attackers slow down or crash applications by sending specially formatted long text, making services unavailable until fixed.

Exploit Available
Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Denial of service
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The duration function in the moment package uses a vulnerable regular expression that can be exploited to cause excessive CPU consumption when processing specially crafted long strings, leading to denial of service.

Why it matters to the business

Applications using the affected moment package may experience high CPU usage and become unresponsive when processing malicious input, potentially disrupting services and requiring restarts; the widespread use of moment in Node.js ecosystems amplifies operational risk across dependent products.

How an attack unfolds

An attacker identifies an input path that invokes the duration function and submits a long, specially crafted string that triggers catastrophic backtracking in the regex, exhausting CPU resources on the server.

How to fix it

Upgrade the moment package to version 2.11.2 or later; for listed affected products apply the exact fixes such as velero-plugin-for-aws-fips to 1.9.2-r5 or moment/moment GIT commit dd9cff0104c0dc3f114f54107397c59920e764cc.

How to confirm the fix worked

Verify the installed version of moment is at least 2.11.2, review dependency manifests for the vulnerable package, and test the duration function with known benign inputs to confirm absence of excessive processing time.

Typical attack path

  1. Identify an input vector that reaches the duration function
  2. Craft a long string designed to cause catastrophic backtracking in the regex
  3. Submit the string via network request
  4. Observe CPU exhaustion on the target system

How to detect it

Review application logs and Node.js process metrics for sudden sustained high CPU usage correlated with requests that invoke date or duration parsing; no distinctive post-exploitation artifacts are typically left behind.

What your security team should do

  • Update all instances of the moment package to the fixed versions immediately given the availability of public exploits
  • Scan the full dependency tree for transitive uses of vulnerable moment versions
  • Implement input length validation on any paths that parse duration strings
  • Monitor Node.js process CPU metrics for anomalous sustained high usage

The record

The duration function in the moment package before 2.11.2 for Node.js allows remote attackers to cause a denial of service (CPU consumption) via a long string, aka a "regular expression Denial of Service (ReDoS)."

Affected packages

Ecosystem Package Introduced Fixed
npm moment 0 2.11.2
Debian:10 node-moment 0 2.13.0+ds-1
Debian:11 node-moment 0 2.13.0+ds-1
Debian:12 node-moment 0 2.13.0+ds-1
Debian:13 node-moment 0 2.13.0+ds-1
Ubuntu:18.04:LTS node-moment 0 2.20.1+ds-1
Ubuntu:Pro:16.04:LTS node-moment 0 2.11.0+ds-1ubuntu0.1~esm1

Related vulnerabilities